You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to find out the age of a person whose name is Joe. So essentially I need to zip two lists <NAMES> and <AGES> together, based on position(). I can't figure out a way to write this query:
Basically I want to get an <age> node whose position() equals the position() of a <name> node whose value is Joe. I have a strong assumption and guarantee that the numbers of elements in the <NAMES> and <AGES> lists are the same, so no need to worry about that.
The query doesn't work, the error basically says: has an invalid token.
Any insight/idea how to achieve this? Would really like to avoid doing the zip processing in code.
Thanks!!
The text was updated successfully, but these errors were encountered:
/root/AGES/age[position() = ../../NAMES/name[text() = 'Joe']/position()] expr is correct that shoud be able to work in antoher languages but not in xpath package.
Say I have a doc like this:
I want to find out the age of a person whose name is
Joe
. So essentially I need to zip two lists<NAMES>
and<AGES>
together, based onposition()
. I can't figure out a way to write this query:Basically I want to get an
<age>
node whoseposition()
equals theposition()
of a<name>
node whose value isJoe
. I have a strong assumption and guarantee that the numbers of elements in the<NAMES>
and<AGES>
lists are the same, so no need to worry about that.The query doesn't work, the error basically says:
has an invalid token.
Any insight/idea how to achieve this? Would really like to avoid doing the zip processing in code.
Thanks!!
The text was updated successfully, but these errors were encountered: