I am facing a wired problem, when ever I am trying to remove CDATA from my request. It works fine in my local IDE, but not in DataPower. The requirement is it should remove the CDATA tag if it finds one in the XML or else it should not do anything. Input XML:
<response status="200">
<CustomELearningVO>
<ClassListVO>
<![CDATA[
<CLASS_TAB_OBJ>
<CLASS_TAB>
<CLASS_OBJ>
<ClassId>123456</ClassId>
<ClassName>Sample Class1</ClassName>
<Status>Not Attempted</Status>
<Link>link</Link>
<PlayEnable>Y</PlayEnable>
</CLASS_OBJ>
<CLASS_OBJ>
<ClassId>56789</ClassId>
<ClassName>Sample Class2</ClassName>
<Status>Failed</Status>
<Link>link2</Link><PlayEnable>Y</PlayEnable>
</CLASS_OBJ>
<CLASS_OBJ>
<ClassId>56788</ClassId>
<ClassName>Sample Class3</ClassName>
<Status>Failed</Status>
<PlayEnable>N</PlayEnable>
<PlayMessage>"Course cannot be played as Certfication subscribed to Course has Expired"</PlayMessage>
</CLASS_OBJ>
</CLASS_TAB>
</CLASS_TAB_OBJ>
]]>
</ClassListVO>
<eBSErrorCode>0</eBSErrorCode>
<eBSErrorMessage>SUCCESS</eBSErrorMessage>
</CustomELearningVO>
</response>
XSL I am using to remove CDATA:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="." disable-output-escaping="yes" />
</xsl:template>
</xsl:stylesheet>
The issue was resolved using a stylesheet which works on serialized data of XML.