Thanks for the tip, but it actually only "kind of" works... The problem is that my A, B and C attributes are in a repeating block, and I'd like the expression box to display the value for the current element.
Imagine I have the following XML:
<root>
<element A="15" B="12" C="1024"/>
<element A="14" B="10" C="103582"/>
</root>
Assuming my formula is D = C / (2^(A-B)), I'd like to display (pardon the basic layouting !)
15 12 1024 128.0
14 10 103582 6473.875
With the above instructions and the following Xpath:
"@C div xdXDocument:GetDOM("Util")/PowersOfTwo/PowerOfTwo[position() = xdXDocument:get-DOM()/root/element/@A - xdXDocument:get-DOM()/root/element/@B]
the values in both expression boxes use the same A and B, but different C values. I somehow understand that as @C appears before we change contexts and start from the document root again. But that does not answer my needs :-(
Note that I've removed the my: prefix which Infopath says is unknown. I don't think that explains the problem, though...