Saxon extensions to the W3C XSLT/XQuery specifications

A new top-level declaration is introduced: saxon:import-xquery allows the functions defined in an XQuery library module to be called from XPath expressions in the stylesheet. See import-query for details.

The extension functions saxon:before, saxon:get-user-data, and saxon:set-user-data, which have not been documented for some while, have finally been removed.

The rules in the spec on extension attributes have been clarified, in a way that makes it clear that the saxon:allow-avt attribute on xsl:call-template is not conformant. This attribute has therefore been removed, and dynamic calls on templates are enabled instead using a new extension element, saxon:call-template. In changing your stylesheet to use the new instruction, remember to set extension-element-prefixes="saxon". {saxon21}

The sequence type as="java:java.lang.Object" can now be used to refer to the type of a wrapped Java object returned by an extension function. The namespace prefix "java" binds to the namespace URI http://saxon.sf.net/java-type. (My thinking is that eventually it will be possible to use any Java class name to define the actual Java class of the external object. At present, however, only java.lang.Object is recognized.) {saxon51}

I have changed the design of the SQL extension so that the database connection is now stored explicitly in a variable, and the value of this variable is supplied on instructions such as sql:insert and sql:query. See the books-sql.xsl sample application to see how this works. {saxon51}

When calling Java methods, any XPath value can now be passed to a method that expects a DOM NodeList; a run-time ClassCastException occurs if the value contains an item that is not a node, or a node that is not represented by a DOM org.w3c.xml.Node (e.g. if it is a JDOM node). Not tested.