Re: Reverse axis, reverse document order, xsl:for-each
Why is this so? Why does xsl:for-each obliterate the direction offered by the axis?
That's an important distinction I wasn't making.
(1) The axis imposes an order while the expression collects nodes, which may be either document order or reverse document order. (2) The result is a node set, unordered by definition. (3) The xsl:for-each re-imposes an order, which by default happens to be document order.
Failing to make this distinction may result in confusion on behalf of the user, who may never have _seen_ the absence of order since a default order - document order - governs the functioning of xsl:for-each.
If you use xslt 2 then the underlying datatype changes from sets to ordered sequences and then variables can hold sequences in specific order (and xsl:for-each will also iterate over the sequence in order)
Thanks a lot, David!
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format