Saxon Extensions

This section describes the extensions and implementation-defined features provided with the Saxon product.

If you want to implement your own extensions, see Extensibility Mechanisms.

The extensions described here were provided because there are things that are difficult to achieve, or inefficient, using standard XSLT/XQuery facilities alone. In some cases they are retained from earlier releases even though equivalent functionality is available using the standard language. As always, it is best to stick to the standard if you possibly can: and most things are possible, even if it's not obvious at first sight.

All Saxon extensions require a namespace declaration xmlns:saxon="http://saxon.sf.net/" to appear. In XSLT this is typically declared on the xsl:stylesheet element; it is also useful to write exclude-result-prefixes="saxon" to prevent the Saxon namespace appearing in the result tree. In XQuery the namespace is declared by writing declare namespace saxon="http://saxon.sf.net/"; in the Query prolog.

If you use XSLT extension instructions such as saxon:doctype, it is also necessary to include the attribute extension-element-prefixes="saxon". This does not apply, however, if you are only using extension functions.

For details of additional extensions available in XQuery only, see XQuery Extensions.

For details of extensions to XML Schema 1.1 used for schema processing, see XML Schema 1.1 Extensions.

Saxon also provides a set of extension elements providing access to SQL databases, see Saxon SQL Extension.

A W3C Community Group is working on proposals for extensions to XPath, XSLT, and XQuery, which could eventually become part of a version 4.0 set of specifications. Saxon includes experimental implementations of some of these proposals. For details of what is implemented in Saxon, and how to enable these features, see Experimental 4.0 Extensions.

Further information: