I have a xml structure like:
1481 test1 test2
This transformation doesn't require the use of any extension functions and doesn't produce an intermediary tree -- in fact it runs with 0 additional memory and is suitable for streaming, if the XSLT processor recognizes tail-recursion:
When it is applied on the provided XML document:
1481
test1
test2
+798.27
0741
test2
test2
+399.14
The wanted, correct result is produced:
1187.4099999999998