Try not to use <xsl:for-each>
. Code becomes more clearly arranged when you rely on <xsl:template>
and <xsl:apply-templates>
.
Also try to use CSS classes and remove the inline style from the output HTML.
If you output classic HTML (not XHTML) then tell the XSLT processor so by using <xsl:output>
and also output a doctype.
Your output problem will be solved by using disable-output-escaping="yes"
. Note that not every XSL processor supports that attribute. The ability to disable output escaping is optional as per the XSLT spec.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" indent="yes" doctype-system='http://www.w3.org/TR/html4/strict.dtd' doctype-public='-//W3C//DTD HTML 4.01//EN' /><xsl:template match="/rss"><html><head><title></title></head><body><xsl:apply-templates select="channel" /></body></html></xsl:template><xsl:template match="channel"><table cellpadding="2" cellspacing="0" border="0" width="75%"><xsl:apply-templates select="item" /></table></xsl:template><xsl:template match="item"><!-- ... --><tr><td colspan="2" style="text-align:left;padding-top:10px;"><xsl:value-of select="description" disable-output-escaping="yes" /></td></tr><!-- ... --></xsl:template></xsl:stylesheet>