[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Identity Transform

Subject: Re: Identity Transform
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 7 Nov 2005 11:41:30 +0000
xslt identity transform tennison
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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.