This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: XML to XML transformation


> <!-- 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]