xsl-list
[Top] [All Lists]

RE: summing up incrementally

2003-12-18 11:41:32
Where's the summing? Please tell us your method of computing the values to be 
placed in the output tree element's "percentage-increase" attributes.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Paul Tremblay <phthenry(_at_)earthlink(_dot_)net>
Sent:     Thu, 18 Dec 2003 13:03:52 -0500
To:       xsl-list <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  [xsl] summing up incrementally

Is there a way to sum up incrementally?

My source tree looks something like this:

<root>

<year year = "1937">

  <month month = "January" percentage-increase = "105"/>
  <!--and so on for each month-->
  <month month = "December" percentage-increase = "103"/>
</year>

<year year = "1938">
  <month month = "January" percentage-increase = "104"/>
  <!--and so on for each month-->
  <month month = "December" percentage-increase = "102"/>
</year>


<year year = "1939">
  <month month = "January" percentage-increase = "106"/>
  <!--and so on for each month-->
  <month month = "December" percentage-increase = "108"/>
</year>

</root>

I need to sum up the percentage-increase just for December. I want my
resulting tree to look like this:

<root>

<year year = "1937" percentage-increase = "103"/>

<!--now add up Decmber 1937 and December 1938-->
<year year = "1938" percentage-increase = "105"/>


<!--now add up Decmber 1937, December 1938, and December 1939-->
<year year = "1938" percentage-increase = "113"/>

</root>

I'm thinking I can do with is a recursive template, but can't figure out
how.

Thanks

Paul

-- 

************************
*Paul Tremblay         *
*phthenry(_at_)earthlink(_dot_)net*
************************

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>