XPath 1.0 Backwards Compatibility Mode

The XSL and XQuery working groups, meeting jointly, today looked at comments
concerning XPath backwards compatibility, including

http://lists.w3.org/Archives/Public/public-qt-comments/2004Feb/0298.html

from Martin Duerst, and the XPath-related parts of

http://lists.w3.org/Archives/Public/public-qt-comments/2004Feb/0856.html

from David Carlisle.

The WGs agreed to accept a change proposal which removes most of the
incompatibilities listed in Appendix H.1: that is, it takes XPath 2.0
running in backwards compatibility mode much closer to XPath 1.0 (and by
implication, further from XPath 2.0 without BCM). If you have access to
member-only areas, the details are at:

http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2004Sep/0074.html

The main effects of the change can be summarised as:

* comparing anything to a singleton boolean works by converting the other
operand to a boolean

* the comparisons <, <=, >, and >= involving sequences containing any
mixture of strings, untypedAtomic values, and numbers are done by converting
the items in both operands to xs:double

* all arithmetic is double arithmetic

The remaining incompatibilities that we are aware of are:

* the construct A < B < C is now a syntax error; it must be rewritten as (A
< B) < C to achieve the same effect as XPath 1.0.

* Certain strings such as "+INF", "1e5", and "+2" which converted to NaN in
XPath 1.0 now convert to values other than NaN. So for example ("+2" > "-2")
was false, and is now true.

The proposal did not address any residual incompatibilities in the function
library.

I trust that these changes are acceptable.

Michael Kay
for the XSL and XQuery WGs

Received on Tuesday, 14 September 2004 17:00:19 UTC