Reputation: 4037
I am trying to use the tokenize function in XSLT and it is not working
<xsl:variable name="stringList" select="tokenize('XPath,is,fun', ',')"/>
<xsl:for-each select="$stringList">
<xsl:value-of select="." />
</xsl:for-each>
Is this anything wrong in this ? I tried this both in eclipse and in the w3schools tutorial editor
Actual code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rg="http://www....."
xmlns="http://wwww.w3.org/1999/xhtml" >
<xsl:template match="/">
<html>
<head>
<title>Temp</title>
</head>
<body>
<xsl:variable name="stringList" select="tokenize('XPath,is,fun', ',')" />
<xsl:for-each select="$stringList">
<xsl:value-of select="." /><br/>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Upvotes: 0
Views: 3125
Reputation: 70598
Tokenize is actually an XSLT 2.0 function, and so you will need to use an XSLT processor that supports XSLT 1.0. The editor at W3Schools is XSLT 1.0 only.
I tried your XSLT at http://xslttest.appspot.com/ as an example, and it works happily.
Upvotes: 2