The Saxon XQuery implementation allows you to call Java methods as external functions. The
function does not need to be declared. Use a namespace declaration such as
namespace math="java:java.lang.Math", and invoke the method as
More details of this mechanism are found in Reflexive extension functions.
Saxon provides many extensions and implementation-defined features which can be used in XQuery. See Extensions for full details about using these.
The full library of Saxon, EXSLT and EXPath functions described in the Function library is available, except for those (for example, some
saxon:serialize) that have an intrinsic dependency on an XSLT
The XPath syntax extensions described in Experimental 4.0 extensions are also available in XQuery.
There are a number of XQuery specific extensions available, which are fully documented in XQuery syntax extensions:
Saxon recognizes the XQuery pragma syntax, but it currently defines only one pragma of its own, the
saxon:validate-typepragma, and this is now mostly redundant since the equivalent facility is standard in XQuery 3.0. It serves one remaining purpose, which is to allow attributes to be validated. Saxon will adopt the correct fallback behavior if presented with a query that uses another vendor's extensions, provided these are designed in conformance with the W3C pragma specification.
Saxon recognizes the XQuery option declaration syntax. Some specific option declarations are provided, but these are mostly obsolete:
declare option saxon:outputdeclares a serialization parameter. Superseded by
declare option output:XXXXX; except Saxon-specific option declarations are still needed for declaring Saxon-specific serialization parameters. (See The
declare option saxon:memo-functiondefines whether the following function declaration is to be implemented as a memo function; superseded by the function annotation
%saxon:memo-function. (See The
Any other option declaration in the Saxon namespace is ignored with a warning; an option declaration in any other namespace is ignored silently.