Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Summarizing a total when needing individual calcuations first Summarizing a total when needing individual calcuations firstTo: NULL Date: 2/2/2006 11:08:00 AM Probably the easiest way to ask this question is to show the sample XML and
then provide the desired result:
=============== sample xml ===============
<root>
<order>
<price>100</price>
<conversion_rate>1.20</conversion_rate>
</order>
<order>
<price>85</price>
<conversion_rate>1.12</conversion_rate>
</order>
<order>
<price>125</price>
<conversion_rate>1.12</conversion_rate>
</order>
<order>
<price>105</price>
<conversion_rate>1.22</conversion_rate>
</order>
</root>
=============== end sample xml ===============
*Desired Result*
I need to take the result of every (price div conversion_rate) and then sum
the total of their results..
This obviously throws an error:
<xsl:value-of
select ="sum(root/order/price div root/order/conversion_rate)" />
In the above example, I need a result such as:
100 / 1.20 = 83.33
85 / 1.12 = 75.89
125 / 1.12 = 111.61
105 / 1.22 = 86.1
------------------------
Total: 256.93 <--------- desired result
fwiw: I do not need to see the above sub totals, they are only shown for
clarification; I only need the Total of 256.93 in this example.
Regards,
--
kindler chase
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
