|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: question about identity transform
To add a new angle to this interesting topic:
If you would refers it, and make it, say: ` node ( ) | @* ' the nodes would first be copied, resulting in the attributes ending up illegally: you may not create an attribute node after you create an element node in the result tree. We already discussed why the above statement is not true. In XPath 2.0, however one could use the "," operator and we could have the following identity rule:
Now, if one reverses the order of the arguments of the "," operator like this: <xsl:apply-templates select="node(), @*"/> and the source xml document happens to have attributes, then there will be indeed a runtime error to the effect that an attribute node cannot be created after the children of its containing element. The moral is always to know when we are using sets and when sequences and to be very cautious when using sequences as they are a very different beasts from sets, although might seem quite similar.
On 10/31/06, Abel Braaksma <abel.online@xxxxxxxxx> wrote: Bill French wrote: > > I've used the identity transform many times to do useful things and > have often wondered about the match pattern. Why is the match pattern > > "node() | @*" > > rather than simply "node()"? Aren't attributes returned by node()?
|
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
|






