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

Subject: [xsl] How to dynamically evaluate an equation in the input XML document?
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Jul 2021 18:48:18 -0000
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

Current Thread