Is it possible to apply conditional formatting to a date column? I'm trying to set the columns background to red if the date has passed using the following

<xsl:if test="normalize-space($thisNode/@Completion_x0020_Date) >= 'Today'" ddwrt:cf_explicit="1">background-color: #71B84F;</xsl:if>

Thanks, Jason

1 Answer 1


I got this from a post about filtering and formatting with Date Values. At this point, the main problem is around the formatting of the comparison. This is xml so when the parser sees ">', it views as the closing bracket and not as a comparison. You need to encode this as


for the comparison to be recognized.

<xsl:if test="number(translate(substringbefore
(@Modified_Recently$Modified_Recently_ISO,'T'), '-',''))
&gt;= number(translate(substring-before($Today,'T'),'-',''))">
background-color: #00FF00;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.