xsl-list
[Top] [All Lists]

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

2006-11-24 06:17:47

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
dependent. 

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.

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>