-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When indexed-repeat is used within a repeat the first argument nodeset points to single node using relative path #484
Comments
ping @pbowen-oc |
@pbowen-oc Working on it. |
Looks like the form posted here slips through the cracks: OpenClinica/enketo-express-oc#398 (comment) . See both (similar) indexed-repeat() calls. One of them is: |
@gushil - Can you take a look at this? |
@pbowen-oc working on it |
@MartijnR I've created a new PR (#499) to solve the issue @pbowen-oc mentioned. Thanks. |
Software and hardware versions
2.2.1
Problem description
The first argument of indexed-repeat() calls is relative when called from inside a repeat and referring to a question in that repeat. It should be absolute.
A
../relative/path/to/question
always returns a single node (in ODK XForms) and according to the spec it should refer to all nodes with that question name, i.e. the nodeset returned by/absolute/path/to/question
.Steps to reproduce the problem
A. using regular calculation with relative index:
outputs:
B. using dynamic default:
outputs:
C. using dreaded nested repeats:
outputs:
Expected behavior
A:
B:
C:
So the first argument of indexed-repeat() is an exception to the relative-path rule used to transform ${node} syntax (and the second argument too but that seems to already be the case).
Or actually since indexed-repeat() has either 3, 5, or 7 arguments, this exception applies to the 1st, 2nd, 4th, and 6th arguments.
Other information
Previously using indexed-repeat() inside a repeat was a bit of an edge case. Since the introduction of dynamic defaults it is becoming more common, as you could use the answer of a previous repeat question as the dynamic default of that same question in a new repeat instance (example B).
I'm guessing this issue was introduced in 0.12.0 when we changed to relative node references inside repeats.
The text was updated successfully, but these errors were encountered: