Embeding 'funny' char in CDATA

admin

Administrator
Staff member
I have xml documents which need to have html markup as data. And the '<'and '>' charactersneed to be preserved.For example:<?xml version="1.0"?><content><![CDATA[<b>This is unparsed data!</b>]]></content>The < and > chars get escaped to < and > (as the should). How can Iget around this?If I apply the following style sheet to the xml:<?xml version="1.0"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:template match="/"><xsl:value-of select="content"></xsl:value-of></xsl:template></xsl:stylesheet>the resulting output is:<?xml version="1.0" encoding="UTF-8"?><b&gThis is unparsed data!</b>What i want is:<?xml version="1.0" encoding="UTF-8"?><b>This is unparsed data!</b>I have formated html snippits that are stored in a database. These snippitsneed to be included in thexml and be preserved in their native form so that when the style sheet isapplied (if that node hasa template) the html will appear as it should in the final document.Thanks,Jonathan
 
Back
Top