I'm trying to add conditional formatting to a custom list based on whether or not a field contains a number in a certain range (i.e., if the field contains a number less than 15, i'd like the background to be red. It the field contains a number between 15 and 30, I'd like the background to be yellow). After much searching, I think I have the right code for the less than 15 scenario, but no formatting is being applied to the list when I save it. Does anyone have any idea what I am doing wrong? Here's the code I am using:
<Xsl>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude- result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas- microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal" xmlns:o="urn:schemas-microsoft- com:office:office">
<xsl:include href="/_layouts/xsl/main.xsl"/>
<xsl:include href="/_layouts/xsl/internal.xsl"/>
<xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() >= $FirstRow and position() <= $LastRow)]"/>
<xsl:param name="dvt_apos">'</xsl:param>
<xsl:template name="FieldRef_body.Days_x0020_On_x0020_Hand" ddwrt:dvt_mode="body" match="FieldRef[@Name='Days_x0020_On_x0020_Hand']" mode="body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:param name="thisNode" select="."/>
<span>
\
<xsl:attribute name="style">
<xsl:if test="number($thisNode/@Days_x0020_On_x0020_Hand) < 15" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:cf_explicit="1">color: #FFFFFF; vertical-align: middle; text-align: center; background-color: #CC0000;</xsl:if>
</xsl:attribute>
</span></xsl:template>
<xsl:template name="FieldRef_Attachments_header.Attachments" ddwrt:dvt_mode="header" match="FieldRef[(@Type='Attachments') and @Name='Attachments']" mode="header" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
<th class="ms-vh-icon" nowrap="nowrap" scope="col" onmouseover="OnChildColumn(this)">
<xsl:call-template name="dvt_headerfield">
<xsl:with-param name="fieldname">Attachments</xsl:with-param>
<xsl:with-param name="fieldtitle"><img border='0' alt='<xsl:value-of select="'Attachments'"/>' src='/_layouts/images/attachhd.gif'</xsl:with-param>
<xsl:with-param name="displayname">Attachments</xsl:with-param>
<xsl:with-param name="fieldtype">Attachments</xsl:with-param>
</xsl:call-template>
</th>