xsl-list
[Top] [All Lists]

RE: Continuously add to a parameter at each call

2005-11-09 12:36:59
-----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,

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--