I am working on Orbeon forms and i have to use Xpath to retrieve attribute value. My scenario is as mentioned below.
I have a xml node as below.
<n>
<node>
<page id='1'>true</page>
<page id='2'>false</page>
<page id='3'>true</page>
<page id='4'>true</page>
<page id='5'>false</page>
<page id='6'>true</page>
</node>
</n>
Now when i pass any attribute value to xpath, it should return me the attribute value where it finds the next node having value 'true'. For example, if i pass id=1, then i should get the result as 3 since after , the next node having true is . Please note i must get only 3 and not 3,4 and 6.
I have tried something like the below, but i am not getting the expected result.
/n/node/page[@id>"1" and .='true']/@id
Extending my question:
Same case should apply if i give the last value and expect to have to next below attribute value having true. Example. If i give 6, xpath expression should give me 4. I dont mind if i have to use another xpath expression for this.
Please help me.