XPath 2.0 implementation

The namespaces for the fn: and xdt: prefixes, and the URI for the Unicode codepoint collation, have been updated to match the latest specs (replace 2003/05 with 2003/11).

The new rules for double-to-string conversion are implemented. Values outside the range 1e-6 to 1e+6 are expressed in exponential notation, values within this range are formatted as decimals or integers. {expr111, 112}

In the XPath free-standing API, it is now possible to use the fn: namespace when calling functions in the core library. (It is also still possible to use these functions without any namespace).

A rewrite optimization has been added for expressions of the form E = M to N when E, M, and N are known statically to be integers. The test reduces to E ge M and E le N, which avoids comparing E with every integer in the range. When the test is of the form SEQ[position() = M to N] and M and N are constant integers, an even more powerful optimization is used that stops the iteration over SEQ as soon as item N is reached. {opt015, opt016}

The "minimax" optimization has been reinstated for comparing numeric sequences. This translates an expression of the form N1 < N2 into the form min(N1) < max(N2). It was used prior to version 7.4, at which point it was found to be unsafe if both sequences contain untyped atomic values. It is now used only if at least one of the sequences is statically known to contain numeric values only.