[Bug 1249] [XQuery] Is it too restrictive to only allow last path step to return atomic values?

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





------- Additional Comments From mike@saxonica.com  2005-04-14 20:23 -------
As Michael Rys responded, the WGs spent a lot of time on this issue. A number of
people felt that there was a need for a "simple mapping operator" equivalent to

for . in SEQ1 return SEQ2

One syntax that was proposed was SEQ1!SEQ2. Overloading "/" to perform this
function is difficult because of the rule that "/" causes nodes to be delivered
in document order with duplicates eliminated. Allowing atomic values on the left
would also have the effect that the value of 10/5 is 5, which some WG members
found abhorrent. Hence the suggestion to use a different operator; but others
thought the very subtle distinction between the two operators would be too
confusing, and in any case, the new operator would offer insufficient usability
benefit over writing "for $x in S1 return S2($x)". The decision to allow atomic
values on the right of "/" while still requiring nodes on the left is something
of a compromise but it happened to be the solution that got the most support.

Michael Kay

Received on Thursday, 14 April 2005 20:23:34 UTC