saxonica.com

EXSLT Extensions

EXSLT is an initiative to define a standardized set of extension functions and extension elements that can be used across different XSLT processors.

Saxon supports the EXSLT modules Common, Math, Sets, DatesAndTimes, and Random. These functions are available both in XSLT and in XQuery. The full list of EXSLT extension functions implemented is:

These extensions are available in Saxon-PE and Saxon-EE "out of the box". If you want to use them in Saxon-HE, you will need to compile the source code yourself, and use them in the same way as user-written extension functions. The source code is available in the saxon-resources download, package com.saxonica.open.exslt. The code is available under the Mozilla Public License.

There are some known restrictions and local interpretations:

EXSLT extensions that overlap XSLT 2.0 functionality have sometimes been retained in cases where they have no impact on the Saxon core code, but in cases (such as func:function) where the semantics are inconveniently different from XSLT 2.0, they have been withdrawn.

The function math:power() has been extended from the EXSLT definition to handle numeric data types other than xs:double. The result will now be an xs:integer if the first argument is an xs:integer and the second argument is a non-negative xs:integer. Otherwise, the result will be an xs:decimal if the first argument is an xs:decimal or xs:integer, and the second argument is a whole number (a number of any data type that is equal to some integer). In other cases the arguments are converted to xs:double and the result is an xs:double.

The specifications of the EXSLT date-and-time handling functions have little to say about timezones. Saxon generally handles inputs with or without a timezone, and uses the XPath 2.0 concept of implicit timezone to interpret the meaning of dates/times without a timezone. The current date and time used by EXSLT functions is the same as that used by the XPath 2.0 current-dateTime() function.

Next