[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XPath node-set ordering

  • To: XML-DEV <xml-dev@l...>
  • Subject: XPath node-set ordering
  • From: Peter Finch <peter@h...>
  • Date: Sun, 20 Jan 2002 15:16:35 +1100

xpath 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.