Join strings with string-join() function : string join « XSLT stylesheet « XML






Join strings with string-join() function


<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <html>
      <body>
        
        <xsl:value-of
          select="string-join((for $i in 1 to 10 return string($i * $i)), ' => ')" />
        <br />
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>

Output:

<html>
   <body>1 =&gt; 4 =&gt; 9 =&gt; 16 =&gt; 25 =&gt; 36 =&gt; 49 =&gt; 64 =&gt; 81 =&gt; 100<br></body>
</html>

 








Related examples in the same category