xsl-list
[Top] [All Lists]

Re: Identity Transform

2005-11-07 04:35:51

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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>