SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
| Version 8.9 (2007-02-12)
» | Version 8.8 (2006-09-05)
| Version 8.7.3 (2006-06-13)
| Version 8.7.2 (2006-04-19)
| Version 8.7.1 (2006-04-13)
| Version 8.7 (2006-02-24)
| Version 8.6.1 (24 November 2005)
| Version 8.6 (3 November 2005)
| Version 8.5.1 (26 August 2005)
| Version 8.5 (2 August 2005)
| Version 8.4 (4 April 2005)
| Version 8.3 (11 February 2005)
| Version 8.2 (21 December 2004)
| Version 8.1.1 (8 October 2004)
| Version 8.1 (24 September 2004)
| Version 8.0 (1 June 2004)
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# XSLT Changes

XSLT: Sorting and Collations

The default collation for `xsl:sort` has changed. If no `collation`, `lang`, or `case-order` attribute is present on the `xsl:sort` element, the default collation is determined in the same way as the default collation for operators such as `le` and functions such as `min` and `max`: that is, it is taken from the nearest enclosing `[xsl:]default-collation` attribute if there is one, or failing that, the Unicode codepoint collation is used.

This change is motivated primarily by performance considerations. Previously Saxon used the linguistic collation for the current Java locale. Sort-intensive stylesheets can run at five times the speed when using the codepoint collation.

The change also has usability benefits in that it brings the default collation for `xsl:sort` into line with the defaults for all other functions and operators, and with the `order by` construct in XQuery.

For English-speaking users, the most noticeable effect will be that upper-case now precedes lower-case, for example, "ZEBRA" sorts before "aardvark".

Note that according to the XSLT 2.0 specification, the default collation used by `xsl:sort` is implementation-defined.

If linguistic collation is required, this can be achieved by specifying `lang="en"` (or another language) on the `xsl:sort` element. To pick up the collation for the current Java locale, whatever it might be, specify `collation="http://saxon.sf.net/collation"` with no query parameters. It is possible to specify a default collation for a stylesheet module using the `default-collation` attribute on the `xsl:stylesheet` element, but note that this will affect other operations besides sorting.

From this release, the `saxon:collation` declaration is deprecated, and the `default` attribute of this declaration is ignored.

XSLT: Validation of Namespace URIs

XSLT error codes XTDE0835 and XTDE0865 are now detected and reported. This means that it is an error to supply a value for the `namespace` attribute of `xsl:element` or `xsl:attribute` that is not a valid URI. Note that this represents a backwards incompatibility from previous Saxon releases and from the XSLT 1.0 specification, which explicitly stated that supplying an invalid URI was not an error.

Similarly the `xsl:namespace` instruction now raises error `XDTE0905` if the constructed namespace node has a string value that is not a valid URI.

Next