Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Summarizing a total when needing individual calcuations first

From: "Kindler Chase" <support@------_--_------.--->
To: 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














transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent