RE: [xsl] Continuously add to a parameter at each call

Subject: RE: [xsl] Continuously add to a parameter at each call
From: "Haarman, Michael" <mhaarman@xxxxxxxxx>
Date: Wed, 9 Nov 2005 13:36:59 -0600
> -----Original Message-----
> From: Emil Soosaithasan

Currently I am
> checking through all tasks to meet a certain condition and 
> when there is
> a match I want to obtain the cost of the task and set that value to a
> parameter.  My desired end result should calculate the total 
> cost of all
> tasks that satisfy the condition.


Why not use the sum() function?

The sum function returns the sum, for each node in the argument node-set, of
the result of converting the string-values of the node to a number.

Then,

<xsl:value-of select="sum(/XPath/to/nodes[answeringToSomeCondition])"/>

with possibly a translate() inserted to remove symbols (euro, dollar, etc.)

HTH,

Current Thread