Altova Mailing List Archives


RE: [xsl] Re: Re: order of UNIONs

From: "Michael Kay" <michael.h.kay@------------>
To:
Date: 11/15/2001 5:32:00 AM
>
> From what I can see in the XQuery/XPath WDs, it doesn't look as though
> there will be a concept of 'sets' in XPath 2.0. My guess is that a
> location path will return a sequence in document order.

That's correct. There won't be any sets; there will just be some functions
and operators that treat sequences as if they were sets. This is on the
principle that the set of "sequences of distinct nodes in document order"
has a one-to-one correspondence with the set of "sets of nodes", therefore
the concept of a node-set can be modelled as a sequence of distinct nodes in
document order. You potentially lose some type-checking and polymorphism (as
Dimitre pointed out), but it's actually a useful simplification to have only
one kind of collection.

> I haven't noticed anything where, when manipulating node sequences in
> the same way as you currently construct node sets, things work
> differently from the way they would if you were actually working with
> node sets.

Correct. This should be 100% compatible. I'll talk to you off-the-record
some time about the debates that produced that outcome...
>
> As written, xf:identity-distinct() converts a node sequence containing
> duplicates to one that doesn't, but to get something that works in the
> same way as a node set, you'd have to union the sequence with itself
> (as above) or use xf:sort() (though I don't think that should be a
> function in any case).
>
> The other relevant function is xf:unordered(), which acts as a 'hint'
> to the processor that the sequence can be treated as unordered. I
> don't really understand when you'd use that, though, I must admit.

You can expect changes in these functions in the next working draft. (The
published data model itself is now very stable, with the possible exception
of modelling and naming of complex types.)

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.