title: XSL: replace white space by hyphen
body: <p>I am trying to translate white space by "-".
  Data come from <code>TEI-XML</code> data:</p>
  
  <pre><code>&lt;m type="base"&gt; 
    &lt;m type="baseForm"&gt;A&lt;c type="infix"&gt;B&lt;/c&gt;CD&lt;/m&gt; 
   &lt;/m&gt;
  </code></pre>
  
  <p>and <code>XSL</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
    &lt;xsl:for-each select="descendant::m[@type='base']/m[@type='baseForm']"&gt;  
      &lt;xsl:choose&gt;
        &lt;xsl:when test="current()/c"&gt;&lt;xsl:value-of select="current()[not != c[@type['infix']]] |node()"/&gt;&lt;/xsl:when&gt;
       &lt;xsl:otherwise&gt;&lt;xsl:value-of select="current()"/&gt;&lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
      &lt;!-- my attempt --&gt;
      &lt;xsl:value-of select="translate(., ' ','-')"/&gt;
     &lt;/xsl:for-each&gt;
   &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Following answer of this post <a href="https://stackoverflow.com/questions/22361114/xsl-replace-space-with-caret">XSL replace space with caret</a>, I have used <code>translate</code>, but it doesn't work.
  The result should be: "A-B-CD" but I have "A B CD."</p>
  
  <p>Thanks for your kind help.</p>