cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@media.demon.co.uk>
Subject JXTemplate: nested forEach problem
Date Tue, 10 Feb 2004 11:39:52 GMT
I have a set of nested Beans, from with I am trying to extract values  
using JXTemplate.

album - an Album Bean
	title - String
	text - String
	. . .
	resources - ArrayList of Resource Beans
		artefact - String
		text - String
		images - ArrayList of Image Beans
			image - String
		. . .

Here is part of the Template :

<t:forEach items="#{album/resources}">
   <section>
     <title>
	<a href="../artefacts/work(#{artefact}).html" title="view the full  
artefact">
          <!-- snip -->
	</a>
     </title>
     <p>IMAGES: #{count(images)}</p>  <!-- this reports 2 images -->
     <t:forEach items="#{images}">	  <!-- this throws an exception -->
       <a href="../artefacts/image(#{image}).html" title="view  
information about this image">
         <img alt="image: #{image}"  
src="../images/thumbnail/artefacts/#{image}.jpg"/>
       </a><xsl:text>&#160;</xsl:text>
     </t:forEach>
     <p title="albums.album.commentary" i18n:attr="title">#{text}</p>
   </section>
</t:forEach>

This all works fine if I take out the inner 'forEach'.
When I leave it in I get the far from helpful (currently in 2.1.4-dev,  
generic) Exception:

org.apache.cocoon.ProcessingException: Generator already set. Cannot  
set generator 'jx' at  
file:/Users/jerm/Development/Checkouts/someproject/webapp/album.xmap: 
37:62
         at  
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setGene 
rator(AbstractProcessingPipeline.java:243)
         at  
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipe 
line.setGenerator(AbstractCachingProcessingPipeline.java:158)

etc.

What I do not understand is that this works :
	#{count(images)}
But this throws exceptions :
	<t:forEach items="#{images}">

Any suggestions?
I have tried all of the variations in the documentation and User's List  
that I could find.

thanks

regards Jeremy

Mime
View raw message