Using an xsl,I want to rename only the Books node to "TechBooks" and this new node will have all the attributes and child nodes which the oroginal node has.
So the new xml will be :
<Root>
<TechBooks Name="C++" Author="Unknown">
<Book Price="30"/>
<Book Price="50"/>
<Book Price="45"/>
</TechBooks>
</Root>
Can u pls tell me the best possible way to do this in xsl...?
<!-- This template copies everything that doesn't have a more specific rule -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<!-- This template copies and renames Books to TechBooks -->
<xsl:template match="Books">
<TechBooks>
<xsl:apply-templates/>
</TechBooks>
</xsl:template>
</xsl:stylesheet>