RE: XML to XML transformation

Subject: RE: XML to XML transformation
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 23 Nov 2000 12:55:53 -0000
> <!-- First of all, copy the root and apply-templates -->
> <xsl:template match="/">
> 	<copy>
> 		<!-- this copies the attributes(if any) of the root element
-->
> 		<copy-of select="@*"/>
> 		<xsl:apply-templates/>
> 	</copy>
> </xsl:template>
>
Confusion here: "/" matches the root node, which is not an element, it is
the parent of the outermost element, which is sometimes (but not in
XPath/XSLT) called the document element or root element. The root node will
never have attributes so the <xsl:copy-of> here is redundant.

Mike Kay 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread