|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Identity Transform
Hi Christian,
> Has this something to do with document traversal order, i.e. while
> building the list of selected items using "node()|@*", the attribute
> nodes (satisfying the expression) are found first and are therefore
> added first to the list of items to be copied, in consequence
> satisfying the "attribute-before-children" requirement?
Close. In XSLT 1.0, whenever you process a node-set (using
<xsl:apply-templates> or <xsl:for-each>, for example), those nodes are
processed in *document order*. The attributes of an element always
come before the children of the element, so whether you use
"@*|node()" or "node()|@*", you always copy the attributes first.
In XSLT 2.0 things are slightly different, in that each XPath 2.0
expression generates a sequence of nodes rather than a (by definition,
unordered) set of nodes. However, when you use the union operator ("|"
or "union"), the nodes in the resulting sequence are always sorted
into document order, so again "@*|node()" and "node()|@*" return the
same sequence of nodes.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
|
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
|

Cart








