[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] position last and attributes

Subject: Re: [xsl] position last and attributes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 20 Sep 2012 19:36:08 +0100

On 20/09/2012 08:51, Ihe Onwuka wrote:
hey could be applied to @* which is
intrinsically unordered.

It is rather misleading to say that @* is intrinsically unordered.
In XPath 1, like all XPath operations it returns a node set and sets are unordered.

However Xpath2 it returns an ordered sequence of nodes in document order. This order is stable it returns the same order each time you query that node. It affects not just position() and last() but all xpath features such as << and >>.

It is not that @* is unordered it is just that that the order can not be determined by looking at the order of attributes in the markup, but the processor has to build an ordered sequence of attribute nodes in its XDM model so by the time the XSLT engine is evaluating @* it is just as ordered as a sequence of element nodes from *.


google plus: https:/profiles.google.com/d.p.carlisle

Current Thread