XQuery 1.0 implementation

Importing library modules is now supported, using the import module syntax. At present, all the modules in a query are compiled at the same time. The location of each module (the at clause in import module) must be included the first time a particular module is imported, but it may be omitted on subsequent occasions (modules are processed recursively, depth first). If a module for a particular namespace is already loaded, then the at clause is ignored. Optionally, applications can precompile library modules and register them in the Configuration object, and they will then be found when another module attempts to import them by namespace alone.

The query parser now attempts recovery after a syntax error, resuming parsing at the next semicolon.

The predeclared namespace prefix local is available for use when defining local user-defined functions.

Creating two attributes with the same name for the same element is now reported as an error. Previously (as in XSLT) the second simply overwrote the first.

Namespace declarations in direct element constructors are now correctly scoped; namespace prefixes in element and attribute names in a direct element constructor are correctly validated. (This is a bug fix). The rules concerning the distinction between active and passive namespaces are properly applied (active namespaces are copied to the result, passive namespaces are not).

The order by options empty least and empty greatest have been implemented. At the same time, code has been added to check that the sort key is not a sequence of length greater than one.

It is now possible to specify a parameter on the command line in the form +param=filename. The filename will be parsed as an XML document, and the document node will be passed to the stylesheet as the value of the external variable param. If the filename is a directory, then all the files contained immediately within the directory will be parsed and the result will be passed as a sequence of document nodes.

A query can now be included directly in the command line rather than reading it from a file. It is written enclosed in curly braces. For example java net.sf.saxon.Query {doc('a.xml')//p[1]} selects elements within the file a.xml in the current directory.

Any filename passed using the -s option is no longer accessible via the input() function, but is still accessible as the context node.