Hi all,

Unless we've botched our installation of Tomcat 5.0 somehow or don't understand
some nuance of JSTL 1.2 (both reasonable possibilities), I believe we've hit a
major bug with x:forEach.  

Inside of a x:forEach, node-set variables defined outside the forEach appear to
change their values (see test case below).  I did not see this reported in the
bug database.

Could someone test this sample on a working Tomcat 5.0 and confirm our suspicion
that this is a bug?

Thanks,

Mark

--- Test case ---

<[EMAIL PROTECTED] contentType="text/html; charset=UTF-8" session="true" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"; %>

<html>
<body>
  <x:parse var="teams">
    <doc>
      <teamname>Redskins</teamname>
      <teamname>Cowboys</teamname>
    </doc>
  </x:parse>

  <x:set var="test" select="$teams/doc/*" />
  Team 1: <x:out select="$test/teamname[1]" /><br />
  Team 2: <x:out select="$test/teamname[2]" /><br />
  
  <x:forEach select="$teams/doc/teamname" >
    <%-- Same two lines as above but inside x:forEach, they return nothing --%>
    Team 1: <x:out select="$test/teamname[1]" /> <br />
    Team 2: <x:out select="$test/teamname[2]" /> <br />
  </x:forEach>

</body>
</html>

-- Test results ---
Team 1: Redskins
Team 2: Cowboys
Team 1: 
Team 2: 
Team 1: 
Team 2: 

--- Should be ---
Team 1: Redskins
Team 2: Cowboys
Team 1: Redskins
Team 2: Cowboys
Team 1: Redskins
Team 2: Cowboys


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to