title: Compare string in XSLT with IF condition
body: <p>I'm using a variable in XSLT that comes from JAVA code which i'm assigning to a
  variable and comparing it with a string</p>
  
  <p>Below is my sample code</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:xmlutil="xalan://lang.comt.des" exclude-result-prefixes="xmlutil xalan"&gt;        
      &lt;xsl:template match="/"&gt;       
          &lt;html&gt;
              &lt;head&gt;
              &lt;title&gt;sample&lt;/title&gt;&lt;/head&gt;
              &lt;body&gt;                
                  &lt;xsl:variable name="language"&gt;--LANG--&lt;/xsl:variable&gt;               
                  &lt;xsl:value-of select="$language" /&gt;               
                  &lt;xsl:if test="$language = 'en'"&gt;testing&lt;/xsl:if&gt;                
              &lt;/body&gt;
          &lt;/html&gt;
      &lt;/xsl:template&gt;    
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>The value for <code>--LANG--</code> is coming from Java code and returns en.
  When I print the variable using <code>&lt;xsl:value-of select="$language" /&gt;</code> it is giving the correct result as <code>en</code>.<br>
  However, when I use an <code>IF</code> condition to compare the string value it is not satisfying the condition. Can someone help me find what is wrong here?</p>