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 ]

> The spec spends (too much?) time
> discussing the ordering of returned sets, which depend upon the axis. 

No this is not the case, the sets are unorderd (but they are all subsets
set of an orderd set of nodes). (This is just like saying sets of
integers are unordered; {1,2,3} = {3,2,1} but you can, when required,
process the elements of the set in numerical order)

The axis used to select the set has no effect on the node set returned.

if an element has three children, then 

<xsl:variable name="a" select="*"/>
<xsl:variable name="b" select="*[1]|*[1]/following-sibling::*"/>
<xsl:variable name="c" select="*[last]/preceding-sibling::*|*[last()]"/>

all select the same node set even though the first two select them using
a forward axis, and the last one select using a reverse axis.

most xsl instructions will iterate over the nodes in a set in document
order, but that isn't really the same as saying the nodes in the set are
in that order.


This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.


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

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