Enabling 4.0 features
Because the features in the draft 4.0 specifications cannot be considered stable, they are not enabled by default, and in most cases they are not available in Saxon-HE. To enable 4.0 functionality:
- On the XQuery command line, use the option
-qversion:4.0. - On the XSLT command line, use the option
-xsltversion:4.0. - On the
XQueryCompilerclass, callsetLanguageVersion("4.0"). - On the
XsltCompilerclass, callsetXsltLanguageVersion("4.0"). - On the
XPathCompilerclass, callsetLanguageVersion("4.0"). - To use XPath 4.0 in XSD assertions, set the global
ConfigurationpropertyFeature.XPATH_VERSION_FOR_XSD, or set the attributesaxon:extensions="any-xpath-version"on thexs:schemaelement.
In addition, if only for good documentation, any XSLT stylesheet module that uses 4.0 syntax should specify version="4.0"
on the outermost element (xsl:stylesheet, xsl:transform, or xsl:package),
and any XQuery module that uses 4.0 syntax should specify xquery version 4.0; in the module header.
The effect of using a version declaration that differs from the processor version is defined in the language
specifications.
Saxon also recognizes the configuration property ALLOW_SYNTAX_EXTENSIONS to enable both extensions defined in the 4.0 specifications, and Saxon-specific language extensions.