xsl-list
[Top] [All Lists]

[xsl] How to dynamically evaluate an equation in the input XML document?

2021-07-14 13:48:26
Hi Folks,

I have XML documents like this:

<Convert-to-Celsius>
    <equation>(Fahrenheit - 32) * (5/9)</equation>
    <variable>
        <name>Fahrenheit</name>
        <value>32</value>
    </variable>
</Convert-to-Celsius>

The document contains an equation which might contain variables. If it does 
contain variables, then I need to fetch their values and replace the variables 
in the equation with their values and then compute the value of the equation.

Have you done this kind of dynamic equation solving using XSLT? If so, how did 
you do it? 

Any suggestions on how to approach this problem would be appreciated.

/Roger
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--


<Prev in Thread] Current Thread [Next in Thread>