tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Flavio Tordini <f.tord...@kataweb.it>
Subject [standard] Wrong behaviour of x:out inside x:forEach
Date Fri, 09 Jul 2004 14:58:44 GMT
hi all,
inside a x:forEach loop, i put an x:out that evaluates an XPath 
expression on a document which is not same of the x:forEach.
The x:out seems to behave strangely. Take a look at following JSP:

=======================

<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:import url="sample.xml" varReader="r">
   <x:parse var="sample" doc="${r}"/>
</c:import>
<x:forEach select="$sample/sample/link">
   <c:set var="link">
     <x:out select="@href"/>
   </c:set>

   <c:import url="${link}" varReader="r2">
     <x:parse var="sample2" doc="${r2}"/>
   </c:import>

   <!-- *** this does not work *** -->
   <x:out select="$sample2/sample2/text"/>

   <!-- this does work, but i think it is not correct -->
   <x:out select="$sample2/text"/>

</x:forEach>

======================
sample.xml:
======================

<sample>
   <link href="sample2.xml"/>
</sample>

======================
sample2.xml:
======================

<sample2>
   <text>this is just a test!</text>
</sample2>

======================

I'm using JSTL 1.1, Jakarta Taglib Standard 1.1.0, Tomcat 5.0.25 (same 
problem on both linux and windows)
Any suggestions? Is this a bug?

flavio

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


Mime
View raw message