OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: [xml-dev] Nasty XPath expressions

[ Lists Home | Date Index | Thread Index ]

> Umm, no.
> Node-sets are ordered sets.  The spec spends (too much?) time
> discussing the ordering of returned sets, which depend upon the axis.
> So it isn't exactly true that they are always in document order
> (particularly if you're using a complex expression that moves in
> multiple axes), but it is true that the nodes are returned in
> the order
> of encounter, as specified by the axis.  Typically, this
> means document
> order.
> They are *not* unordered sets.

Wrong. XPath 1.0 node-sets are unordered.

If you read the material in section 2.4 again, you will see that it says an
axis has direction, and that the proximity position of a node in a node-set
depends on the direction of the associated axis. But it never says that
node-sets themselves are ordered, or that the nodes are "returned" in any
particular order. You might find the section easier to understand (I
certainly do) if you think of a node-set derived from a forwards axis as
being a list of nodes in document order, and a node-set derived from a
reverse axis as being a list of nodes in reverse document order, but the
spec very deliberately doesn't describe it that way.

Mike Kay


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS