cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Marasti-Georg" <cge...@rjlg.com>
Subject RE: JXTemplate - Incrementing value of variable in a loop
Date Tue, 12 Jul 2005 13:47:02 GMT
There is an xpath function sum(), try using #{sum(item/quantity)} (not
sure of exact syntax)
ex. <jx:set var="total" value="#{sum(item/quantity)}"/>

Chris Marasti-Georg
 

> -----Original Message-----
> From: Upayavira [mailto:uv@odoko.co.uk] 
> Sent: Tuesday, July 12, 2005 9:05 AM
> To: users@cocoon.apache.org
> Subject: Re: JXTemplate - Incrementing value of variable in a loop
> 
> Johannes Becker wrote:
> > Hi,
> > 
> > I want to increment the value of a variable in a 
> <jx:forEach>-loop. In 
> > my case, I want to increment the variable "total" with the 
> > "quantity"-element (from item).
> > 
> > <jx:set var="total" value="0"/>
> > <jx:forEach select="#{item}">
> > 	???	#{total} +=  #{quantity}   ???		
> > </jx:forEach>
> > 
> > Is there a way to do this? Or a workaround?
> 
> See http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html#forEach
> (esp begin, step, end attributes).
> 
> Never used them, I assume they work.
> 
> Upayavira
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message