[xsl] Problem with str:tokenize

Subject: [xsl] Problem with str:tokenize
From: "Sanket Pattekar" <sanket.pattekar@xxxxxxxxx>
Date: Tue, 27 Jun 2006 16:41:04 +0530
Hi
   I am having probelm with str:tokenize function. I run a for-each
loop on the str:tokenize() function. Inside the same I want to execute
another for-each loop.

To elaborate, I have the following xml file
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="myxsl.xsl"?>
<root>
	<path1>
		<info>
			<name>Ryan,DDDD</name>
			<age>26</age>
			<dept>IT</dept>
		</info>
	</path1>
	<path2>
		<deptinfo>
			<dept>IT</dept>
			<name>Information Technology</name>
		</deptinfo>
		<deptinfo>
			<dept>CompScience</dept>
			<name>Computer Science</name>
		</deptinfo>
	</path2>
</root>

And the following xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
	xmlns:str="http://exslt.org/strings";
	extension-element-prefixes="str">

      <xsl:template match="/">
              <head><title>Greeting</title></head>
                      <body>
                      <p>Words of greetingf:<br/>
			<xsl:for-each select="str:tokenize(//root/path1/info/name,',')">
				<b><i><u>Hello</u></i></b><br/>

					<xsl:for-each select="//root/path2/deptinfo">
						<b><i><u>Hello1</u></i></b><br/>
					</xsl:for-each>
			</xsl:for-each>
                       </p>
                      </body>
      </xsl:template>
</xsl:stylesheet>

Ideally it should return me
Hello
Hello1
Hello1
Hello
Hello1
Hello1

but returns
Hello
Hello

i.e the inner for-each loop never gets executed. Any reason why this
happens and how to solve the same

Thanks
Sanket.

Current Thread