Re: [xsl] Identity Transform

Subject: Re: [xsl] Identity Transform
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 7 Nov 2005 11:35:51 GMT
> Doesn't Form 2 first append child nodes
> and then attributes, which should either result in an error or silently
> discard the attributes?

No. 

The | operator forms the set union of two node sets, and sets never
imply any ordering (or have duplicates) so a|b always means the same
thing as b|a.

XPath2 moves away from set semantics to having ordered lists as the
primitive datatype. In Xpath2 the | operator is defined to append lists,
and then re-rorder to document order, and remove duplicates. this is
equivalent (just less elegant).

This is nothing to do with attributes, consider 

<x>
  <a/>
  <b/>
</x>

You can do

<xsl:copy-of select="a|b"/>
 or select="b|a" and you get the same thing in
either case.

In XPath2 if you want to get b before a you can go
<xsl:copy-of select="(b,a)"/>
In XSLT1 to get that you'd have to do
<xsl:copy-of select="b"/>
<xsl:copy-of select="a"/>


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread