Re: [XQuery] Union, Intersect, and Except (qt-2003Nov0188-01)

Elliotte,

In message:

http://lists.w3.org/Archives/Public/public-qt-comments/2003Nov/0188.html

You asked:

Why are the union, intersect, and except operations limited to working 
on sequences of nodes? It seems to me that they are perfectly well 
defined operations for sequences of arbitrary types, and that these 
three operators should be declared to work on sequences of item type. If

there's no good reason for limiting them to node()*, I would ask that 
the signatures of these operators be revised to item()* instead.

I am responding on behalf of the XQuery working group.

Firstly, thank you for raising the comment.

This question has been debated a number of times over the last couple of
years. At one stage we had operators that worked both on nodes and on
atomic values, as you suggest. However, the semantics for nodes turned
out to be very different from the semantics for atomic values, because
(a) nodes have identity, while atomic values don't, and (b) for
compatibility with XPath 1.0 (as used in XSLT), the union operator is
required to return results in document order.

For some time we then had two sets of functions/operators, one for nodes
and one for atomic values. However, it was observed that the functions
for atomic values (a) were needed relatively rarely, (b) had more than
one reasonable definition (set semantics versus bag semantics), and (c)
could very easily be written by users. This led to the present situation
where these functions were removed from the core library and instead
documented as examples of user-written functions, in Appendix C.2 of the
functions and operators draft.

The Query working group considered your comment at its telcon on
2004-01-14, and deided to maintain the status quo with these functions.
The XSL Working Group will be invited to review this decision, as it
affects both languages.

Could I ask you please to confirm whether you find this decision
acceptable?

Best regards,

Michael Kay
for the XQuery Working Group
(in response to action A-164-04)

Received on Friday, 16 January 2004 17:45:30 UTC