XSLT 3.0 implementation

(Also affects XSLT 2.0): Saxon no longer detects or reports the recoverable error XTRE0270 (conflicting definitions of xsl:strip-space and xsl:preserve-space). Instead it always takes the optional recovery action, which is to use whichever declaration comes last. Previously this was the behaviour when applying stripping to an existing tree, but not when using a stripping filter during tree construction. The change is made in the interests of simplifying and speeding up the code (matching of whitespace stripping rules no longer shares the same code as template rule matching).

(Also affects XSLT 2.0): The call system-property("xsl:is-schema-aware") now returns true or false depending on whether the particular stylesheet is schema-aware (which is true if it uses xsl:import-schema or if schema-awareness was selected via an API or command line option). Previously it returned true if the stylesheet was processed using the schema-aware version of the Saxon product, regardless of configuration settings.

XSLT 3.0 features are available only in Saxon-EE or (in some cases) Saxon-PE, and they need to be enabled explicitly. From the command line this can be done using the option xsltversion:3.0; the default is to take the version from the xsl:stylesheet element, so that XSLT 3.0 features are enabled if and only if the stylesheet itself specifies version="3.0".

XPath 3.0 constructs such as higher-order functions (to the extent they are implemented) are automatically available when XSLT 3.0 is enabled.

The xsl:evaluate instruction is implemented.

The xsl:copy instruction now has an optional select attribute, defaulting to select=".".

The saxon:iterate, saxon:break, saxon:continue, and saxon:finally instructions are renamed xsl:iterate, xsl:break, xsl:next-iteration, and xsl:on-completion, and are available only if XSLT 3.0 support is enabled. The xsl:break instruction is now allowed to take a sequence constructor as its content.

The saxon:try and saxon:catch elements are renamed xsl:try and xsl:catch, and are available only if XSLT 3.0 support is enabled.

The syntax of match patterns has been extended, to include the forms $x, $x//a/b/c, doc(X), doc(X)//a/b/c, element-with-id(X), element-with-id(X)//a/b/c, as well as the two-argument form of id() and the three-argument form of key(). The keyword "union" is allowed as an alternative to the "|" operator.

Not yet implemented in patterns: intersect and except operators, parentheses, "~" syntax, patterns matching atomic values or function items, descendant and descendant-or-self axes, namespace-node()

The unparsed-text-lines() function is implemented.

The copy-of() and snapshot() functions are implemented. (There is a restriction in snapshot(), in that it does not yet handle attribute or namespace nodes.

The xsl:analyze-string instruction accepts the enhancements to regular expressions and flags defined in XPath 3.0. It also now accepts an empty sequence as the value of the select attribute, treating it in the same way as a zero-length string.