Functions, operators, and data types for XPath 2.0

Casting to xs:double or xs:float now fails if the value is non-numeric (other than the special values INF, -INF, and NaN); previously it returned NaN. This does not affect the number() function, which still returns NaN. A consequence of this change is that "ABC" castable as xs:float now returns false.

The types xs:hexBinary and xs:base64Binary are implemented. (I have not attempted to reduce the set of supported types to the basic set required in XSLT, partly because XSLT 2.0 and XQuery 1.0 differ in this regard.)

Functions contains(), starts-with(), ends-with(), substring-before(), substring-after(), string-value(), substring(), replace(), now treat an empty sequence (supplied in either argument) as if it were a zero-length string. The result can no longer be an empty sequence.

The translate() function is changed so that an empty sequence is treated as a zero-length string in the first argument, and is not allowed in the second and third arguments; the result can no longer be empty.

Reversed the order of the arguments to get-namespace-uri-for-prefix. The prefix is now the first argument, the element is the second.

Changed get-timezone-from-date() to return the correct timezone, and to return it as a dayTimeDuration; changed get-timezone-from-time() to return the timezone as a dayTimeDuration.

Addition or subtraction of a date|time|dateTime to a duration is supported, as defined in the specification. {date080-082}

Subtraction of two date|time|dateTime values to return an xdt:dayTimeDuration is supported. {date083}

The idref() function is implemented. {idky201, idky202, qxmp120}

All the functions whose names begin with get- support the new name (without the get- prefix) as a synonym. The old name will be dropped in a later release. (This change to the specification was made after the 12 November 2003 working drafts).

The regular expression syntax in the functions matches, replace, and tokenize, and also in xsl:analyze-string, is now implemented strictly as defined in the language specifications. The has been achieved by integrating James Clark's code for translating XML Schema regular expressions to Java JDK 1.4 regular expressions, with modifications to handle the additional capabilities allowed in XPath and XSLT (such as reluctant quantifiers and back-references).

The four flags m, s, i, x in regular expression functions are now implemented as described in the specification.

The XSLT function function-available now accepts a second argument, the required arity. (This new feature has been added during the Last Call).