Functions, operators, and data types for XPath 2.0

Collations can now be specified directly using a URI, without requiring a saxon:collation declaration. This makes them available in XQuery and XPath applications as well as XSLT. The URI takes a form such as http://saxon.sf.net/collation?lang=de;strength=primary and is specified fully in Collation URIs. {r/addq1, sort26}

The collection function is implemented. The Saxon implementation interprets the URI of the collection as a reference to an XML document that acts as a catalogue listing the documents in the collection. An example of a catalogue document is:

<collection> <doc href="doc1.xml"/> <doc href="doc2.xml"/> <doc href="doc3.xml"/> </collection>

In effect, collection("a.xml") is merely a shorthand for document(document("a.xml")/collection/doc/@href). My thinking is to extend the catalogue structure in future to allow options to be specified for how errors are handled, how the documents are parsed (e.g. validation, space stripping), and whether the documents should be locked in memory. {mdocs19}

The tokenize() function now supports the facility to split a string into its invididual characters if the regex matches a zero-length string. For example, tokenize('alphabet', '') returns the sequence ('a', 'l', 'p', 'h', 'a', 'b', 'e', 't'). Note: there has been some discussion on this topic in the public-qt-comments list, and the specification could change as a result. {regex19}

In XPath expressions in XSLT stylesheets, core functions can now appear in the fn: namespace (currently http://www.w3.org/2003/05/xpath-functions). Of course, they can also be unprefixed. {coreFunction101}

The result of dividing two integers is now a decimal. {math-two17}

Values of type xs:language are now properly validated. {type008}