[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] cumulative sum along linked list
Here is my XML:
<items> <item id="1"><dependson>0</dependson><data>10</data> </item> <item id="2"><dependson>1</dependson><data>20</data></item> <item id="3"><dependson>2</dependson><data>30</data></item> <item id="4"><dependson>7</dependson><data>40</data></item> <item id="5"><dependson>1</dependson><data>50</data></item> <item id="6"><dependson>1</dependson><data>60</data></item> <item id="7"><dependson>6</dependson><data>70</data></item> </items> I need some type of recursive template that will run throught each <item> and form a cumulative sum on <data> tracing back through to other <item>'s following the <dependson> tag. I need output that looks something like this (not the stuff in parentheses Item Sum 1 10 (=10) 2 30 (=10+20) 3 60 (=10+20+30) 4 180 (=10+60+70+40) 5 60 (=10+50) 6 70 (=10+60) 7 140 (=10+60+70 Anyone know how to approach this? _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|