[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problem with str:tokenize

Subject: Problem with str:tokenize
From: "Sanket Pattekar" <sanket.pattekar@xxxxxxxxx>
Date: Tue, 27 Jun 2006 16:41:04 +0530
str tokenize
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.