One day this will have to happen... so I'm putting this here. It relates to a long-standing javarosa bug: https://bitbucket.org/javarosa/javarosa/wiki/XFormDeviations#!model-item-property-xpaths-are-always-evaluated-in-the-context-of-the-nodeset. Seems like pyxforms could take the lead in starting to do this correctly! It will avoid the 'position-injection' hack that is currently required for evaluating absolute paths inside repeats, improve performance significantly for some forms, and reduce code ugliness.
type | name | constraint
----------------------------------------------------------
begin_repeat | rep |
text | A |
text | B | ${A} = 'something'
end_repeat | |
${a} in this case should become "../A" instead of "/data/rep/A" because the absolute "/data/rep/A" in pure un-hacked XPath always returns the value of the A node in the first repeat (even if the context is the 100th repeat).
One day this will have to happen... so I'm putting this here. It relates to a long-standing javarosa bug: https://bitbucket.org/javarosa/javarosa/wiki/XFormDeviations#!model-item-property-xpaths-are-always-evaluated-in-the-context-of-the-nodeset. Seems like pyxforms could take the lead in starting to do this correctly! It will avoid the 'position-injection' hack that is currently required for evaluating absolute paths inside repeats, improve performance significantly for some forms, and reduce code ugliness.
${a} in this case should become "../A" instead of "/data/rep/A" because the absolute "/data/rep/A" in pure un-hacked XPath always returns the value of the A node in the first repeat (even if the context is the 100th repeat).