I have an XML File with the following structure:
<catalog>
<category>
<display-name> XYZ </display-name>
</category>
<product>
<display-name> ABC </display-name>
</product>
</catalog>
How can I add CDATA section on all subnodes catalog/product/display-name ?
This is the kind of code I wrote , how can I chosse the specified subnodes on cdata-section-elements :
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="no" indent="yes" cdata-section-elements="?"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="catalog">
<catalog catalog-id="master-catalog">
<xsl:apply-templates select="@*|node()"/>
</catalog>
</xsl:template>
</xsl:stylesheet>
Thanks for help !