title: how to replace string in xslt
body: <p>I am new to xslt and trying to convert below xml using a xslt. I am trying to modify 2 fields (one is number and another of string type)using below xslt.</p>
  
  <pre><code>&lt;items&gt;
   &lt;item&gt;
    &lt;item_id&gt;27989498&lt;/item_id&gt;
    &lt;service&gt;Test Fee1&lt;/service&gt;
    &lt;rate&gt;350&lt;/rate&gt;
    &lt;quantity&gt;1&lt;/quantity&gt;
    &lt;tax_rate&gt;0&lt;/tax_rate&gt;
    &lt;item_date&gt;2010-11-17-05:00&lt;/item_date&gt;
   &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>XSLT :</p>
  
  <pre><code>&lt;xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
  
  &lt;xsl:output method="xml" indent="yes"/&gt;
  &lt;xsl:template match="node()|@*"&gt;
      &lt;xsl:copy&gt;
          &lt;xsl:apply-templates select="node()|@*"/&gt;
      &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="rate[ . &amp;gt; 0 ]"&gt;
      &lt;xsl:copy&gt;100&lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="service[ . &amp;eq; 'Test Fee1' ]"&gt;
      &lt;xsl:copy&gt;T1&lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p></p>
  
  <p>Output :</p>
  
  <pre><code>&lt;items&gt;
   &lt;item&gt;
   &lt;item_id&gt;27989498&lt;/item_id&gt;
   &lt;service&gt;Test Fee1&lt;/service&gt;
   &lt;rate&gt;100&lt;/rate&gt;
   &lt;quantity&gt;1&lt;/quantity&gt;
   &lt;tax_rate&gt;0&lt;/tax_rate&gt;
   &lt;item_date&gt;2010-11-17-05:00&lt;/item_date&gt;
   &lt;/item&gt;
   &lt;/items&gt;
  </code></pre>
  
  <p>Above XSLT is replacing rate field correctly but for string field "service" it's not replacing the intended value. How can I compare and replace string in xslt as "eq" method is not working. </p>
  
  <p>Is it possible to select the replace value from a list of values instead of hard coding? Example : Test Fee1 = T1 , Test Fee2 = T2 , Test Fee3 =T3 etc. </p>
  
  <p><strong>Update</strong> :</p>
  
  <p>In the request xml service tag will not have a value from series instead it will be a random value, which needs to be replaced with some keys like state names of a country should be replaced by state code without taking case sensitivity into consideration.</p>
  
  <p>Example : New York = NY or new yoRk = NY, Arizona = AR etc.</p>