Hi all (and thanks for the reply, Tony), To restate the problem from my original post, I'm having trouble when I invoke xalan:nodeset($myfragment) more than once on a stylesheet. Whichever variable gets invoked first renders fine, but all other nodesets are null. One of the problem xsl's is below. The variables $resultlist and $teamuser are declared at the bottom. I've tried combining different variables and the behavior is always the same. The topmost nodeset gets rendered fine, the others are empty. Note that this behavior is only within Cocoon. When I save Cocoon's XML output to a file (which I've pasted below) and I invoke Xalan directly to render the page, I don't have this problem. I'm not getting any exceptions or log warnings.
Any hints anyone could offer would be most appreciated. I've been stuck on this for two days now and I'm stumped! Thanks, David Benoff <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:exslt="http://exslt.org/common" xmlns:xalan="http://xml.apache.org/xalan" xmlns:i18n="http://apache.org/cocoon/i18n/2.1" exclude-result-prefixes="xalan"> <xsl:output method="html"/> <xsl:template match="/"> <script language="JavaScript"> window.name="main"; function getUser() { window.open('setupTeamUser.do?method=getTeamUserList&teamid=<xsl:val ue-of select="hibernate-custom/Team/teamid"/>','','directories=0,menubar=0,too lbar=0,width=300,height=300'); } function getCategory() { window.open('setupTeamCategory.do?method=getTeamCategoryList&teamid= <xsl:value-of select="hibernate-custom/Team/teamid"/>','','directories=0,menubar=0,too lbar=0,width=300,height=300'); } </script> <html><head> <title>User list</title> <link href="file:///C|/java/hibapp2/web/config/skin1.css" rel="stylesheet" type="text/css"/> </head> <body> <div align="center"> <p> <font size="+2" face="Geneva, Arial, Helvetica, sans-serif">Manage Team</font> </p> <form method="post" name="TeamForm" action="/updateTeam.do?method=updateTeamInfo" > <table align="center" width="75%" border="0"> <tbody> <tr> <td align="right" width="50%">Team name:</td> <td width="50%"> <input name="teamname" size="25" value="{hibernate-custom/Team/teamname}"/> <xsl:if test="hibernate-custom/messages/message[value = 'Teamname']"> <font color="#FF0000">  <xsl:value-of select="hibernate-custom/messages/message[value = 'Teamname']/value"/> <i18n:text><xsl:value-of select="hibernate-custom/messages/message[value = 'Teamname']/@type"/></i18n:text> </font> </xsl:if> </td> </tr> <tr> <td align="right">Description:</td> <td><textarea cols="25" rows="3" name="teamdesc"> <xsl:value-of select="hibernate-custom/Team/teamdesc"/> </textarea> </td> </tr> <tr> <td align="right">Minimum age:</td> <td> <xsl:choose> <xsl:when test="hibernate-custom/Team/minage = '0'"> <input name="minage" type="text" size="3" maxlength="3" /> </xsl:when> <xsl:otherwise> <input name="minage" type="text" size="3" maxlength="3" value="{hibernate-custom/Team/minage}"/> </xsl:otherwise> </xsl:choose> </td> </tr> <tr> <td align="right">Maximum age:</td> <td> <xsl:choose> <xsl:when test="hibernate-custom/Team/maxage = '999'"> <input name="maxage" type="text" size="3" maxlength="3" /> </xsl:when> <xsl:otherwise> <input name="maxage" type="text" size="3" maxlength="3" value="{hibernate-custom/Team/maxage}"/> </xsl:otherwise> </xsl:choose> </td> </tr> </tbody> </table> <p> <input name="id" value="{/hibernate-custom/Team/teamid}" type="hidden"/> <input type="submit" value="Update Info" />  </p> <table align="center" width="50%" border="2"> <tbody> <tr align="center"> <td> </td> <td> <u>User name</u> </td> <td> <u>Age</u> </td> <td> <u>Category</u> </td> </tr> <xsl:for-each select="xalan:nodeset($teamuser)/user"> <xsl:sort select="uname" order="ascending"/> <tr align="center"> <td> <input name="userids" value="{userid}" type="checkbox"/> </td> <td> <a href="manageUser.do?method=manageUser&userid={userid}"> <xsl:value-of select="uname"/> </a> </td> <td> <xsl:value-of select="age"/> </td> <td> <a href="manageUser.do?method=manageUser&userid={categoryid}"> <xsl:value-of select="cname"/> </a> </td> </tr> </xsl:for-each> </tbody> </table> <br/> <xsl:choose> <xsl:when test="hibernate-custom/Team/categories/@id"> <input value="Find more users" name="param" type="button" onclick="getUser()"/>   </xsl:when> <xsl:otherwise> <input disabled="true" value="Find more users" name="param" type="button" onclick="getUser()"/>   </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="hibernate-custom/Team/users/@id"> <input value="Remove users" type="submit" onclick="this.form.action = '/updateTeam.do?method=removeUsers';" /> </xsl:when> <xsl:otherwise> <input disabled="true" value="Remove users" type="submit" onclick="this.form.action = '/updateTeam.do?method=removeUsers';" /> </xsl:otherwise> </xsl:choose> <br/> <br/> <table align="center" width="40%" border="2"> <tbody> <tr align="center"> <th> </th> <th width="35%" > <u>Category name</u> </th> <th> <u>Description</u> </th> </tr> <xsl:for-each select="/hibernate-custom/Category"> <xsl:sort select="categoryname" order="ascending"/> <xsl:variable name="catiter" select="@id"/> <xsl:for-each select="/hibernate-custom/Team/[EMAIL PROTECTED] = $catiter]"> <xsl:variable name="iter" select="@id"/> <tr align="center"> <td> <input name="categoryids" value="{/hibernate-custom/[EMAIL PROTECTED] = $iter]/categoryid}" type="checkbox"/> </td> <td> <a href="manageCategory.do?method=manageCategory&categoryid={/hibernate -custom/[EMAIL PROTECTED] = $iter]/categoryid}"> <xsl:value-of select="/hibernate-custom/[EMAIL PROTECTED] = $iter]/categoryname"/> </a> </td> <td> <xsl:value-of select="/hibernate-custom/[EMAIL PROTECTED] = $iter]/categorydesc"/> </td> </tr> </xsl:for-each> </xsl:for-each> </tbody> </table> <br/> <input value="Find more categories" type="button" onclick="getCategory()"/>   <xsl:choose> <xsl:when test="hibernate-custom/Team/categories/@id"> <input value="Remove categories" type="submit" onclick="this.form.action = '/updateTeam.do?method=removeCategories';" /> </xsl:when> <xsl:otherwise> <input disabled="true" value="Remove categories" type="submit" onclick="this.form.action = '/updateTeam.do?method=removeCategories';" /> </xsl:otherwise> </xsl:choose> <br/> <br/> <table align="center" width="80%" border="2"> <tbody> <tr align="center"> <td> </td> <td> <u>Event</u> </td> <td> <u>Race</u> </td> <td> <u>User</u> </td> <td> <u>Date</u> </td> <td> <u>Place</u> </td> <td> <u>Time</u> </td> </tr> <xsl:for-each select="xalan:nodeset($resultlist)/result"> <tr align="center"> <td> <input type="checkbox" name="resultids" value="{resultid}" /> <input name="id" value="{userid}" type="hidden"/> </td> <td> <a href="manageEvent.do?method=manageEvent&eventid={eventid}"> <xsl:value-of select="eventname"/> </a> </td> <td> <a href="manageRace.do?method=manageRace&raceid={raceid}"> <xsl:value-of select="racename"/> </a> </td> <td> <a href="manageUser.do?method=manageUser&userid={userid}"> <xsl:value-of select="username"/> </a> </td> <td> <xsl:value-of select="edate"/> </td> <td> <xsl:value-of select="place"/> </td> <td> <xsl:value-of select="time"/> </td> </tr> </xsl:for-each> </tbody> </table> <br/> <input name="id" value="{/hibernate-custom/Team/teamid}" type="hidden"/> <xsl:choose> <xsl:when test="hibernate-custom/Team/results/@id"> <input type="submit" value="Edit Results" onclick="this.form.action = '/updateTeam.do?method=editTeamResults';" />   <input type="submit" value="Delete Results" onclick="this.form.action = '/updateTeam.do?method=deleteTeamResults';" /> </xsl:when> <xsl:otherwise> <input type="submit" disabled="true" value="Edit Results" onclick="this.form.action = '/updateTeam.do?method=editTeamResults';" />   <input type="submit" disabled="true" value="Delete Results" onclick="this.form.action = '/updateTeam.do?method=deleteTeamResults';" /> </xsl:otherwise> </xsl:choose> </form> </div> </body> </html> </xsl:template> <xsl:variable name="teamuser"> <xsl:for-each select="hibernate-custom/Team/users"> <xsl:variable name="iter" select="@id"/> <xsl:variable name="user" select="/hibernate-custom/[EMAIL PROTECTED]"/> <xsl:variable name="usercat" select="/hibernate-custom/[EMAIL PROTECTED]/category/@id"/> <user> <uname><xsl:value-of select="$user/username"/></uname> <userid><xsl:value-of select="$user/userid"/></userid> <age><xsl:value-of select="$user/age"/></age> <cname><xsl:value-of select="/hibernate-custom/[EMAIL PROTECTED] = $usercat]/categoryname"/></cname> <categoryid><xsl:value-of select="/hibernate-custom/[EMAIL PROTECTED] = $usercat]/categoryid"/></categoryid> </user> </xsl:for-each> </xsl:variable> <xsl:variable name="resultlist"> <xsl:for-each select="hibernate-custom/Result"> <xsl:variable name="torace" select="race/@id"/> <xsl:variable name="team" select="team/@id"/> <xsl:variable name="user" select="user/@id"/> <xsl:variable name="category" select="category/@id"/> <xsl:variable name="race" select="../[EMAIL PROTECTED] = $torace]"/> <xsl:variable name="toevent" select="$race/event/@id"/> <xsl:variable name="event" select="../[EMAIL PROTECTED] = $toevent]"/> <xsl:variable name="toeventtype" select="../[EMAIL PROTECTED] = $event/@id]/eventtype/@id"/> <xsl:variable name="type" select="../[EMAIL PROTECTED] = $toeventtype]"/> <result> <resultid> <xsl:value-of select="resultid"/> </resultid> <raceid> <xsl:value-of select="../[EMAIL PROTECTED] = $torace]/raceid"/> </raceid> <racename> <xsl:value-of select="$race/racename"/> </racename> <eventid> <xsl:value-of select="$event/eventid"/> </eventid> <eventname> <xsl:value-of select="$event/eventname"/> </eventname> <teamid> <xsl:value-of select="../[EMAIL PROTECTED] = $team]/teamid"/> </teamid> <teamname> <xsl:value-of select="../[EMAIL PROTECTED] = $team]/teamname"/> </teamname> <userid> <xsl:value-of select="../[EMAIL PROTECTED] = $user]/userid"/> </userid> <username> <xsl:value-of select="../[EMAIL PROTECTED] = $user]/username"/> </username> <categoryid> <xsl:value-of select="../[EMAIL PROTECTED] = $category]/categoryid"/> </categoryid> <categoryname> <xsl:value-of select="../[EMAIL PROTECTED] = $category]/categoryname"/> </categoryname> <eventtypeid> <xsl:value-of select="../[EMAIL PROTECTED] = $toeventtype]/eventtypeid"/> </eventtypeid> <eventtypename> <xsl:value-of select="../[EMAIL PROTECTED] = $toeventtype]/eventtypename"/> </eventtypename> </result> </xsl:for-each> </xsl:variable> </xsl:stylesheet> Here's the source data: <?xml version="1.0" encoding="UTF-8"?> <hibernate-custom datetime="10 September 2003 01:20:14"> <User id="N400004"> <userid>810</userid> <username>admin</username> <pass>admin</pass> <age>10</age> <category id="N400091">104</category> <!--elements of collection signups--> <!--end of elements--> <!--elements of collection results--> <results id="N4000EB">10305</results> <results id="N400112">10308</results> <results id="N40015F">9091</results> <results id="N400138">12323</results> <results id="N4001D1">9193</results> <results id="N4001AC">8889</results> <results id="N4001F6">12727</results> <!--end of elements--> <!--elements of collection teams--> <teams id="N400186">7880</teams> <teams id="N40021D">8384</teams> <!--end of elements--> <!--elements of collection races--> <!--end of elements--> </User> <Category id="N400055"> <categoryid>102</categoryid> <categorydesc>best</categorydesc> <categoryname>1</categoryname> <!--elements of collection teams--> <!--end of elements--> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Category> <Category id="N400073"> <categoryid>6667</categoryid> <categorydesc /> <categoryname>2</categoryname> <!--elements of collection teams--> <!--end of elements--> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Category> <Category id="N400091"> <categoryid>104</categoryid> <categorydesc>good</categorydesc> <categoryname>3</categoryname> <!--elements of collection teams--> <!--end of elements--> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Category> <Category id="N4000AF"> <categoryid>11111</categoryid> <categorydesc>test</categorydesc> <categoryname>my new cat</categoryname> <!--elements of collection teams--> <!--end of elements--> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Category> <Category id="N4000CD"> <categoryid>13131</categoryid> <categorydesc /> <categoryname>test</categoryname> <!--elements of collection teams--> <!--end of elements--> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Category> <Result id="N4000EB"> <resultid>10305</resultid> <place /> <time /> <category id="N400055">102</category> <race id="N400279">10000</race> <team id="N40021D">8384</team> <user id="N400004">810</user> </Result> <Result id="N400112"> <resultid>10308</resultid> <place>aa</place> <time /> <category id="N400055">102</category> <race id="N40025E">10404</race> <team id="N40021D">8384</team> <user id="N400004">810</user> </Result> <Result id="N400138"> <resultid>12323</resultid> <place /> <time /> <category id="N400073">6667</category> <race id="N4002AF">10405</race> <team id="N40021D">8384</team> <user id="N400004">810</user> </Result> <Result id="N40015F"> <resultid>9091</resultid> <place /> <time /> <category id="N400055">102</category> <race id="N4002E5">8485</race> <team id="N40021D">8384</team> <user id="N400004">810</user> </Result> <Team id="N400186"> <teamid>7880</teamid> <teamname>atest</teamname> <teamdesc>this is a description</teamdesc> <minage>0</minage> <maxage>999</maxage> <!--elements of collection categories--> <!--end of elements--> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Team> <Result id="N4001AC"> <resultid>8889</resultid> <place /> <time /> <category id="N400055">102</category> <race id="N4002CA">8182</race> <team id="N40021D">8384</team> <user id="N400004">810</user> </Result> <Result id="N4001D1"> <resultid>9193</resultid> <place /> <time /> <category id="N400055">102</category> <race id="N400294">8183</race> <team id="N40021D">8384</team> <user id="N400004">810</user> </Result> <Result id="N4001F6"> <resultid>12727</resultid> <place>3</place> <time /> <category id="N400073">6667</category> <race id="N400243">12527</race> <team id="N400186">7880</team> <user id="N400004">810</user> </Result> <Team id="N40021D"> <teamid>8384</teamid> <teamname>mytest</teamname> <teamdesc /> <minage>0</minage> <maxage>999</maxage> <!--elements of collection categories--> <!--end of elements--> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Team> <Race id="N400243"> <raceid>12527</raceid> <racename>4/5s</racename> <event id="N400300">12424</event> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Race> <Race id="N40025E"> <raceid>10404</raceid> <racename>mytest</racename> <event id="N40033E">1011</event> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Race> <Race id="N400279"> <raceid>10000</raceid> <racename>myevent</racename> <event id="N40031F">8081</event> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Race> <Race id="N400294"> <raceid>8183</raceid> <racename>eeee</racename> <event id="N40035D">8082</event> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Race> <Race id="N4002AF"> <raceid>10405</raceid> <racename>anewevent</racename> <event id="N40035D">8082</event> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Race> <Race id="N4002CA"> <raceid>8182</raceid> <racename>newrace</racename> <event id="N40035D">8082</event> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Race> <Race id="N4002E5"> <raceid>8485</raceid> <racename>attempt</racename> <event id="N40031F">8081</event> <!--elements of collection results--> <!--end of elements--> <!--elements of collection users--> <!--end of elements--> </Race> <Event id="N400300"> <eventid>12424</eventid> <eventname>A new event</eventname> <eventdate>28 August 2003</eventdate> <eventtype id="N40038C">0</eventtype> <!--elements of collection signups--> <!--end of elements--> <!--elements of collection races--> <!--end of elements--> </Event> <Event id="N40031F"> <eventid>8081</eventid> <eventname>aa</eventname> <eventdate>01 January 2001</eventdate> <eventtype id="N40038C">0</eventtype> <!--elements of collection signups--> <!--end of elements--> <!--elements of collection races--> <!--end of elements--> </Event> <Event id="N40033E"> <eventid>1011</eventid> <eventname>testevent</eventname> <eventdate>08 January 2001</eventdate> <eventtype id="N40038C">0</eventtype> <!--elements of collection signups--> <!--end of elements--> <!--elements of collection races--> <!--end of elements--> </Event> <Event id="N40035D"> <eventid>8082</eventid> <eventname>eea</eventname> <eventdate>17 January 2001</eventdate> <eventtype id="N40037C">1</eventtype> <!--elements of collection signups--> <!--end of elements--> <!--elements of collection races--> <!--end of elements--> </Event> <Eventtype id="N40037C"> <eventtypeid>1</eventtypeid> <eventtypename>Criterium</eventtypename> <!--elements of collection events--> <!--end of elements--> </Eventtype> <Eventtype id="N40038C"> <eventtypeid>0</eventtypeid> <eventtypename>Road race</eventtypename> <!--elements of collection events--> <!--end of elements--> </Eventtype> </hibernate-custom> --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003 -----Original Message----- From: Tony Culshaw [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 5:18 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Can't instantiate multiple nodesets on same stylesheet? You might be 'out of context' on the second nodeset, ie. it might be correct in the result being null.. Can you post your stylesheet (or an example) to this list? ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 10, 2003 5:20 PM Subject: Can't instantiate multiple nodesets on same stylesheet? > Hi all, > > Not sure whether this is as-designed or not (the archives had nothing), but > I'm seeing some strange behavior when using more than one > xalan:nodeset($myvariable) statement in the same page. My stylesheet > declares two RTF's as variables, and I convert each one to nodesets for > display. The problem is that only the first nodeset gets rendered > properly. The second one is always null. I can switch them around and the > first one always is fine, and the second is always null (using count() also > shows zero nodes). Strange... Any tips would be appreciated. Is there some > special trick to using multiple nodesets? > > My details: > Tomcat 4.1.24 LE > Cocoon 2.1m2 > JDK 1.4.1 > Rendering with default XSLT transformer/Xalan (tried several versions) > > Thanks, > David Benoff > > -------------------------------------------------------------------- > mail2web - Check your email from the web at > http://mail2web.com/ . > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
