Lists Home |
Date Index |
Sorry if this is a dumb [newbie] question but I was
just reading the XPath [http://www.w3c.org/TR/xpath]
spec for the first time and I have a question about
The introduction says that a "node-set" is "an unordered
collection of nodes without duplicates", however, section 5
"Data Model" seems to indicate that they do have an order
"There is an ordering, document order, defined on all
the nodes in the document..."
My initial reaction was, "Ok, I know nodes have an
implicit order in the document so no big deal"... but
further investigation seems to show that there are no
Node Set functions to compare node order, or even order
a node or node set.
What I'm asking is, if I were to perform a XPath
expression like "/descendant::chapter" and the chapters
were not in document order does anyone think that
this is a problem?
Is there some way to make sure that the node sets
returned are in order?
Also, when I think about it, if node-sets are
unordered then performing ordered operations on
them like "[position()=5]" does not make sense?
Or... does a node only have an order during the
node test part of the expression?