XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Strange Transformations
Subject: Aswer to Q: Can I un-CDATA my CDATA section?
Date: 2002-04-25 00:17:19
From: Aleksander Dye

There is a simple way of doing this, just include this disable-output-escaping="yes" in the select string. Hope this helps a little, the disable-output-escaping is well godd to know about.


Regards,
Aleksander


My XSL:
<?xml version = '1.0' encoding = 'ISO-8859-1'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="ISO-8859-1" indent="yes" />


<xsl:template match="true_xmlwrapper">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>


My XML:
<?xml version = '1.0' encoding = 'ISO-8859-1'?>
<true_xmlwrapper>
<![CDATA[
<html>
<head><title>Weird Embedded
Markup</title></head>
<body>
<h1>Someone thought he was being clever...!</h1>

[etc.]


</body>
</html>
]]>
</true_xmlwrapper>


My Result:
<html>
<head>
<title>Weird Embedded Markup</title>
</head>


<body>
<h1>Someone thought he was being clever...!</h1>



[etc.]


</body>
</html>

No Previous Message Previous Message   Next Message Next Message

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938