Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT recursion for totals

Status
Not open for further replies.

paoloc

IS-IT--Management
Aug 14, 2002
14
0
0
US
Hi, I'm quite new to XSLT....
I have an XML file structured as follows:
<range>
<group label=&quot;FILE_NO&quot; level=&quot;_1&quot; value=&quot;1020313&quot;>
<row>
<field label=&quot;FILE_NO&quot; name=&quot;FILE_NO&quot; >1020313</field>
<field label=&quot;CHARGE&quot; name=&quot;CHARGE&quot;>fee 1</field>
<field label=&quot;AMT&quot; name=&quot;AMT&quot;>100</field>
</row>
<row>
<field label=&quot;FILE_NO&quot; name=&quot;FILE_NO&quot; >1020313</field>
<field label=&quot;CHARGE&quot; name=&quot;CHARGE&quot;>fee 1</field>
<field label=&quot;AMT&quot; name=&quot;AMT&quot;>25</field>
</row>
<row>
<field label=&quot;FILE_NO&quot; name=&quot;FILE_NO&quot; >1020313</field>
<field label=&quot;CHARGE&quot; name=&quot;CHARGE&quot;>fee 2</field>
<field label=&quot;AMT&quot; name=&quot;AMT&quot;>100</field>
</row>
<row>
<field label=&quot;FILE_NO&quot; name=&quot;FILE_NO&quot; >1020313</field>
<field label=&quot;CHARGE&quot; name=&quot;CHARGE&quot;>fee 3</field>
<field label=&quot;AMT&quot; name=&quot;AMT&quot;>25</field>
</row>
<row>
<field label=&quot;FILE_NO&quot; name=&quot;FILE_NO&quot; >1020313</field>
<field label=&quot;CHARGE&quot; name=&quot;CHARGE&quot;>fee 4</field>
<field label=&quot;AMT&quot; name=&quot;AMT&quot;>25</field>
</row>
....
</group>
<group label=&quot;FILE_NO&quot; level=&quot;_2&quot; value=&quot;1020314&quot;>
....similar as above....
</group>
</range>

How can I write a recursive XLST template that will display data as follows:

file fee1 fee2 fee3+fee4
1020313 125 125 ....
1020314 ... ... ....

Basically totalling up each fee in its own column and/or computing the totals for groups of fees?
Can anyone just help me get started?

Any help is greatly appreciated.

__PC


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top