title: XSLT Date Comparisons
body: <pre><code>&lt;xsl:variable name="date1" select="2011-10-05"/&gt;
  &lt;xsl:variable name="date2" select="2011-10-05"/&gt;
  &lt;xsl:variable name="date3" select="2011-10-06"/&gt;
  
  &lt;xsl:if test="$date2 = $date1 or $date2 &amp;lt; $date1"&gt;
    ..do something
  &lt;/xsl:if&gt;
  
  &lt;xsl:if test="$date3 = $date1 or $date3 &amp;gt; $date1"&gt;
   .. do something
  &lt;/xsl:if&gt;
  </code></pre>
  
  <p>Both should evaluate true, but the second if doesn't. For the life of me I can't comprehended why!</p>
  
  <p>In the actual transform the dates themselves are being drawn from an XML document but debugging through VS2010 i can see the values are as above.</p>
  
  <p>Must be something fairly fundamental i'm doing wrong - any help would be brilliant!</p>