Re: [xsl] XPath2.0: Attribute ordering along an ancestor axis

Subject: Re: [xsl] XPath2.0: Attribute ordering along an ancestor axis
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 24 Nov 2006 13:17:26 GMT
> I'm fully aware that attributes along the attribute:: axis are
> unordered, but is there any partial ordering when they're being
> collected off elements discovered along the ancestor:: axis?  

document order is a _total_ order for all nodes in all documents. Once
the documents are in the system then any two nodes have a defined
ordering relationship.

What is true is that the order of attributes on a single element is
system dependent, it can't be predicted from the source markup, and
similarly the order of nodes in different documents is system

attributes always come after thir parent element, and after that
elements namespace nodes, but before any of its children.

So the end result is that an attribute on an earlier element will be
earlier than an attribute on a later element in document order.

> ancestor-or-self::*/@foo

in xslt1 any xpath expression generates a node set and sets are
unordered (whether they have attributes or not) but most xslt
instructions process the elements of teh set in document order.

in xslt2 the semantics are different, but the end result is the same,
path expressions return a sequence (ie ordered list) of nodes
but they are all defined to return the nodes in document order.


Current Thread