In XQuery,
(\"foo\", \"bar\") = (\"foo\", \"bar\")
yields the value true
. That seems obvious. But I noticed that
(
XQuery =
and !=
are existential operators. They yield true if any element in the left set together with any element in the right set would return true for this operator (so actually same semantics for =
, !=
, >
, ... - all the comparison operators without alphabetical characters).
("foo", "bar") != ("foo", "bar")
"foo" on the left side is !=
"bar" on the right side, so the whole comparison is true.
You probably want to use deep-equal for the equals-comparison and its negated version for the not-equals-comparison as you already proposed in your question.