W3C home > Mailing lists > Public > xsl-editors@w3.org > October to December 1999

Scripting capabilities and caclulated values

From: Dave & Chris Adams <photius@cjnetworks.com>
Date: Wed, 27 Oct 1999 16:10:20 -0500
Message-ID: <002901bf20c0$1b762340$de9e34ce@dell-xps-d333>
To: <xsl-editors@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:49 GMT