In Firefox I can store CDATA as javascript var.innerHTML and then render it exactly as intended. IE renders it as text. The follow xml and xsl should help to understand what I'm having a problem with:
XML
XLS
Firefox renders the CDATA as a simple table with a border, IE displays it exactly as it is entered in the XML document.
I've also tried removing the <![CDATA[...]]> tags and replaced the < with < and > with > for the table tags and Firefox still works but IE still displays <table......
Is there something I can do?
XML
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<cw>
<content><![CDATA[<table border="1"><tr><td>Home</td></tr></table>]]></content>
</cw>
XLS
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>[/URL]
<xsl:template match="/">
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Untitled Document</title>
</head>
<body>
<div id="c"></div>
</body>
<script type="text/javascript">
var d, pagecontent;
<xsl:for-each select="cw">
d = document.createElement("div");
d.innerHTML = '<xsl:value-of select="content"/>'
document.getElementById("c").appendChild(d);
</xsl:for-each>
</script>
</html>
</xsl:template>
</xsl:stylesheet>
Firefox renders the CDATA as a simple table with a border, IE displays it exactly as it is entered in the XML document.
I've also tried removing the <![CDATA[...]]> tags and replaced the < with < and > with > for the table tags and Firefox still works but IE still displays <table......
Is there something I can do?