I have a source of XML that contains content that I need to display in a web page as HTML using XSL. One of the XML nodes contains a double "HTML encoded" value. This is the one I need to output HTML for.
So the original HTML input was <p><strong>hello world</strong></p>
but it is then stored as twice HTML encoded text.
- original version:
<p><strong>hello world</strong></p>
- first HTML encoding:
<p><strong>hello world</strong></p>
- second HTML encoding:
&lt;p&gt;&lt;strong&gt;hello world&lt;/strong&gt;&lt;/p&gt;
I receive only this second HTML encoding from my XML source
<CONTENT>
<RECORD>
<OVERVIEW>&lt;p&gt;&lt;strong&gt;hello world&lt;/strong&gt;&lt;/p&gt;</OVERVIEW>
</RECORD>
</CONTENT>
Outputting to html in the XSL using xsl:output gets things started, and disable-output-escaping in my xsl:value-of tag gets me past one layer of HTML encoding.
But the following XSL:
<xsl:for-each select = "//CONTENT/RECORD">
<xsl:value-of disable-output-escaping="yes" select = "OVERVIEW" />
</xsl:for-each>
Returns only:
<p><strong>hello world</strong></p>
It doesn't get me all the way back to the original input <p><strong>hello world</strong></p>
So I've been looking for a way to "double" or "disable-output-escaping="yes" twice.
Any ideas how I can do this just in XSL?