Return-Path: Delivered-To: apmail-jakarta-taglibs-user-archive@www.apache.org Received: (qmail 23237 invoked from network); 28 Jan 2007 04:06:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jan 2007 04:06:57 -0000 Received: (qmail 35272 invoked by uid 500); 28 Jan 2007 04:07:01 -0000 Delivered-To: apmail-jakarta-taglibs-user-archive@jakarta.apache.org Received: (qmail 35107 invoked by uid 500); 28 Jan 2007 04:07:01 -0000 Mailing-List: contact taglibs-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tag Libraries Users List" Reply-To: "Tag Libraries Users List" Delivered-To: mailing list taglibs-user@jakarta.apache.org Received: (qmail 35096 invoked by uid 99); 28 Jan 2007 04:07:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jan 2007 20:07:00 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of brodseba@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jan 2007 20:06:52 -0800 Received: by nf-out-0910.google.com with SMTP id l36so1642118nfa for ; Sat, 27 Jan 2007 20:06:30 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=LNGq4vwwA4Rmo5sclQ+3tcWwsY8PWbHedwBTOBMRnQt1U6VM6bZGd2mstUYJRSBH2LlFcrrzxQZnglKlq11PsOUj1NQrbZ3YMXYezV4lXqhbEgSb5DSB4RCl+XHg+gouyoZTBdNA2bnx/60hwasNYS8x8NIXX6Wn30RBeE/12FE= Received: by 10.82.165.1 with SMTP id n1mr2812653bue.1169957189526; Sat, 27 Jan 2007 20:06:29 -0800 (PST) Received: by 10.82.140.8 with HTTP; Sat, 27 Jan 2007 20:06:29 -0800 (PST) Message-ID: Date: Sun, 28 Jan 2007 05:06:29 +0100 From: "=?ISO-8859-1?Q?S=E9bastien_Brodeur?=" Reply-To: brodseba@iname.com To: "Tag Libraries Users List" Subject: Re: Problem when a use a x:forEach into another x:forEach In-Reply-To: <476426.19539.qm@web56414.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_67053_29406181.1169957189490" References: <476426.19539.qm@web56414.mail.re3.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_67053_29406181.1169957189490 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This code work perflectly in JSTL 1.0. On 1/27/07, Rashmi Rubdi wrote: > > S=E9bastien, > > I tried your original JSP code and was able to reproduce the problem you > indicated in your first e-mail in JSTL 1.1 and Tomcat 5.5. > > Then I made few changes to the JSP page as follows. I renamed some > variables to make the code less ambiguous to read but the logic remains t= he > same. > > <%@ taglib prefix=3D"c" uri=3D"http://java.sun.com/jsp/jstl/core" %> > <%@ taglib prefix=3D"x" uri=3D"http://java.sun.com/jsp/jstl/xml" %> > > > > > > > > var=3D"vCollection"> > > > >
    > var=3D"vBook"> >
  • > print test >
    >
> >
> > > The code inside the inner x:forEach never executes. I think it never > executes because the inner for loop , is not inside the context of the XM= L > node in the outer for loop. > > If you look at the outer x:forEach loop > the xml context node is $pCollections/collections/collection , and in the > inner x:forEach $pBooks/books/book , does not fall under the context of t= he > the external loop. > > If I'm not wrong, I think nesting of x:forEach works as long as the > context of the nested x:forEach falls under that of the outer x:forEach. > > One solution to achieve the nested output would be to first combine the 2 > XML documents by transforming them with XSLT to create a new XML document= , > then use the new XML document to achieve the nesting. I haven't tried suc= h a > transformation, but I will try it in case I'm right about nesting of > x:forEach doesn't work with unrelated contexts. > > Are you saying that your original code worked in JSTL1.0 and is not > working in JSTL1.1 ? Or you tried this code for the first time in JSTL1.1= and never in > JSTL1.0? > > -Rashmi > > ----- Original Message ---- > From: S=E9bastien Brodeur > To: Tag Libraries Users List > Sent: Saturday, January 27, 2007 8:37:56 AM > Subject: Re: Problem when a use a x:forEach into another x:forEach > > > Hi Rashmi, > > Thank you for the answer. > > Have you been able to reproduce the error? Is my syntax wrong (I'm not > thrill by Node context :-) ? > > Even if a try to use a block, I got no error. (I still have to > look in the error log thou, first think Monday morning). > > 1) By using Servlet 2.4 jar, you mean are we using a Servlet > 2.4container? If so, yes. > > 2) I already change the web.xml file to use servlet 2.4 > > 3) I use a local version (I made sure the .tld file are the one coming > with > the taglibs JSTL 1.1 package.) of the taglibs declaration. > > So I use: > > <%@ taglib prefix=3D"c" uri=3D"/WEB-INF/c.tld" %> > <%@ taglib prefix=3D"x" uri=3D"/WEB-INF/x.tld" %> > > instead of: > > <%@ taglib prefix=3D"c" uri=3D"http://java.sun.com/jsp/jstl/core"; %> > <%@ taglib prefix=3D"x" uri=3D"http://java.sun.com/jsp/jstl/xml"; %> > > If a try the latest, I got a error. (Is it only namespace or some > firewall > may be blocking those???) > > Once again, thank you > > On 1/27/07, Rashmi Rubdi wrote: > > > > Are you getting any errors in the log? > > > > When you upgrade from JSTL1.0 to JSTL1.1 you need to make some changes > or > > verify these changes: > > > > 1) Use Servlet 2.4 jar > > > > 2) Change web.xml to servlet 2.4 version: > > > > > xmlns=3D"http://java.sun.com/xml/ns/j2ee"; > > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"; > > xsi:schemaLocation=3D"http://java.sun.com/xml/ns/j2ee > > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> > > > > 3) Change tag library declarations to: > > > > <%@ taglib prefix=3D"c" uri=3D"http://java.sun.com/jsp/jstl/core"; %> > > <%@ taglib prefix=3D"x" uri=3D"http://java.sun.com/jsp/jstl/xml"; %> > > Similarly upgrade other JSTL namespace URIs > > > > -Rashmi > > > > ----- Original Message ---- > > From: S=E9bastien Brodeur > > To: taglibs-user@jakarta.apache.org > > Sent: Friday, January 26, 2007 2:03:02 PM > > Subject: Problem when a use a x:forEach into another x:forEach > > > > > > I'm currently migrating my application from WebSphere 5 (JSTL 1.0) to > > WebSphere 6 (JSTL 1.1), and so far, the XML taglibs give us a lot of > > trouble. > > > > For example : > > > > > > > -------------------------------------------------------------------------= ----------------------------- > > collections.xml > > > > > > > > > > horror > > Horror novel > > > > > > scifi > > Sci-Fi novel > > > > > > > > > > > -------------------------------------------------------------------------= ----------------------------- > > books.xml > > > > > > > > > > scifi > > Robots > > > > > > scifi > > The Moon is a Hashes Mistress > > > > > > scifi > > Spaceship Tropper > > > > > > horror > > This > > > > > > > > > > > -------------------------------------------------------------------------= ----------------------------- > > books.jsp > > > > <%@ taglib prefix=3D"c" uri=3D"/WEB-INF/c.tld" %> > > <%@ taglib prefix=3D"x" uri=3D"/WEB-INF/x.tld" %> > > > > /> > > > > > > > > > > > > var=3D"collection"> > > > >
    > > > var=3D"book"> > >
  • > >
    > >
> >
> > > > > > > -------------------------------------------------------------------------= ----------------------------- > > Output (WebSphere 5 using JSTL 1.0) > > > > Horror novel > >
    > >
  • This
  • > >
> > > > Sci-Fi novel > >
    > >
  • Robots
  • > >
  • The Moon is a Hashes Mistress
  • > >
  • Spaceship Tropper
  • > >
> > > > > > > -------------------------------------------------------------------------= ----------------------------- > > > > Output (WebSphere 6 using JSTL 1.1) > > > > Horror novel > >
    > >
> > Sci-Fi novel > >
    > >
> > > > > > Any idea how to do that without changing the structure of the two XML > > files? > > > > Thank! > > > > -- > > S=E9bastien Brodeur > > brodseba@iname.com > > Site Web : http://www.un-programmeur-php.ca/ > > > > > > > > > > > _________________________________________________________________________= ___________ > > Cheap talk? > > Check out Yahoo! Messenger's low PC-to-Phone call rates. > > http://voice.yahoo.com > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org > > > > > > > -- > S=E9bastien Brodeur > brodseba@iname.com > Site Web : http://www.un-programmeur-php.ca/ > > > > > _________________________________________________________________________= ___________ > Yahoo! Music Unlimited > Access over 1 million songs. > http://music.yahoo.com/unlimited > > --------------------------------------------------------------------- > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org > > --=20 S=E9bastien Brodeur brodseba@iname.com Site Web : http://www.un-programmeur-php.ca/ ------=_Part_67053_29406181.1169957189490--