W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2007

[Bug 4855] [XPath] Undocumented incompatibility

From: <bugzilla@wiggum.w3.org>
Date: Tue, 13 Nov 2007 17:04:48 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1IrzBw-0007WE-0A@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4855





------- Comment #3 from zongaro@ca.ibm.com  2007-11-13 17:04 -------
According to comment #0, "-@x|@y in XPath 1.0 returns -3, but in XPath 2.0
(without static type checking) returns 3."  However, I believe that in XPath
2.0, if compatibility mode is true, evaluating the expression -@x|@y, given the
indicated context node, results in a type error.  According to section 3.4,[1]
in compatibility mode, "If the atomized operand is an empty sequence, the
result of the arithmetic expression is the xs:double value NaN."  So the result
of -@x is NaN in this case.  According to 3.3.3,[2] "If an operand of union, 
intersect, or except contains an item that is not a node, a type error is 
raised [err:XPTY0004]," so -@x|@y results in a type error.

If compatibility mode is false, -@x will result in an empty sequence, so I 
believe the result of -@x|@y will be a sequence containing the attribute 
node "y", rather than the value 3.
Received on Tuesday, 13 November 2007 17:04:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:21 GMT