Hi all,
I’m learning XQuery now and I have a question:
Given a sequence of non-distinct nodes(what I say for “non-distinct” is that there might be nodes with the same node name and value, ie. abc), can we use the node comparison predicates(is, <<, >>) to identify them? E.g. given a sequence $seq, waht can we get from the following XQuery piece?
for $e1 in $seq
let $other :=
(
for $e2 in $seq
return
(
if (not($e1 is $e2)) then $e2 else ()
)
)
Suppose we have a node sequence <a,b,d,c,a>, what can we get in $other for the first node “a” after this query is executed? Do we get {b,d,c} or {b,d,c,a}? If it’s {b,d,c}, then is there any other way to get {b,d,c,a} instead?
Thank you very much. Your help is really appreciated.