Saxon and XML 1.1

XML 1.1 (with XML Namespaces 1.1) originally extended XML 1.0 in three ways:

The second change has subsequently been retrofitted to XML 1.0 Fifth Edition (XML 1.0e5). Saxon now uses the XML 1.1 and XML 1.0e5 rules unconditionally for all validation of XML names.

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 -xmlversion: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:

Since Saxon 9.4, the configuration setting no longer affects:

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.

It is advisable to use an XML parser that supports XML 1.1 when the configuration is set to "1.1", and an XML parser that does not support XML 1.1 when the configuration is set to "1.0". However, Saxon does not enforce this.

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".