[xsl] [XSLT]: Recursive Function to Add/Multiply

Subject: [xsl] [XSLT]: Recursive Function to Add/Multiply
From: "Nuno Viana (Gmail)" <nuno.carlos.viana@xxxxxxxxx>
Date: Mon, 9 Oct 2006 10:24:09 +0200
Hi everybody,

I have the following XML file, which represents expressions with "+" and "*"

artihmentic operands:
<m value="10">
 <i value="5"/>
 <m value="10">
    <i value="2"/>
    <i value="2"/>
    <i value="2"/>
 </m>
</m>

This represents the following expression:

10 * (5 + (10 * (2 + 2 + 2)))

I want to compute the expression's value (for the given example, the
result should be 650).

Can anyone help me achieve this through a single recursive template?

Many thanks to you all!

Nuno

Current Thread