how to make xsl tokenize work

CamperBoy

New Member
I have a huge xsl file but the section where i use "tokenize" to parse through a comma separated string is throwing an error. For simplicity purposes I have broke it down to just test the tokenize piece only and cannot seem to make any progress. I keep getting the following error:\[quote\] Expression expected. tokenize(-->[<--text],',') \[/quote\]I tried using some example xsl shared in other posts but never managed to get it to work. I am having a difficult time understanding why my xsl code below is not valid. It seems t be very straightforward but I think I am missing something simple. Any help to get me in the right direction would be much appreciated. XSL:\[code\]<xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/root"><xsl:for-each select="tokenize([text],',')"/><items><item><xsl:value-of select="."/></item></items></xsl:for-each></xsl:template></xsl:stylesheet>\[/code\]XML:\[code\]<?xml-stylesheet type="text/xsl" href="http://stackoverflow.com/questions/11487704/simple.xsl"?><root><text>Item1, Item2, Item3</text></root>\[/code\]I am expecting an XML output as follows:\[code\]<items><item>Item1</item><item>Item2</item><item>Item3</item></items>\[/code\]Thank you!
 
Back
Top