Considering this code example and this post
...
<xf:action>
<xf:setvalue
iterate="instance('fr-send-submission-params')/@*"
ref="."
value="event(name(context()))"/>
</xf:action>
...
How can refer to current iterated position? Like value="position()"
Can i use this position as variable to xpath expressions? Like ref="/AnotherElement[position()]"
The following works:
I don't think you can get away just with
xf:setvalue
, becauseref
changes the evaluation context of the expression to a single item which means thatposition()
returns1
withinvalue
.A warning as I see that you iterate on attributes: I don't think that attribute position is guaranteed to be consistent.
Update:
The following works if you have elements, but then you need to have knowledge of the items iterated within the
xf:setvalue
:So I think that the option with an enclosing action is much clearer.