xsl-list
[Top] [All Lists]

Continuously add to a parameter at each call

2005-11-09 12:01:23
I am using xsl to manipulate data contained in a MS Project file and my
issue is with adding the total cost of certain tasks.  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.  Based on the code below, I calculate
the cost of a task if the first two "if" statements are satisfied.  I
want to have a parameter that I can update everytime I get the cost of a
task and keep a running total of the overall cost.

Can someone tell me what the code should be inside the template
"TotalCost" to keep a running total of the cost??? 

<xsl:if test="$task_uid = $temp_task_id"> <!-- Compare ID related to
Assignment -->

        <xsl:if test="$task_wbs = $temp_task_wbs">      <!-- Seperate
low-level tasks according to top-level -->

                <xsl:variable name="Cost"
select="*[local-name()='Cost']" />

            <xsl:call-template name="TotalCost">
                   <xsl:with-param name="Tot_Cost" select="$Cost"/>
            </xsl:call-template>
 


I've been trying this for two days and cannot get a good result, so any
help is very much appreciated

Thankyou
Emil S.     



--~------------------------------------------------------------------
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>
--~--