| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|Basic help on copying elements using XSL|
| 12:22 pm on Jul 8, 2011 (gmt 0)|
In my XSL, I'm trying to copy a complex element, **then** apply a template to it. Currently the templates are only being applied to the children of the copied element.
Thanks for your help... I appreciate this is basic stuff.
This is what I'm trying, which is clearly wrong.
| 1:35 pm on Jul 8, 2011 (gmt 0)|
Welcome to WebmasterWorld!
<xsl:copy> is a "shallow" copy, and (according to the manual) only copies the current node. <xsl:copy-of> is a "deep" copy, which does a recursive copy of all the node's children.
Have you tried matching the parent of "activity" instead?
| 2:08 pm on Jul 8, 2011 (gmt 0)|
I can use <xsl:copy-of select="activity" /> in the matched parent, and this copies the nodes from the XML. How do I then apply the <xsl:template match="activity"> to this copied output?
I seem to be able to use <xsl:apply-templates /> only when using <xsl:copy>, not copy-of.
I'm so confused!
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved