Subject:cannot apply cdata-section-elements to xsl:copy-of select Author:Sushant Prabhu Date:30 Jan 2007 10:57 PM
Hi All,
Currently I have a scenario where in I m using
-----------------------
<xsl:output method="xml" cdata-section-elements="mycountry myartist" indent="yes" />
-----------------------
I have the following code in my xsl
--------------------------
<mycountry> <xsl:copy-of select="country/node()"/> </mycountry>
<myartist> <xsl:value-of select="artist"/> </myartist>
--------------------------
The reason I am using <xsl:copy-of select> is because the data in the country tag has html elements & I need to retain the same. This was not happening with <xsl:value-of select> tags.
But I also have to wrap that piece of data into CDATA tags because that is what the external application to whom we send the data demands.
So the cdata wraps the data correctly with <xsl:value-of> but fails to do the same for <xsl:copy-of>
I need to know how can i workaround the same.