Incomplete explanation of the effect of unordered() in "2.9 FLWR Expressions"

The spec states that...

The following query returns the same results as
"for $i in (1, 2), $j in (3, 4)...", but the tuples may occur in any order

for $i in unordered((1, 2)),
    $j in unordered((3, 4))
return
    <tuple>
      <i>{ $i }</i>
      <j>{ $j }</j>
    </tuple>

Can it return the following result?

<tuple>
   <i>1</i>
   <j>3</j>
</tuple>
<tuple>
   <i>2</i>
   <j>3</j>
</tuple>
<tuple>
   <i>1</i>
   <j>4</j>
</tuple>
<tuple>
   <i>2</i>
   <j>4</j>
</tuple>

I think it can't. At lease it would be better if it can't, because I want to have guaranteed
grouping by $i even if I have unordered() on $i.

Similarly, I hope that
for $i in unordered((1, 2)), $j in (3, 4) ...
and
for $i in (1, 2), $j in unordered((3, 4)) ...
preserves the order of 'ordered' sequences.

Best Regards,
IvAn Mikhailov


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

Received on Saturday, 4 May 2002 16:12:32 UTC