title: XSLT string replace
body: <p>I don't really know XSL but I need to fix this code, I have reduced it to make it simpler.<br>
  I am getting this error </p>
  
  <blockquote>
    <p>Invalid XSLT/XPath function</p>
  </blockquote>
  
  <p>on this line</p>
  
  <pre><code>&lt;xsl:variable name="text" select="replace($text,'a','b')"/&gt;
  </code></pre>
  
  <p>This is the XSL</p>
  
  <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:inm="http://www.inmagic.com/webpublisher/query" version="1.0"&gt;
      &lt;xsl:output method="text" encoding="UTF-8" /&gt;
  
      &lt;xsl:preserve-space elements="*" /&gt;
      &lt;xsl:template match="text()" /&gt;
  
      &lt;xsl:template match="mos"&gt;
          &lt;xsl:apply-templates /&gt;
  
          &lt;xsl:for-each select="mosObj"&gt;
            'Notes or subject' 
             &lt;xsl:call-template
                  name="rem-html"&gt;
                  &lt;xsl:with-param name="text" select="SBS_ABSTRACT" /&gt;
              &lt;/xsl:call-template&gt;
          &lt;/xsl:for-each&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template name="rem-html"&gt;
          &lt;xsl:param name="text" /&gt;
          &lt;xsl:variable name="text" select="replace($text, 'a', 'b')" /&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Can anyone tell me what's wrong with it?</p>