title: How to check for string equality case insensitive in xsl
body: <p>I have a requirement where I need to check <code>DB/@dbtype</code> == 'oracle' (case insensitive). How can I do that?
  Here is my code</p>
  
  <pre><code>&lt;xsl:choose&gt;
        &lt;xsl:when test="DB/@dbtype"&gt;
          &lt;p&gt;
              &lt;dd&gt;
              &lt;table border="1"&gt;
                  &lt;tbody&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Value&lt;/th&gt;
                  &lt;/tr&gt;
  
                  &lt;xsl:if test="DB/@dbtype='ORACLE'"&gt;
                      &lt;xsl:for-each select="DB/oracle_props"&gt;
                      &lt;tr&gt;
                          &lt;td valign="top" &gt;&lt;xsl:value-of select="@name"/&gt;&lt;/td&gt;
                          &lt;td valign="top" &gt;&lt;xsl:value-of select="@value"/&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;/xsl:for-each&gt;
                  &lt;/xsl:if&gt;
  
                  &lt;/tbody&gt;
              &lt;/table&gt;
              &lt;/dd&gt;
          &lt;/p&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
              &lt;xsl:value-of select="DB"/&gt;                         
        &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
  </code></pre>
  
  <p>I thought of converting it into all lowercase/uppercase and then check accordingly, so I used below</p>
  
  <pre><code>&lt;xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" /&gt;
  &lt;xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" /&gt;
  
  &lt;xsl:value-of select="translate(product/@name, $smallcase, $uppercase)"/&gt;
  &lt;!--It display in lower case, but how to use this in checking for equality?--&gt;
  </code></pre>
  
  <p>Please help me out, how to compare String (case insensitive way)</p>