QUESTION: The attributes for height and width appear in the rendered HTML, however the specified Background-color is not showing up. Any ideas why this might be?
EXAMPLE OF XML:
<?xml version="1.0" encoding="UTF-8"?>
<channel>
<title>Colour Guide</title>
<link></link>
<description>hi</description>
<lastBuildDate>Mon, 13 Dec 2010 12:14:59 GMT</lastBuildDate>
<image>
<title>hello</title>
<url>pages/pagethirtytwo/subsection</url>
<link></link>
</image>
<item>
<title>Player 12</title>
<link></link>
<ref id="80-2563">
<shortdesc>Midfield, Defense</shortdesc>
<longdesc>Midfield Defensive player.</longdesc>
<L>87.04</L>
<A>-4.3</A>
<B>84.39</B>
<R>239</R>
<G>216</G>
<B2>33</B2>
</ref>
</item>
</channel>
XSLT code that is giving me trouble:
<xsl:for-each select="ref"><td><xsl:attribute name="style"><![CDATA[height:12px;width:12px;[B]background-color:(]]><xsl:value-of select = "concat(R,',',G,',',B2)" /><![CDATA[)]]>[/B]</xsl:attribute></td></xsl:for-each>
Full code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template match="/">
<xsl:apply-templates select="channel" />
<xsl:call-template name="items"/>
</xsl:template>
<xsl:template match="channel">
<div class="ChannelTitle">
<h1><xsl:element name="a"><xsl:attribute name="title"><xsl:value-of disable-output-escaping="yes" select="title" /></xsl:attribute><xsl:attribute name="href"><xsl:value-of disable-output-escaping="yes" select="link" /></xsl:attribute></xsl:element></h1>
<h3><xsl:value-of disable-output-escaping="yes" select="description" /></h3>
</div>
</xsl:template>
<xsl:template name="items">
<xsl:for-each select="channel/item">
<div class="Article">
<h3 id="ArticleTitle"><xsl:element name="a"><xsl:attribute name="title"><xsl:value-of disable-output-escaping="yes" select="title" /></xsl:attribute><xsl:attribute name="href"><xsl:value-of disable-output-escaping="yes" select="link" /></xsl:attribute></xsl:element></h3>
<p id="ArticleDescription">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<xsl:for-each select="ref"><td><xsl:attribute name="style"><![CDATA[height:12px;width:12px;background-color:(]]><xsl:value-of select = "concat(R,',',G,',',B2)" /><![CDATA[)]]></xsl:attribute> <xsl:value-of select = "concat(R,',',G,',',B2)" /> </td></xsl:for-each>
</tr>
</table>
</p>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Thanks,
Seth