xml file with cdata section is represented internally as if there is none. Hence a simple identity transformation will bring the one with cdata to one without.
For instance, with a simple identity transformation from w3c spec:
[tt]
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
<xslutput method="xml" version="1.0" indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
[/tt]
You would bring an xml file, such as this:
[tt]
<?xml version="1.0" encoding="utf-8"?>
<root>
<cdata_gt_operator><![CDATA[ > ]]></cdata_gt_operator>
<entity_ref_gt_operator> ></entity_ref_gt_operator>
<char_ref_gt_operator> > </char_ref_gt_operator>
</root>
[/tt]
to an output xml file like this.
[tt]
<?xml version="1.0" encoding="utf-8"?>
<root>
<cdata_gt_operator> > </cdata_gt_operator>
<entity_ref_gt_operator> ></entity_ref_gt_operator>
<char_ref_gt_operator> > </char_ref_gt_operator>
</root>
[/tt]
All in all, an identity tranformation would mostly do. The rest is to make the output looking good.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.