[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Problem with 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|