Xpath evaluation: type mismatch nodeset

I've designed and tested a form to collect member information. Now that
it's working, it's time to put it inside a repeating group so as I could
complete a roster.

Adding the first entry works fine but as soon as I hit the add group button
to add another, I get this error message:

XPath evaluation: type mismatch nodeset has more than one node
[/household/roster[1]/years_residing[1];/household/roster[2]/years_residing[1]]
cannot convert to value.

Could someone give me clues as to what's happening here?

What version of Collect are you using?

It is likely that your group/repeat nesting is a problem. Are you
hand-coding the form, or are you using Build or XLSForm?

If you are hand-coding the form, either work from a form generated from the
above two tools or look at one of the example forms with repeat groups to
see how to structure a repeat element.

Mitch

··· On Mon, Jul 16, 2012 at 12:45 AM, ゴー・ニコライ wrote:

I've designed and tested a form to collect member information. Now that
it's working, it's time to put it inside a repeating group so as I could
complete a roster.

Adding the first entry works fine but as soon as I hit the add group
button to add another, I get this error message:

XPath evaluation: type mismatch nodeset has more than one node
[/household/roster[1]/years_residing[1];/household/roster[2]/years_residing[1]]
cannot convert to value.

Could someone give me clues as to what's happening here?

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Hi Mitch. I'm using Collect 1.2 (1010) and XLSForm.

Yes, you're right it's a problem that involved a repeat and I just realized
that though the crash was happening while trying to fill in the repeat
loop, what's actually causing it is a reference to this variable in another
section of the form outside the loop

In my original version (without the repeat loop) this worked fine since
there was only once instance of the years_residing variable. Inside a
repeat loop, this has changed and I forgot to change the reference in the
other sections.

My question now is how do you reference the nth item in a repeat group?
Thanks.

··· On Tuesday, July 17, 2012, Mitch S wrote:

What version of Collect are you using?

It is likely that your group/repeat nesting is a problem. Are you
hand-coding the form, or are you using Build or XLSForm?

If you are hand-coding the form, either work from a form generated from
the above two tools or look at one of the example forms with repeat groups
to see how to structure a repeat element.

Mitch

On Mon, Jul 16, 2012 at 12:45 AM, ゴー・ニコライ <nikolai.go@gmail.com<javascript:_e({}, 'cvml', 'nikolai.go@gmail.com');> wrote:

I've designed and tested a form to collect member information. Now that
it's working, it's time to put it inside a repeating group so as I could
complete a roster.

Adding the first entry works fine but as soon as I hit the add group
button to add another, I get this error message:

XPath evaluation: type mismatch nodeset has more than one node
[/household/roster[1]/years_residing[1];/household/roster[2]/years_residing[1]]
cannot convert to value.

Could someone give me clues as to what's happening here?

--
Post: opendatakit@googlegroups.com <javascript:_e({}, 'cvml',
'opendatakit@googlegroups.com');>
Unsubscribe: opendatakit+unsubscribe@googlegroups.com <javascript:_e({},
'cvml', 'opendatakit%2Bunsubscribe@googlegroups.com');>
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com <javascript:_e({}, 'cvml',
'mitchellsundt@gmail.com');>

--
Post: opendatakit@googlegroups.com <javascript:_e({}, 'cvml',
'opendatakit@googlegroups.com');>
Unsubscribe: opendatakit+unsubscribe@googlegroups.com <javascript:_e({},
'cvml', 'opendatakit%2Bunsubscribe@googlegroups.com');>
Options: http://groups.google.com/group/opendatakit?hl=en

Perhaps someone with more form-writing experience can answer?

Mitch

··· On Mon, Jul 16, 2012 at 6:37 PM, ゴー・ニコライ wrote:

Hi Mitch. I'm using Collect 1.2 (1010) and XLSForm.

Yes, you're right it's a problem that involved a repeat and I just
realized that though the crash was happening while trying to fill in the
repeat loop, what's actually causing it is a reference to this variable in
another section of the form outside the loop

In my original version (without the repeat loop) this worked fine since
there was only once instance of the years_residing variable. Inside a
repeat loop, this has changed and I forgot to change the reference in the
other sections.

My question now is how do you reference the nth item in a repeat group?
Thanks.

On Tuesday, July 17, 2012, Mitch S wrote:

What version of Collect are you using?

It is likely that your group/repeat nesting is a problem. Are you
hand-coding the form, or are you using Build or XLSForm?

If you are hand-coding the form, either work from a form generated from
the above two tools or look at one of the example forms with repeat groups
to see how to structure a repeat element.

Mitch

On Mon, Jul 16, 2012 at 12:45 AM, ゴー・ニコライ nikolai.go@gmail.com wrote:

I've designed and tested a form to collect member information. Now that
it's working, it's time to put it inside a repeating group so as I could
complete a roster.

Adding the first entry works fine but as soon as I hit the add group
button to add another, I get this error message:

XPath evaluation: type mismatch nodeset has more than one node
[/household/roster[1]/years_residing[1];/household/roster[2]/years_residing[1]]
cannot convert to value.

Could someone give me clues as to what's happening here?

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

I think you will need to use an xpath expression for that. You can find
some examples of them here:
http://www.w3schools.com/xpath/xpath_examples.asp
In theory something like ../repeat_group_name/*[n] should work, however I'm
not not sure if javarosa supports the * or selection by index syntax, so it
might not work.
Best of luck,
-Nathan

Thanks Nathan. So far, this theory :wink: only responds with this error:
XPath evaluation: unsupported construct [predicates]

I've asked at the ODK developers mailing list perhaps someone will throw me
a bone there.

Will update this thread if I find anything new.

··· On Wednesday, July 18, 2012, Nathan wrote:

I think you will need to use an xpath expression for that. You can find
some examples of them here:
http://www.w3schools.com/xpath/xpath_examples.asp
In theory something like ../repeat_group_name/*[n] should work, however
I'm not not sure if javarosa supports the * or selection by index syntax,
so it might not work.
Best of luck,
-Nathan

--
Post: opendatakit@googlegroups.com <javascript:_e({}, 'cvml',
'opendatakit@googlegroups.com');>
Unsubscribe: opendatakit+unsubscribe@googlegroups.com <javascript:_e({},
'cvml', 'opendatakit%2Bunsubscribe@googlegroups.com');>
Options: http://groups.google.com/group/opendatakit?hl=en

I think it's been fixed. Please check the issues recently fixed on the ODK
code page.

··· On Wednesday, August 22, 2012, wrote:

Hi. :slight_smile:

Any updates on this? I am also having the same problem with repeating
questions where I have cascading select within the group. We have questions
on Migration where each household member (repeating question) is asked
about his/her previous residence (cascading select: province => town). No
problem with entering the data for the first member of the household.
However, when a group is added, meaning another household member is a added
to the repeating group, the cascading select returns the error: 'type
mismatch nodeset has more than one node' .... 'cannot convert to value.'

Many thanks!

Vinia

On Thursday, July 19, 2012 12:09:44 PM UTC+8, ニコノコ wrote:

Thanks Nathan. So far, this theory :wink: only responds with this error:

XPath evaluation: unsupported construct [predicates]

I've asked at the ODK developers mailing list perhaps someone will throw
me a bone there.

Will update this thread if I find anything new.
On Wednesday, July 18, 2012, Nathan wrote:

I think you will need to use an xpath expression for that. You can find
some examples of them here:
http://www.w3schools.com/xpath/xpath_examples.asp
In theory something like ../repeat_group_name/*[n] should work, however
I'm not not sure if javarosa supports the * or selection by index syntax,
so it might not work.

Best of luck,
-Nathan

--

Post: opendatakit@googlegroups.com <javascript:;>

Unsubscribe: opendatakit+unsubscribe@googlegroups.com <javascript:;>

Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com <javascript:;>
Unsubscribe: opendatakit+unsubscribe@googlegroups.com <javascript:;>
Options: http://groups.google.com/group/opendatakit?hl=en

This is unfortunately broken in Javarosa. Having looked into it, I think
there is a rather significant change required in that library to get this
to work.

Mitch

··· On Wed, Aug 22, 2012 at 2:50 AM, ゴー・ニコライ wrote:

I think it's been fixed. Please check the issues recently fixed on the ODK
code page.

On Wednesday, August 22, 2012, wrote:

Hi. :slight_smile:

Any updates on this? I am also having the same problem with repeating
questions where I have cascading select within the group. We have questions
on Migration where each household member (repeating question) is asked
about his/her previous residence (cascading select: province => town). No
problem with entering the data for the first member of the household.
However, when a group is added, meaning another household member is a added
to the repeating group, the cascading select returns the error: 'type
mismatch nodeset has more than one node' .... 'cannot convert to value.'

Many thanks!

Vinia

On Thursday, July 19, 2012 12:09:44 PM UTC+8, ニコノコ wrote:

Thanks Nathan. So far, this theory :wink: only responds with this error:

XPath evaluation: unsupported construct [predicates]

I've asked at the ODK developers mailing list perhaps someone will
throw me a bone there.

Will update this thread if I find anything new.
On Wednesday, July 18, 2012, Nathan wrote:

I think you will need to use an xpath expression for that. You can find
some examples of them here:
http://www.w3schools.com/xpath/xpath_examples.asp
In theory something like ../repeat_group_name/*[n] should work, however
I'm not not sure if javarosa supports the * or selection by index syntax,
so it might not work.

Best of luck,
-Nathan

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

It is actually in a private e-mail thread. Synopsis:

I have created a form, attached, that uses a data instance('choices') to
present 3 cascading select lists.

It is complicated by repeat groups. The last select needs to filter the
selection itemset by the value of its enclosing repeat group.

Note that the XPath expression I've used in the innermost question may be
overly complex. I am not an XPath expert and went through a half-dozen
expressions before coming up with this one.

PROBLEM: I believe the XPathNodeset and/or TreeReference in an XPath
expression are being prematurely resolved to an IAnswerData value.

If I write:

/form/path/element[self::node()=.]

I expect that 'self::node()' would resolve to an XPath node
(TreeReference), and '.' would resolve to an XPath node (TreeReference),
and that the '=' would test for equality of the two underlying FormIndex
structures. I.e., it wouldn't test for data value equality, but for a
matching element in the DOM. At it is, these appear to resolve down to
their values(??) and those are compared.

I think:

/form/path/element[self::text()=.]

would test for equality between the IAnswerData in the element and the
IAnswerData of the current node within the form (granted, you wouldn't
write it this way, but I wanted a parallel construction [NOTE: ::text() is
not supported by the JR parser]).

repeatingCascadingForm.xml (3.42 KB)

··· --------------------- Mitch

On Fri, Aug 31, 2012 at 8:46 PM, viniamarciano@gmail.com wrote:

Thank you for your response. However, I can't seem to find the thread that
provides the fix or solution. What key words should i use? I tried the
following keywords but didn't find the right thread: cascading nested group
error "type mismatch nodeset has more than one one".

How do I get to the right post?

Many thanks.

Vinia

On Wednesday, August 22, 2012 5:50:29 PM UTC+8, ニコノコ wrote:

I think it's been fixed. Please check the issues recently fixed on the
ODK code page.

On Wednesday, August 22, 2012, wrote:

Hi. :slight_smile:

Any updates on this? I am also having the same problem with repeating
questions where I have cascading select within the group. We have questions
on Migration where each household member (repeating question) is asked
about his/her previous residence (cascading select: province => town). No
problem with entering the data for the first member of the household.
However, when a group is added, meaning another household member is a added
to the repeating group, the cascading select returns the error: 'type
mismatch nodeset has more than one node' .... 'cannot convert to value.'

Many thanks!

Vinia

On Thursday, July 19, 2012 12:09:44 PM UTC+8, ニコノコ wrote:

Thanks Nathan. So far, this theory :wink: only responds with this error:

XPath evaluation: unsupported construct [predicates]

I've asked at the ODK developers mailing list perhaps someone will
throw me a bone there.

Will update this thread if I find anything new.

On Wednesday, July 18, 2012, Nathan wrote:

I think you will need to use an xpath expression for that. You can
find some examples of them here:

http://www.w3schools.com/xpath/xpath_examples.asp

In theory something like ../repeat_group_name/*[n] should work,
however I'm not not sure if javarosa supports the * or selection by index
syntax, so it might not work.

Best of luck,

-Nathan

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Hi Mitch!

Thanks for your reply. Howvever, this one's really quite complicated for
me. :slight_smile: But I really appreciate your assistance. I am sending a sample of
the xml file I'm working on to better explain my problem. It's when adding
a second record in a repeating group with cascading select where I get the
error.

Attaching a copy of the xml.

Thanks.

New Form 3.xml (96.1 KB)

··· On Wed, Sep 5, 2012 at 1:22 AM, Mitch S wrote:

It is actually in a private e-mail thread. Synopsis:

I have created a form, attached, that uses a data instance('choices') to
present 3 cascading select lists.

It is complicated by repeat groups. The last select needs to filter the
selection itemset by the value of its enclosing repeat group.

Note that the XPath expression I've used in the innermost question may be
overly complex. I am not an XPath expert and went through a half-dozen
expressions before coming up with this one.

PROBLEM: I believe the XPathNodeset and/or TreeReference in an XPath
expression are being prematurely resolved to an IAnswerData value.

If I write:

/form/path/element[self::node()=.]

I expect that 'self::node()' would resolve to an XPath node
(TreeReference), and '.' would resolve to an XPath node (TreeReference),
and that the '=' would test for equality of the two underlying FormIndex
structures. I.e., it wouldn't test for data value equality, but for a
matching element in the DOM. At it is, these appear to resolve down to
their values(??) and those are compared.

I think:

/form/path/element[self::text()=.]

would test for equality between the IAnswerData in the element and the
IAnswerData of the current node within the form (granted, you wouldn't
write it this way, but I wanted a parallel construction [NOTE: ::text() is
not supported by the JR parser]).


Mitch

On Fri, Aug 31, 2012 at 8:46 PM, viniamarciano@gmail.com wrote:

Thank you for your response. However, I can't seem to find the thread
that provides the fix or solution. What key words should i use? I tried the
following keywords but didn't find the right thread: cascading nested group
error "type mismatch nodeset has more than one one".

How do I get to the right post?

Many thanks.

Vinia

On Wednesday, August 22, 2012 5:50:29 PM UTC+8, ニコノコ wrote:

I think it's been fixed. Please check the issues recently fixed on the
ODK code page.

On Wednesday, August 22, 2012, wrote:

Hi. :slight_smile:

Any updates on this? I am also having the same problem with repeating
questions where I have cascading select within the group. We have questions
on Migration where each household member (repeating question) is asked
about his/her previous residence (cascading select: province => town). No
problem with entering the data for the first member of the household.
However, when a group is added, meaning another household member is a added
to the repeating group, the cascading select returns the error: 'type
mismatch nodeset has more than one node' .... 'cannot convert to value.'

Many thanks!

Vinia

On Thursday, July 19, 2012 12:09:44 PM UTC+8, ニコノコ wrote:

Thanks Nathan. So far, this theory :wink: only responds with this error:

XPath evaluation: unsupported construct [predicates]

I've asked at the ODK developers mailing list perhaps someone will
throw me a bone there.

Will update this thread if I find anything new.

On Wednesday, July 18, 2012, Nathan wrote:

I think you will need to use an xpath expression for that. You can
find some examples of them here:

http://www.w3schools.com/xpath/xpath_examples.asp

In theory something like ../repeat_group_name/*[n] should work,
however I'm not not sure if javarosa supports the * or selection by index
syntax, so it might not work.

Best of luck,

-Nathan

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

Yes, I believe this will run into the same issues as I had stated in the
earlier e-mail.

The second itemset restriction needs to reference the present value of
Province for that repeat element.

Unfortunately, /new_form3/A03/Province will return a set of values
beginning with the 2nd filled-out repeat group (because it matches and
returns all the Province matches in the form -- you need to restrict this
to the value in the current repeat group.

If things were working, you could do

...[@value=/new_form3/A03/MunCity[self::node()=.]/../Provice]...

But that is broken, per the earlier e-mail.

Right now, the only solution is to not do cascading selects within repeat
groups.

Mitch

··· On Fri, Nov 2, 2012 at 8:42 AM, Vinia Marciano wrote:

Hi Mitch!

Thanks for your reply. Howvever, this one's really quite complicated for
me. :slight_smile: But I really appreciate your assistance. I am sending a sample of
the xml file I'm working on to better explain my problem. It's when adding
a second record in a repeating group with cascading select where I get the
error.

Attaching a copy of the xml.

Thanks.

On Wed, Sep 5, 2012 at 1:22 AM, Mitch S mitchellsundt@gmail.com wrote:

It is actually in a private e-mail thread. Synopsis:

I have created a form, attached, that uses a data instance('choices') to
present 3 cascading select lists.

It is complicated by repeat groups. The last select needs to filter the
selection itemset by the value of its enclosing repeat group.

Note that the XPath expression I've used in the innermost question may be
overly complex. I am not an XPath expert and went through a half-dozen
expressions before coming up with this one.

PROBLEM: I believe the XPathNodeset and/or TreeReference in an XPath
expression are being prematurely resolved to an IAnswerData value.

If I write:

/form/path/element[self::node()=.]

I expect that 'self::node()' would resolve to an XPath node
(TreeReference), and '.' would resolve to an XPath node (TreeReference),
and that the '=' would test for equality of the two underlying FormIndex
structures. I.e., it wouldn't test for data value equality, but for a
matching element in the DOM. At it is, these appear to resolve down to
their values(??) and those are compared.

I think:

/form/path/element[self::text()=.]

would test for equality between the IAnswerData in the element and the
IAnswerData of the current node within the form (granted, you wouldn't
write it this way, but I wanted a parallel construction [NOTE: ::text() is
not supported by the JR parser]).


Mitch

On Fri, Aug 31, 2012 at 8:46 PM, viniamarciano@gmail.com wrote:

Thank you for your response. However, I can't seem to find the thread
that provides the fix or solution. What key words should i use? I tried the
following keywords but didn't find the right thread: cascading nested group
error "type mismatch nodeset has more than one one".

How do I get to the right post?

Many thanks.

Vinia

On Wednesday, August 22, 2012 5:50:29 PM UTC+8, ニコノコ wrote:

I think it's been fixed. Please check the issues recently fixed on the
ODK code page.

On Wednesday, August 22, 2012, wrote:

Hi. :slight_smile:

Any updates on this? I am also having the same problem with repeating
questions where I have cascading select within the group. We have questions
on Migration where each household member (repeating question) is asked
about his/her previous residence (cascading select: province => town). No
problem with entering the data for the first member of the household.
However, when a group is added, meaning another household member is a added
to the repeating group, the cascading select returns the error: 'type
mismatch nodeset has more than one node' .... 'cannot convert to value.'

Many thanks!

Vinia

On Thursday, July 19, 2012 12:09:44 PM UTC+8, ニコノコ wrote:

Thanks Nathan. So far, this theory :wink: only responds with this error:

XPath evaluation: unsupported construct [predicates]

I've asked at the ODK developers mailing list perhaps someone will
throw me a bone there.

Will update this thread if I find anything new.

On Wednesday, July 18, 2012, Nathan wrote:

I think you will need to use an xpath expression for that. You can
find some examples of them here:

http://www.w3schools.com/xpath/xpath_examples.asp

In theory something like ../repeat_group_name/*[n] should work,
however I'm not not sure if javarosa supports the * or selection by index
syntax, so it might not work.

Best of luck,

-Nathan

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Thank you so much for the quick response and for the detailed explanation.
Very much appreciated. Will try to redo our survey so we won't have to use
cascading select inside repeats.

Thanks again!

··· On Sat, Nov 3, 2012 at 12:53 AM, Mitch S wrote:

Yes, I believe this will run into the same issues as I had stated in the
earlier e-mail.

The second itemset restriction needs to reference the present value of
Province for that repeat element.

Unfortunately, /new_form3/A03/Province will return a set of values
beginning with the 2nd filled-out repeat group (because it matches and
returns all the Province matches in the form -- you need to restrict this
to the value in the current repeat group.

If things were working, you could do

...[@value=/new_form3/A03/MunCity[self::node()=.]/../Provice]...

But that is broken, per the earlier e-mail.

Right now, the only solution is to not do cascading selects within repeat
groups.

Mitch

On Fri, Nov 2, 2012 at 8:42 AM, Vinia Marciano viniamarciano@gmail.comwrote:

Hi Mitch!

Thanks for your reply. Howvever, this one's really quite complicated for
me. :slight_smile: But I really appreciate your assistance. I am sending a sample of
the xml file I'm working on to better explain my problem. It's when adding
a second record in a repeating group with cascading select where I get the
error.

Attaching a copy of the xml.

Thanks.

On Wed, Sep 5, 2012 at 1:22 AM, Mitch S mitchellsundt@gmail.com wrote:

It is actually in a private e-mail thread. Synopsis:

I have created a form, attached, that uses a data instance('choices') to
present 3 cascading select lists.

It is complicated by repeat groups. The last select needs to filter the
selection itemset by the value of its enclosing repeat group.

Note that the XPath expression I've used in the innermost question may
be overly complex. I am not an XPath expert and went through a half-dozen
expressions before coming up with this one.

PROBLEM: I believe the XPathNodeset and/or TreeReference in an XPath
expression are being prematurely resolved to an IAnswerData value.

If I write:

/form/path/element[self::node()=.]

I expect that 'self::node()' would resolve to an XPath node
(TreeReference), and '.' would resolve to an XPath node (TreeReference),
and that the '=' would test for equality of the two underlying FormIndex
structures. I.e., it wouldn't test for data value equality, but for a
matching element in the DOM. At it is, these appear to resolve down to
their values(??) and those are compared.

I think:

/form/path/element[self::text()=.]

would test for equality between the IAnswerData in the element and the
IAnswerData of the current node within the form (granted, you wouldn't
write it this way, but I wanted a parallel construction [NOTE: ::text() is
not supported by the JR parser]).


Mitch

On Fri, Aug 31, 2012 at 8:46 PM, viniamarciano@gmail.com wrote:

Thank you for your response. However, I can't seem to find the thread
that provides the fix or solution. What key words should i use? I tried the
following keywords but didn't find the right thread: cascading nested group
error "type mismatch nodeset has more than one one".

How do I get to the right post?

Many thanks.

Vinia

On Wednesday, August 22, 2012 5:50:29 PM UTC+8, ニコノコ wrote:

I think it's been fixed. Please check the issues recently fixed on
the ODK code page.

On Wednesday, August 22, 2012, wrote:

Hi. :slight_smile:

Any updates on this? I am also having the same problem with repeating
questions where I have cascading select within the group. We have questions
on Migration where each household member (repeating question) is asked
about his/her previous residence (cascading select: province => town). No
problem with entering the data for the first member of the household.
However, when a group is added, meaning another household member is a added
to the repeating group, the cascading select returns the error: 'type
mismatch nodeset has more than one node' .... 'cannot convert to value.'

Many thanks!

Vinia

On Thursday, July 19, 2012 12:09:44 PM UTC+8, ニコノコ wrote:

Thanks Nathan. So far, this theory :wink: only responds with this
error:

XPath evaluation: unsupported construct [predicates]

I've asked at the ODK developers mailing list perhaps someone will
throw me a bone there.

Will update this thread if I find anything new.

On Wednesday, July 18, 2012, Nathan wrote:

I think you will need to use an xpath expression for that. You can
find some examples of them here:

http://www.w3schools.com/xpath/xpath_examples.asp

In theory something like ../repeat_group_name/*[n] should work,
however I'm not not sure if javarosa supports the * or selection by index
syntax, so it might not work.

Best of luck,

-Nathan

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opendatakit@googlegroups.com

Unsubscribe: opendatakit+unsubscribe@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

Is there any progress on supporting cascading selects in repeating groups. I have a form that requires this functionality and cannot be easily remodelled.

Thanks

Ben

··· On Friday, November 2, 2012 9:35:15 PM UTC+4:30, vinia wrote: > Thank you so much for the quick response and for the detailed explanation. Very much appreciated. Will try to redo our survey so we won't have to use cascading select inside repeats. > > Thanks again! > > > > On Sat, Nov 3, 2012 at 12:53 AM, Mitch S wrote: > > Yes, I believe this will run into the same issues as I had stated in the earlier e-mail. > > The second itemset restriction needs to reference the present value of Province for that repeat element. > > Unfortunately, /new_form3/A03/Province will return a set of values beginning with the 2nd filled-out repeat group (because it matches and returns all the Province matches in the form -- you need to restrict this to the value in the current repeat group. > > > > If things were working, you could do > > ...[@value=/new_form3/A03/MunCity[self::node()=.]/../Provice]... > > But that is broken, per the earlier e-mail. > > Right now, the only solution is to not do cascading selects within repeat groups. > > > > Mitch > > > > > On Fri, Nov 2, 2012 at 8:42 AM, Vinia Marciano wrote: > > > Hi Mitch! > > Thanks for your reply. Howvever, this one's really quite complicated for me. :) But I really appreciate your assistance. I am sending a sample of the xml file I'm working on to better explain my problem. It's when adding a second record in a repeating group with cascading select where I get the error. > > > > > Attaching a copy of the xml. > > Thanks. > > > > > On Wed, Sep 5, 2012 at 1:22 AM, Mitch S wrote: > > > > It is actually in a private e-mail thread. Synopsis: > > I have created a form, attached, that uses a data instance('choices') to present 3 cascading select lists. > > > > > > It is complicated by repeat groups. The last select needs to filter > the selection itemset by the value of its enclosing repeat group. > > > > > Note that the XPath expression I've used in the innermost question may be overly complex. I am not an XPath expert and went through a half-dozen expressions before coming up with this one. > > > PROBLEM: I believe the XPathNodeset and/or TreeReference in an XPath expression are being prematurely resolved to an IAnswerData value. > > > If I write: > > > > /form/path/element[self::node()=.] > > > > > I expect that 'self::node()' would resolve to an XPath node > (TreeReference), and '.' > would resolve to an XPath node (TreeReference), and that the '=' would > test for > equality of the two underlying FormIndex structures. I.e., it wouldn't > test for data value equality, but for a matching element in the DOM. At > it is, these appear to resolve down to their values(??) and those are > compared. > > I think: > > /form/path/element[self::text()=.] > > would > test for equality between the IAnswerData in the element and the > IAnswerData of the current node within the form (granted, you wouldn't > write it this way, but I wanted a parallel construction [NOTE: ::text() is not supported by the JR parser]). > > > > --------------------- > Mitch > > > On Fri, Aug 31, 2012 at 8:46 PM, wrote: > > > > > > > > Thank you for your response. However, I can't seem to find the thread that provides the fix or solution. What key words should i use? I tried the following keywords but didn't find the right thread: cascading nested group error "type mismatch nodeset has more than one one". > > > > > > > > > > > How do I get to the right post? > > > > Many thanks. > > > > Vinia > > > > > > On Wednesday, August 22, 2012 5:50:29 PM UTC+8, ニコノコ wrote: > > > I think it's been fixed. Please check the issues recently fixed on the ODK code page. > > > > > > > > > > > > > > > On Wednesday, August 22, 2012, wrote: > > > > > > Hi. :) > > > > > > > > > > > > Any updates on this? I am also having the same problem with repeating questions where I have cascading select within the group. We have questions on Migration where each household member (repeating question) is asked about his/her previous residence (cascading select: province => town). No problem with entering the data for the first member of the household. However, when a group is added, meaning another household member is a added to the repeating group, the cascading select returns the error: 'type mismatch nodeset has more than one node' .... 'cannot convert to value.' > > > > > > > > > > > > > > > > > > > > > > Many thanks! > > > > > > > > > > > > Vinia > > > > > > > > > > > > > > > > > > > > > > > > On Thursday, July 19, 2012 12:09:44 PM UTC+8, ニコノコ wrote: > > > > > > > Thanks Nathan. So far, this theory ;-) only responds with this error: > > > > > > > > > > > > > > XPath evaluation: unsupported construct [predicates] > > > > > > > > > > > > > > > > > > > > > I've asked at the ODK developers mailing list perhaps someone will throw me a bone there. > > > > > > > > > > > > > > > > > > > > > > > > > > > > Will update this thread if I find anything new. > > > > > > > On Wednesday, July 18, 2012, Nathan wrote: > > > > > > > > > > > > > > I think you will need to use an xpath expression for that. You can find some examples of them here: > > > > > > > http://www.w3schools.com/xpath/xpath_examples.asp > > > > > > > In theory something like ../repeat_group_name/*[n] should work, however I'm not not sure if javarosa supports the * or selection by index syntax, so it might not work. > > > > > > > > > > > > > > Best of luck, > > > > > > > -Nathan > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > > > Post: opend...@googlegroups.com > > > > > > > > > > > > > > Unsubscribe: opendatakit...@googlegroups.com > > > > > > > > > > > > > > Options: http://groups.google.com/group/opendatakit?hl=en > > > > > > > > > > > > -- > > > > > > Post: opend...@googlegroups.com > > > > > > Unsubscribe: opendatakit...@googlegroups.com > > > > > > Options: http://groups.google.com/group/opendatakit?hl=en > > > > -- > > Post: opend...@googlegroups.com > > Unsubscribe: opendatakit...@googlegroups.com > > Options: http://groups.google.com/group/opendatakit?hl=en > > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com > > > > > > > > > -- > > Post: opend...@googlegroups.com > > Unsubscribe: opendatakit...@googlegroups.com > > Options: http://groups.google.com/group/opendatakit?hl=en > > > > > > > > -- > > Post: opend...@googlegroups.com > > Unsubscribe: opendatakit...@googlegroups.com > > Options: http://groups.google.com/group/opendatakit?hl=en > > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com > > > > > > -- > > Post: opend...@googlegroups.com > > Unsubscribe: opendatakit...@googlegroups.com > > Options: http://groups.google.com/group/opendatakit?hl=en

Hi Ben,

To be notified of updates, you can "star" the issue here:

https://code.google.com/p/opendatakit/issues/detail?id=886

Unfortunately, it hasn't been resolved yet.

Best,

Chris

··· On Sun, Aug 11, 2013 at 12:06 PM, wrote:

Is there any progress on supporting cascading selects in repeating groups.
I have a form that requires this functionality and cannot be easily
remodelled.

Thanks

Ben

On Friday, November 2, 2012 9:35:15 PM UTC+4:30, vinia wrote:

Thank you so much for the quick response and for the detailed
explanation. Very much appreciated. Will try to redo our survey so we won't
have to use cascading select inside repeats.

Thanks again!

On Sat, Nov 3, 2012 at 12:53 AM, Mitch S mitche...@gmail.com wrote:

Yes, I believe this will run into the same issues as I had stated in the
earlier e-mail.

The second itemset restriction needs to reference the present value of
Province for that repeat element.

Unfortunately, /new_form3/A03/Province will return a set of values
beginning with the 2nd filled-out repeat group (because it matches and
returns all the Province matches in the form -- you need to restrict this
to the value in the current repeat group.

If things were working, you could do

...[@value=/new_form3/A03/MunCity[self::node()=.]/../Provice]...

But that is broken, per the earlier e-mail.

Right now, the only solution is to not do cascading selects within
repeat groups.

Mitch

On Fri, Nov 2, 2012 at 8:42 AM, Vinia Marciano viniam...@gmail.com wrote:

Hi Mitch!

Thanks for your reply. Howvever, this one's really quite complicated for
me. :slight_smile: But I really appreciate your assistance. I am sending a sample of
the xml file I'm working on to better explain my problem. It's when adding
a second record in a repeating group with cascading select where I get the
error.

Attaching a copy of the xml.

Thanks.

On Wed, Sep 5, 2012 at 1:22 AM, Mitch S mitche...@gmail.com wrote:

It is actually in a private e-mail thread. Synopsis:

I have created a form, attached, that uses a data instance('choices') to
present 3 cascading select lists.

It is complicated by repeat groups. The last select needs to filter
the selection itemset by the value of its enclosing repeat group.

Note that the XPath expression I've used in the innermost question may
be overly complex. I am not an XPath expert and went through a half-dozen
expressions before coming up with this one.

PROBLEM: I believe the XPathNodeset and/or TreeReference in an XPath
expression are being prematurely resolved to an IAnswerData value.

If I write:

/form/path/element[self::node()=.]

I expect that 'self::node()' would resolve to an XPath node
(TreeReference), and '.'
would resolve to an XPath node (TreeReference), and that the '=' would
test for
equality of the two underlying FormIndex structures. I.e., it wouldn't
test for data value equality, but for a matching element in the DOM. At
it is, these appear to resolve down to their values(??) and those are
compared.

I think:

/form/path/element[self::text()=.]

would
test for equality between the IAnswerData in the element and the
IAnswerData of the current node within the form (granted, you wouldn't
write it this way, but I wanted a parallel construction [NOTE: ::text()
is not supported by the JR parser]).


Mitch

On Fri, Aug 31, 2012 at 8:46 PM, viniam...@gmail.com wrote:

Thank you for your response. However, I can't seem to find the thread
that provides the fix or solution. What key words should i use? I tried the
following keywords but didn't find the right thread: cascading nested group
error "type mismatch nodeset has more than one one".

How do I get to the right post?

Many thanks.

Vinia

On Wednesday, August 22, 2012 5:50:29 PM UTC+8, ニコノコ wrote:

I think it's been fixed. Please check the issues recently fixed on the
ODK code page.

On Wednesday, August 22, 2012, wrote:

Hi. :slight_smile:

Any updates on this? I am also having the same problem with repeating
questions where I have cascading select within the group. We have questions
on Migration where each household member (repeating question) is asked
about his/her previous residence (cascading select: province => town). No
problem with entering the data for the first member of the household.
However, when a group is added, meaning another household member is a added
to the repeating group, the cascading select returns the error: 'type
mismatch nodeset has more than one node' .... 'cannot convert to value.'

Many thanks!

Vinia

On Thursday, July 19, 2012 12:09:44 PM UTC+8, ニコノコ wrote:

Thanks Nathan. So far, this theory :wink: only responds with this error:

XPath evaluation: unsupported construct [predicates]

I've asked at the ODK developers mailing list perhaps someone will
throw me a bone there.

Will update this thread if I find anything new.

On Wednesday, July 18, 2012, Nathan wrote:

I think you will need to use an xpath expression for that. You can
find some examples of them here:

http://www.w3schools.com/xpath/xpath_examples.asp

In theory something like ../repeat_group_name/*[n] should work,
however I'm not not sure if javarosa supports the * or selection by index
syntax, so it might not work.

Best of luck,

-Nathan

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.