[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XPath node-set ordering
Hi all, 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 node-set ordering. 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? Cheers, Peter Finch
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|