SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
| Source Documents on the Command Line
» | Saxon and XML 1.1
| JAXP Source Types
| Third-party Object Models: DOM, JDOM, and XOM
| Choosing a Tree Model
| The PTree File Format
| Validation of Source Documents
| Whitespace Stripping in Source Documents
| Serial Processing of Large Documents
XML Schema Processing
The XPath API
Standards Conformance
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
XSLT Patterns

# Saxon and XML 1.1

XML 1.1 (with XML Namespaces 1.1) extends XML 1.0 in three ways:

- The set of valid characters is increased

- The set of characters allowed in XML Names is increased

- Namespace undeclarations are permitted.

Saxon is capable of working with XML 1.1 input documents. If you want to use Saxon with XML 1.1, you should set the option "-1.1" on the Saxon command line, or call the method `configuration.setXMLVersion(Configuration.XML11)` or, in the case of XSLT, `transformerFactory.setAttribute(FeaturesKeys.XML_VERSION, "1.1")`

This configuration setting affects:

- validation of names used in XQuery and XPath expressions, including names of elements, attributes, functions, variables, and types

- validation of names of constructed elements, attributes, and processing instructions in XQuery and XSLT

- schema validation of values of type xs:NCName, xs:QNames, xs:NOTATION, and xs:ID

- the permitted names of stylesheet objects such as keys, templates, decimal-formats, output declarations, and output methods

- the characters considered valid in the source of an XQuery query

- the characters considered valid in the result of the functions codepoints-to-string() and unparsed-text()

- the characters considered valid in the result of certain Saxon extension functions

- the way in which line endings in XQuery queries are normalized

- the default version used by the serializer (with output method XML)

Note that if you use the default setting of "1.0", then supplying an XML 1.1 source document as input may cause undefined errors.

You can set the configuration to allow XML 1.1, but still serialize result documents as XML 1.0 by specifying the output property `version="1.0"`. In this case Saxon will check while serializing the document that it conforms to the XML 1.0 constraints (note that this check can be expensive). These checks are not performed if the configuration default is set to XML 1.0.

If you want the serializer to output namespace undeclarations, use the output property `undeclare-namespaces="yes"` as well as `version="1.1"`.

Next