XSLT 2.0 implementation

This version introduces initial support of features defined in working drafts of XSLT 2.0 and XPath 2.0.

Version 7.0 should be regarded as an experimental alpha release. For production use, please continue to use Saxon 6.5

The Saxon package name has changed from com.icl.saxon to net.sf.saxon. Any applications that use Saxon java classes directly (rather than relying on the JAXP interface) will need to be modified. Note that this also affects the settings of the system properties javax.xml.parsers.SAXParserFactory and javax.xml.transform.TransformerFactory.

The entry point from the command line has changed from com.icl.saxon.StyleSheet to net.sf.saxon.Transform.

The namespace URI for saxon extensions has changed from http://icl.com/saxon to http://saxon.sf.net/. Note that many extensions have been withdrawn, as they are superseded by facilities in XPath 2.0 and/or XSLT 2.0.

To allow coexistence, the name of the JAR file for this release has changed to saxon7.jar. The SQL extensions are now in a separate JAR file, saxon7-sql.jar. A transformation can now be executed directly from the JAR file using the command java -jar saxon7.jar in place of java net.sf.saxon.Transform.

Saxon now requires JDK 1.2 or later to run. In consequence, Saxon will no longer work with the Microsoft Java VM, and the Instant Saxon version of the product is therefore no longer available.

Because Saxon no longer runs with the Java VM, it can now be run as an applet within Internet Explorer only if the Sun Java plug-in is installed. You can get this from http://java.sun.com/getjava. This may require some configuration changes because of the differences in security policy.

The following sections summarize the main new features. These assume familiarity with the XPath 2.0 and XSLT 2.0 specifications; however, summaries of the new syntax for expressions and XSLT elements are included in this package.

The xsl:value-of element has a new separator attribute, so it can be used to output a sequence.

The xsl:for-each element supports arbitrary sequences.

The extension elements saxon:group and saxon:item are withdrawn.

The new xsl:for-each-group instruction, and the associated current-group() function, are implemented.

The xsl:function and xsl:result elements are implemented; these replace saxon:function and exslt:function. Note that the XSLT 2.0 specification is more restrictive as to what can appear in a function body: it has to be zero or more xsl:param elements, followed by zero or more xsl:variable elements, followed by an xsl:result element. However, this is not a serious restriction in practice, because most computations can now be carried out within a single XPath expression.

The new xsl:namespace instruction is implemented (it writes a namespace node to the result tree)

The xsl:copy-of can now handle sequences containing simple-values (the simple value is converted to a string and written to the result tree). However, the separator attribute is not yet implemented.

  • The xsl:document element (and its synonym saxon:output) are replaced by xsl:result-document. This no longer includes the serialization attributes directly, instead it refers by name to an xsl:output declaration, or can use the unnamed xsl:output declaration by default.
  • The xsl:output element now supports method="xhtml", replacing method="saxon:xhtml". The precise details of the output may not be fully conformant with the specification.

    The xsl:destination element is provided, however, since the href attribute is currently ignored, it is not very useful at this stage.

    The saxon:handler element is no longer supported.

    The xsl:script element is no longer supported - however, the synonym saxon:script remains available

    A collation attribute has been added to xsl:sort, and the implementation of sorting now uses JDK 1.2 collators. The collation attribute must match the name attribute of a saxon:collation element. If none is specified, the lang attribute is now used to select a collator, or if the lang attribute is omitted, a collator is obtained for the default locale.

    Named sort keys are available, via the xsl:sort-key element. A named sort key may be used to perform a sort from within an XPath expression, using the new XSLT-defined sort() function.