title: Split and concatenate a string in XSLT
body: <p>Hi I have the below line in by XML and also I need a hyperlink for the number. I want this output to be shown in HTML format.</p>
  
  <pre><code>&lt;main&gt;
  &lt;alph&gt;a b 2,3&lt;/alph&gt;
  &lt;/main&gt;
  </code></pre>
  
  <p>I want an XSLT that gives output as:</p>
  
  <pre><code>a b 2, a b 3
  </code></pre>
  
  <p>I have tried the below XSLT:</p>
  
  <pre><code>&lt;xsl:template match="alph"&gt;
    &lt;xsl:variable name="link" select="normalize-space(translate(
      normalize-space(current()),abcdefghijklmnopqrstuvwxyz,''))"/&gt;
    &lt;xsl:value-of select="substring-before(normalize-space(.),$link)"/&gt;
    &lt;xsl:variable name="tex"&gt;
      &lt;xsl:value-of select="text()"/&gt;
    &lt;/xsl:variable&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test="contains($link,',')"&gt;
        &lt;xsl:variable name="new"&gt;
          &lt;xsl:value-of select="tokenize($link,',')"/&gt;
        &lt;/xsl:variable&gt;
        &lt;xsl:value-of select="concat($new,$tex)"/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:when test="contains($link,'-')"&gt;
        &lt;xsl:value-of select="tokenize($link,'-')"/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:value-of select="$link"/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
  </code></pre>
  
  <p>But it is giving me output as:</p>
  
  <pre><code>a b 2 3a b 2,3
  </code></pre>
  
  <p>Thanks</p>