In XQuery,
(\"foo\", \"bar\") = (\"foo\", \"bar\")
yields the value true
. That seems obvious. But I noticed that
(
This can be found in the documentation for XQuery under section "3.5.2 General Comparisons".
The following example contains two general comparisons, both of which are true. This example illustrates the fact that the = and != operators are not inverses of each other.
(1, 2) = (2, 3) (1, 2) != (2, 3)
Reading into the reasoning, it reads to me as if the rules of Atomization are to blame here. If the elements are untypedAtomic, then the parser is free to "guess" at how the comparison should be made which allows for the difference in operations based on the elements themselves rather than on any operator behavior.