View Single Post
  #2 (permalink)  
Old March 15th, 2011, 09:16 AM
Martin Honnen Martin Honnen is offline
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

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

<xsl:template match="work/prelim/tools | work/prelim/parts">
  <xsl:copy-of select="../following-sibling::main/planning"/>
  <xsl:call-template name="identity"/>
</xsl:template>

<xsl:template match="work[prelim/tools | prelim/parts]/main/planning"/>
might suffice but would copy "planning" twice if both "tools" and "parts" exist.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote