I have HTML code in entity form, such as
<zh_tw shortText="">&nbsp;</zh_tw>
embedded in an XML file. I would for that text to be rendered as HTML when I view the XML text in a browser. I have a simple XSLT created for the XML file to be transformed into a table format, but I don't want the HTML code to display as code.
Here is a sample of the code in XML:
<?xml-stylesheet type='text/xsl' href='Simple.xslt'?>
<Projects>
<Project>
<Text Type="surveyitem" SubType="intro" TranslationGroupID="46675">
<zh_tw shortText="">&nbsp;</zh_tw>
</Text>
<Scale Type="scaletext" ScaleTextID="23501">
<en_us>to translate</en_us>
<zh_tw>to translate</zh_tw>
</Scale>
</Text>
</Project>
</Projects>
Here is the XSLT I am using:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" version="4.0"/>
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr bgcolor="#9acd32">
<th>Translation</th>
</tr>
<xsl:for-each select="Projects/Project/Text">
<tr>
<td><xsl:value-of select="zh_tw"/></td>
</tr>
</xsl:for-each>
<xsl:for-each select="Projects/Project/Text/Scale">
<tr>
<td><xsl:value-of select="zh_tw"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>