This file describes changes for versions 7.0 and later. For changes prior to version 7.0, see http://saxon.sf.net/saxon6.5/changes.html.
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.
($a, $b, $c).
Path expressions now return a sequence of nodes containing no duplicates, in document
order.a/(b|c)/d,
or document('x')/key('a','b')1 to 10 evaluates to the
sequence ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 )*:localname (like prefix:*) is allowed in path expressions, and also
in patterns and in xsl:strip-space and xsl:preserve-space. It matches
any node with the given local name, regardless of namespace.xsl:value-of element has a new separator attribute, so it can
be used to output a sequence.xsl:for-each element supports arbitrary sequences.saxon:group and saxon:item are
withdrawn.xsl:for-each-group instruction, and the associated current-group()
function, are implemented.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.xsl:namespace instruction is implemented (it writes a
namespace node to the result tree)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.
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.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.xsl:destination element is provided, however, since the href
attribute is currently ignored, it is not very useful at this stage.saxon:handler element is no longer supported.xsl:script element is no longer supported - however,
the synonym saxon:script remains availablecollation 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. 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.I have made the following changes to the function library:
saxon:distinct() extension function now works on any sequence.count() and sum() functions now ork on any sequence,
and new functions avg(), min(), and max() are provided.ends-with()upper-case() and lower-case().
These use the rules defined by the Java default localesystem-property()saxon:range() extension function
(it can now be done using the syntax "a to b")saxon:tokenize() to return a sequence of strings instead of a node-setkey() so that the second argument can be any sequence;
each member of the
sequence is converted to a string and treated as a potential key valuedocument() so that the first argument can be any sequence; each member of
the sequence can be a URI of a document to be loaded.saxon:node-set() extension function, which is now obsolete.saxon:if() extension function, which is superseded by XPath 2.0
conditional expressions.saxon:closure() function is temporarily withdrawn, because it relies on non-standard
use of the current() function.node-set() function in the EXSLT common module is now a no-op; the object-type()
function returns one of "sequence", "boolean", "number", "string", or "external".highest() and lowest() in the EXSLT math
module to work on arbitrary sequences.exists() and empty(),
insert() and remove(),
index-of() and sublist().not3() (three-valued not() function)string-pad() functionsaxon:exists() and saxon:for-all():
these are superseded by the some and every
constructs in XPath 2.0compare() function: the third argument (collation) is initially mandatory, and must
be a QName matching a saxon:collation elementbase-uri() function replacing the undocumented
saxon:base-uri() extension functionfloat() is the only way of creating a single-precision
floating point number.In general, features of XSLT 2.0 and XPath 2.0 not listed above have not been implemented. In particular, these include:
type attribute of xsl:variable, etc.instance of and
cast as.As might be expected, the Saxon code has undergone major change internally, which will affect any application making significant use of internal interfaces. Here are some of the highlights:
for
expressions. It is also used in various other contexts, e.g. in the implementation of
the document(), key() and id() functions.getStringValue,
this allows both SimpleValues and Nodes to implement the new Item interface, which
represents a member of a sequence.net.sf.saxon.value, now contains all the data-type related classes. I have removed documentation of the saxon:trace extension attribute; it seems this hasn't been working for some time.
Context class no longer implements the XSLT 1.1 WD interface
org.w3c.xsl.XSLTContext.com.icl.saxon.handlers (ElementHandler etc). It is still
possible for a Java application to register a NodeHandler to receive events; this
must now be written as an implementation of the net.sf.saxon.NodeHandler interface.
See the ShowBooks.java sample application to see how.data-type
or lang attribute of xsl:sort; instead, it must be specified using the
collation attribute,
with a saxon:collation element that maps the named collation to a Java
class that implements the JDK java.util.Comparator interface.A new sql:query instruction has been added, to accompany the
existing sql:connect, sql:insert, etc.
Attributes:
| table | The table to be queried (the contents of the FROM clause of the select statement). This is mandatory, the value is an attribute value template. |
| column | The columns to be retrieved (the contents of the SELECT clause of the select statement). May be "*" to retrieve all columns. This is mandatory, the value is an attribute value template. |
| where | The conditions to be applied (the contents of the WHERE clause of the select statement). This is optional, if present the value is an attribute value template. |
| row-tag | The element name to be used to contain each row. Must be a simple name (no colon allowed). Default is "row". |
| column-tag | The element name to be used to contain each column. Must be a simple name (no colon allowed). Default is "col". |
The xsl:query instruction writes zero or more row elements to the current
result tree, each containing zero or more column elements, which contain the data values.
Thanks to Claudio Thomas [claudio.thomas@web.de] who supplied the original version of this code.
The SQL extensions are now contained in a separate JAR file, saxon7-sql.jar,
which must be on the class path if these extensions are used.
Michael H. Kay
20 December 2001