I have an XML document containing some escaped HTML string that I want to inject as is in the output document. I have the following doc.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="doc.xsl"?>
<doc>
<str><p>foo</p></str>
</doc>
and doc.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:value-of select="doc/str" disable-output-escaping="yes" />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
According to what I have read elsewhere (e.g. here) this should work, but it doesn't, at least when I open the file with Firefox 41: the output reads <p>foo</p>
, with no HTML interpretation of the markup.