xsl-list
[Top] [All Lists]

RE: problems with xsl:copy instruction

2005-05-26 07:55:28

My understanding of how the <xsl:copy> and <xsl:copy-of> commands is 
weak and so am having trouble figuring out the exact problem.

xsl:copy will copy the current element only, without it's attributes or
children, to the result tree.

xsl:copy-of copies everything, attributes and children.

In your root matching template you create a literal result element
<TopConcept>, and then apply-templates on the <TopConcept> element under
the root.  The first instruction in the matching template that gets
applied is xsl:copy, so you will get another <TopConcept> in your
output.

The rest of the stylesheet also needs looking at, eg:

 <xsl:for-each select="/*/*/O/Class[text()=$notPresent]">
   <xsl:apply-templates select="/*/*/O/Class[text()=$notPresent]"/>
 </xsl:for-each>

and:

 <xsl:template match="@* | node()">
   <xsl:copy>
     <xsl:copy-of select="@*"/>
     <xsl:apply-templates select="@*"/>
   </xsl:copy>
 </xsl:template>

...are both a bit off but I'm guessing you are trying things out? 


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