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

RE: Nasty XPath expressions


RE:  Nasty XPath expressions
> I think confusion has come in due to an inconsistency between
> the notion of
> a node-set being unordered, and the fact that XSLT can
> process node-sets as if they are ordered.
>
> This seems odd that XSLT can treat node-sets as if they are
> ordered, even though they are not.

Yes, people get very confused by this: I've even seen some trained
mathematicians get confused by it.

The key point is that the ordering is a property of the nodes, not of the
collection. If you have three nodes N1, N2, and N3, you can only define one
node-set containing these nodes, just as you can only define one set
containing the integers (1, 2, 3). But it's perfectly reasonable to define a
function that operates on sets-of-integers whose effect is to list the
integers in numeric order, and it's equally reasonable to define a function
that operates on sets-of-nodes whose effect is to apply templates to them in
document order.

The existence of an ordering (or of several orderings!) over a domain
doesn't stop you defining sets of objects from that domain.

Of course, it's all going to change in XPath 2.0, so this debate will soon
be history.

Mike Kay


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.