XML node contains HTML - how to use in XSL?

Cringer

ProgressTalk.com Moderator
Staff member
Any ideas? Got an xml document with an element in it
Code:
<LivePrices>&lt;th&gt;Aug11+

ByrsCall

&lt;/th&gt;&lt;th&gt;01Aug11
30Sep11
ByrsCall
PAS
&lt;/th&gt;&lt;th&gt;-Sep11

ByrsCall

&lt;/th&gt;&lt;th&gt;Oct11

ByrsCall

&lt;/th&gt;&lt;th&gt;Nov11

ByrsCall

&lt;/th&gt;&lt;th&gt;Dec11

ByrsCall

&lt;/th&gt;&lt;th&gt;Jul11

ByrsCall

&lt;/th&gt;&lt;th&gt;01Aug11
30Sep11
As Avail

&lt;/th&gt;</LivePrices>

Not sure why the < and > have been replaced, but that's another story! What I'm trying to do is to get an XSL to use this element as actual HTML, not as text... I'm using <xsl:value-of select="LivePrices" disable-output-escaping="yes" /> as suggested somewhere, but that only seems to work in IE, not Firefox. Any ideas?!
 

Cringer

ProgressTalk.com Moderator
Staff member
Ok so disable-output-escaping="yes" is not supported in Firefox. Ridiculous.
 

rstanciu

Member
Code:
<xsl:template match="/">

<html>
<head>
	<script type="text/javascript" src="decodingFunction.js"></script>
</head>

<body onload="goDecoding();">
	<div name="decode">
		<xsl:value-of select="." disable-output-escaping="yes" />
	</div>
</body>
</html>

</xsl:template> the fonction goDecoding on  [I].js:[/I]

 
function goDecoding() {
	if (window.InstallTrigger) {

		var decode = document.getElementsByName("decode"), inner;

		for (var i=0, c=decode.length; i<c; i++) {
			inner = decode[i].textContent;

			if (inner || (inner.indexOf('&') != -1 && inner.indexOf('<') != -1)) {
				decode[i].innerHTML = inner; // \o/
			}
		}
	}
}
 

Cringer

ProgressTalk.com Moderator
Staff member
Thanks for that - Thankfully I have the ability to change the xml so I'm going down the route of a prodataset linking 2 tables together to get the effect I need.
 
Top