title: XSL If Contains
body: <p>I’m working on an XSL file that will (among many other things) display a button if the corresponding XML file contains a certain string.  I seem to be having an issue where I get the button to display all the time (even when the XML file doesn’t contain the value I want) or never (even when the XML file does contain the value.  The portion of the XML file I'm concerned with is:</p>
  
  <pre><code>&lt;sp_stList&gt;
  &lt;sp_st&gt;
  &lt;st_num&gt;1234&lt;/st_num&gt;
  &lt;feanme&gt;FAKE&lt;/feanme&gt;
  &lt;featyp&gt;ST&lt;/featyp&gt;
  &lt;dirsuf&gt;&lt;/dirsuf&gt;
  &lt;dirpre&gt;&lt;/dirpre&gt;
  &lt;lv_apt&gt;&lt;/lv_apt&gt;
  &lt;mun&gt;VAN&lt;/mun&gt;
  &lt;msgs&gt;
  &lt;msg filename="File.pdf"&gt;d:\folder1\fild.pdf&lt;/msg&gt;
  &lt;/msgs&gt;
  &lt;spst_poly&gt;0&lt;/spst_poly&gt;
  &lt;mes_switch&gt;X&lt;/mes_switch&gt;
  &lt;cdts&gt;20120103161202PS&lt;/cdts&gt;
  &lt;/sp_st&gt;
  &lt;/sp_stList&gt;
  </code></pre>
  
  <p>What should happen is that when <code>&lt;mes_switch&gt;</code> contains an X then the button should be displayed.  If it is blank or has another character in it then it should not display the button.  </p>
  
  <p>The code I have tried is:</p>
  
  <pre><code>&lt;a name="Info"&gt;&lt;/a&gt;
      &lt;xsl:if "contains(sp_stList/sp_st/mes_switch, 'X'))"&gt;
          &lt;a href="#SpSt" style="color:orange" t:id="Spec_Sit_hdr"&gt;
              &lt;img border="0" src="./file.jpg"&gt;&lt;/img&gt;
          &lt;/a&gt;
      &lt;/xsl:if&gt;
  </code></pre>
  
  <p>For some reason this doesn't see to work.  Any help you could provide would be appreciated!</p>
  
  <p>Thanks!</p>