Scripting capabilities and caclulated values

Is there some way to include calculated values in the result document.  In the example result document at the bottom of this e-mail, <SUB-TOTAL> and <GRAND-TOTAL> are calculated using information in the source document <item> and <quantity> elements.
 
Is there any way to do this in XSLT?  Perhaps this could be done by using some sort of scripting capability with JavaScript, VBScript, or ECMAScript as the language.

Examples which are much more complicated abound.  For example, calculating the wind chill based off the temperature and wind speed, finding the standard deviation of statistical measurements, or converting angular coordinates to rectangular coordinates.  If there isn't already some way to include scripting in the transformation process, I would strongly urge that it be added.

I haven't had much time to look closely at the recommendation.  So, if this feature is already in there, could you point me to what section it is in?

Thankfully, 

Michael
photius@cjnetworks.com
 
=====Begin source document=====
<order>
    <item name="widget" unit-price-in-dollars="5.00"/>
    <quantity number-of-items="5"/>
</order>
=====End source document=====

=====Begin result document=====
<TRANSACTION>
    <PART>
        <NAME>widget</NAME>
        <PRICE>$5.00</PRICE>
        <QUANTITY>5</QUANTITY>
    </PART>
 
    <SUB-TOTAL>$25.00</SUB-TOTAL>
 
    <!--Add 6% sales tax-->
    <GRAND-TOTAL>$26.50</GRAND-TOTAL>
</TRANSACTION>
=====End result document=====

Received on Wednesday, 27 October 1999 17:13:45 UTC