Xpath with variable throws error
This valid Xpath 2.0 expression does not work in my .rtf template:
<?sum(for $i in (1 to 10) return $i)?>
(Tested to work in Altova XMLSpy). The problem seems to be $i. When running it in the application it shows just an empty field, but the template builder validate button throws this error:
[102717_153043636][][ERROR] [Line 5710.90] Incorrect XPath: sum(for $i in (1 to 10) return $i)
I can achieve the above with sum(1 to 10), but I'm not really looking for summing up a simple sequence, it is just a small example. What I'm really trying to achieve is to calculate a number with MOD10 check digit, and I created this oneliner to build the whole thing, that relies on for loop with variable. This works in XMLSpy: