Functions, operators, and data types for XPath 2.0

The XSLT format-number() function now accepts an empty sequence as the first argument, treating it as if the value NaN were supplied. The function now formats decimal values without first converting them to doubles; this means that the full precision can be retained. The function also implements a change to the W3C specification that has been agreed but not yet published: when a number such as 123 is formatted using the picture "000.###", the result will now contain no trailing decimal point. That is, the output will be "123" rather than "123.".

The error() function now implements the signatures defined in the current specification. Note however that (a) the URI part of the error QName is currently ignored, and (b) the third argument to the error() function, if specified, has no effect.

The escape-uri() function now accepts an empty sequence: in this case it returns a zero-length string. The function now never escapes a % sign: previously a percent sign was escaped unless followed by two hex digits.

The lang() function now accepts an optional second argument giving the node whose language is to be tested.

The local-name-from-QName() function has been changed to return a value of type xs:NCName.

The upper-case() and lower-case() functions have been changed to return a zero-length string when the argument is an empty sequence.

The functions string-to-codepoints(), resolve-QName(), and resolve-uri() functions have been changed to return an empty sequence when the first argument is an empty sequence.

The functions string-length() and normalize-space(), when called with no arguments, now use the string-value of the context item as their input, rather than the atomized value of the context item. This makes no difference unless you are using a schema.

A number of functions have been changed to report the error codes defined in the W3C specification.