Following relevant conditions seems not to work in current repeat group
question, question (/data/PeopleQuestion/perQues) always get skipped even
when age in earlier repeat group for the member is greater than 10:
Remember that whenever you use .. within a filter condition of an XPath, it
refers to the parent of the XPath node under consideration. So in
/data/People[position(..)], the .. refers to /data because it is evaluated
relative to the /data/People XPath expression.
To reference the current question's location, you need to refer to
current()/. And in this case, you want the group containing that question
to access the corresponding group in the earlier question, so you want
position(current()/..) -- using the .. to reference the group containing
the current question.
( Note that in the earlier question, the answer revealed a software bug
that required using current()/. instead of current()/.. for the evaluation
of the itemset. The correct answer should have been current()/.. , as it is
in this case )
Following relevant conditions seems not to work in current repeat group
question, question (/data/PeopleQuestion/perQues) always get skipped even
when age in earlier repeat group for the member is greater than 10:
Unfortunately this also doesn't work: (question never shows up for greater
than 10 age members)
/data/People[position(current()/..)]/Age > 10
I am also outputting value of current age of the member in a read-only
prompt like so:
And this one is always empty.
Thanks for the detailed answer and quick reply. Now i have checked with
both single (.) and (..) two dots and none of them work . I am also
trying my best to find what's preventing this to work properly.
So far it seems as if Age from earlier repeat is never returned in either
a) Relevant and b) *Calculate *part of the question, so the expression
(always) becomes:
'' > 10
This looked really simple and the general idea was that it should work.
After spending few days, i think i am out of ideas. I would highly
appreciate ideas/workarounds on this.
So far it seems as if Age from earlier repeat is never returned in either
a) Relevant and b) *Calculate *part of the question, so the expression
(always) becomes:
'' > 10
This looked really simple and the general idea was that it should work.
After spending few days, i think i am out of ideas. I would highly
appreciate ideas/workarounds on this.
I have some follow up questions on that, i saw some people quoting
solutions on these forums i.e.
/blah/blah[5]/foo
to similar problems, this however doesn't work in ODK as ODK is based on
Javarosa. Does this mean they are using custom version of Javarosa or some
other library?
Thanks once again, i really appreciate your help on this!
Enketo, I believe, is using a different XPath expression parser (it is all
in javascript), so it likely does not have all of the quirks that Javarosa
does.
But, in general, I have no idea. I am not aware of ODK variants that do not
use Javarosa.
···
On Sat, Nov 15, 2014 at 3:11 AM, Ayub wrote:
Thanks Mitch, this works just as required.
I have some follow up questions on that, i saw some people quoting
solutions on these forums i.e.
/blah/blah[5]/foo
to similar problems, this however doesn't work in ODK as ODK is based on
Javarosa. Does this mean they are using custom version of Javarosa or some
other library?
Thanks once again, i really appreciate your help on this!
Lets say I want to check if some selection was made earlier in a repeat
group by checking all (previous) positions for a question, what would the
constraint look like (I have tried the following)
This doesn't work:
constraint=". != /data/hhMembers[hhNameSel]"
This works but only checks the last position or a position before (as
expected):