jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41481] New: - Error when nested x:forEach loops where the inner x:forEach iterates over the parsed results of a *different* xml file.
Date Sun, 28 Jan 2007 07:48:54 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41481>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41481

           Summary: Error when nested x:forEach loops where the inner
                    x:forEach iterates over the parsed results of a
                    *different* xml file.
           Product: Taglibs
           Version: 1.1
          Platform: Other
        OS/Version: AIX
            Status: NEW
          Keywords: Xerces2
          Severity: regression
          Priority: P2
         Component: Standard Taglib
        AssignedTo: taglibs-dev@jakarta.apache.org
        ReportedBy: brodseba@iname.com


In both JSTL 1.1 and 1.0 specifications nothing is mentioned about nested
x:forEach loops where the inner x:forEach iterates over the parsed results of a
*different* xml file.

But between JSTL 1.0 and JSTL 1.1, this very behavior change.

For example :

------------------------------------------------------------------------------------------------------
collections.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<collections>
  <collection>
    <id>horror</id>
    <name>Horror novel</name>
  </collection>
  <collection>
    <id>scifi</id>
    <name>Sci-Fi novel</name>
  </collection>
</collections>

------------------------------------------------------------------------------------------------------
books.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<books>
  <book>
    <collection_id>scifi</collection_id>
    <title>Robots</title>
  </book>
  <book>
    <collection_id>scifi</collection_id>
    <title>The Moon is a Hashes Mistress</title>
  </book>
  <book>
    <collection_id>scifi</collection_id>
    <title>Spaceship Tropper</title>
  </book>
  <book>
    <collection_id>horror</collection_id>
    <title>This</title>
  </book>
</books>

------------------------------------------------------------------------------------------------------
books.jsp

<%@ taglib prefix="c" uri="/WEB-INF/c.tld" %>
<%@ taglib prefix="x" uri="/WEB-INF/x.tld" %>

<c:import var="xml_collections" url="http://localhost/collections.xml" />
<x:parse xml="${xml_collections}" var="collections" scope="request"/>

<c:import var="xml_books" url="http://www.localhost/books.xml" />
<x:parse xml="${xml_books}" var="books" scope="request"/>

<x:forEach select="$collections/collections/collection" var="collection">
  <x:out select="$collection/name" />
  <ul>
    <x:forEach select="$books/books/book[collection_id=$collection/id]" var="book">
      <li><x:out select="$book/title" /></li>
    </x:forEach>
  </ul>
</x:forEach>

------------------------------------------------------------------------------------------------------
Output (WebSphere 5 using JSTL 1.0)

  Horror novel
  <ul>
      <li>This</li>
  </ul>

  Sci-Fi novel
  <ul>
      <li>Robots</li>
      <li>The Moon is a Hashes Mistress</li>
      <li>Spaceship Tropper</li>
  </ul>

------------------------------------------------------------------------------------------------------

Output (WebSphere 6 using JSTL 1.1)

  Horror novel
  <ul>
  </ul>
  Sci-Fi novel
  <ul>
  </ul>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message