[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: problems with xsl:copy instruction

Subject: RE: problems with xsl:copy instruction
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Thu, 26 May 2005 15:55:28 +0100
copy instruction
> 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?

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.