Saxonica.com

XSLT changes

A schema-aware transformation can now be requested using the new -sa option on the command net.sf.saxon.Transform, as an alternative to using the command com.saxonica.Transform.

The initial context node supplied as input to a transformation is no longer required to be part of a document (for example, it can be a parentless element). There are some API changes to the Controller class as a consequence of this change: in particular, the methods getPrincipalSourceDocument and setPrincipalSourceDocument are deprecated and replaced by methods to get or set the initialContextNode.

The evaluation of XSLT attribute value templates is now notified to the TraceListener. The standard TraceListener ignores this notification, but a user-written TraceListener can take action on it.

In xsl:namespace-alias, checking and reporting of the error conditions XTSE0810, XTSE0812, and XTSE0815 has been improved.

The xsl:namespace-alias declaration now allows use of #default in either the stylesheet-prefix or result-prefix attributes to refer to the null namespace if no default namespace has been declared. This change was made by the working group to restore backwards compatibility with the interpretation of the XSLT 1.0 specification adopted by some processors (including Saxon and MSXML).

The format-number() function now outputs NaN without any prefix or suffix. (W3C change, see W3C Bugzilla 2712).

Alphanumeric collations are now supported. In such a collation, any sequence of consecutive digits is treated as a number and is sorted numerically. For example, by specifying collation="http://saxon.sf.net/collation?alphanumeric=yes" on the xsl:sort element, a collating sequence is used in which "iso8859" sorts before "iso10646".

The saxon:collation declaration has been enhanced to allow additional properties of the collation to be specified: case-order, alphanumeric, ignore-case, ignore-modifiers, ignore-symbols, ignore-width. These properties are also available as query parameters in collation URIs.

When copying elements or attributes using xsl:copy-of, or when copying attributes using xsl:copy, Saxon now reports an error if the copy asks for type annotations to be retained when the content is namespace-sensitive (QName or NOTATION values), unless namespaces are also copied. Error XTTE0950 is reported when this error occurs.

XSLT input supplied using a JAXP TransformerHandler is now schema-validated if the Configuration is set up to request schema-validation of source documents.

If the href attribute of xsl:include or xsl:import contains a fragment identifier, this is now stripped from the URI before calling the URIResolver. The URIResolver is now responsible for locating the document containing the referenced stylesheet module, while Saxon itself then locates the xsl:stylesheet element within that document using the fragment identifer as an ID value. There should be no change in behaviour if the default URIResolver is used.

Next