Saxonica.com

Extensions

When an extension function has a declared return type of java.lang.Object in Java, or System.Object in .NET, the inferred static type is now xs:anyAtomicType rather than external object. This means that if the value actually returned at run-time is, say, an integer, and the value is used where an integer is required, then the call will not be rejected as a compile-time type error.

The extension function saxon:transform() has changed: in the third argument, which is used to pass parameters to the stylesheet, the argument must now be a sequence of element nodes, attribute nodes, or document nodes. If a document node is supplied, it is treated as equivalent to passing its element children.

Two new extension functions saxon:compile-query() and saxon:query() are available. They allow a query to be constructed dynamically as a string, compiled, and repeatedly executed. The input to the function can (if required) be created using the new saxon:xquery output method.

A new extension function saxon:result-document() is available in Saxon-SA, for the benefit of XQuery users. Modelled on the xsl:result-document instruction, it allows a query to generate multiple output documents and serialize them to filestore.

The implementation of the EXSLT math:power() function has been extended to cater for numeric data types other than xs:double. For example, the result of math.power(2, 128) is now calculated using integer rather than double arithmetic, and the result is an integer. For the full rules, see EXSLT

In Saxon's implementation of the EXSLT dates-and-times library, the current date/time that is used is now aligned with the XPath 2.0 current-dateTime() function, and thus returns the same value for the duration of a query or transformation.

The extension function saxon:typeAnnotation() now accepts any item. For a node it returns the type annotation; for an atomic value it returns the type label. The return type is now xs:QName (it was previously a lexical QName returned as a string).

The extension functions yearMonthDurationFromMonths() and dayTimeDurationFromSeconds(), which have been undocumented since Saxon 8.1, have finally been dropped. The same effect can be achieved by multiplying a duration of one month or one second by the appropriate integer.

The extension function saxon:tokenize(), also undocumented since Saxon 8.1, has been dropped. Use fn:tokenize() instead.

Three new extension functions are available to find when a file was last modified. Two variants of saxon:last-modified() test the last modified date of the file from which a node was obtained; the function saxon:file-last-modified() takes an absolute URI as its argument.

Next