Reputation: 325
How do i just copy node without any of the child nodes during transformation
<xsl:apply-templates mode="copy" select="test" />
here in the above example i just want to copy test node(none of the child nodes of test should be selected in transformation??
Upvotes: 0
Views: 252
Reputation: 116982
You could add a template like this:
<xsl:template match="test" mode="copy">
<xsl:copy/>
</xsl:template>
To copy the attributes, use:
<xsl:template match="test" mode="copy">
<xsl:copy>
<xsl:copy-of select="@*"/>
</xsl:copy>
</xsl:template>
Upvotes: 1