title: How to get attribute value based on node value using xpath
body: <p>I am working on Orbeon forms and i have to use Xpath to retrieve attribute value. My scenario is as mentioned below.</p>
  
  <p>I have a xml node as below.</p>
  
  <pre><code>&lt;n&gt;
  &lt;node&gt;
  &lt;page id='1'&gt;true&lt;/page&gt;
  &lt;page id='2'&gt;false&lt;/page&gt;
  &lt;page id='3'&gt;true&lt;/page&gt;
  &lt;page id='4'&gt;true&lt;/page&gt;
  &lt;page id='5'&gt;false&lt;/page&gt;
  &lt;page id='6'&gt;true&lt;/page&gt;
  &lt;/node&gt;
  &lt;/n&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>I have tried something like the below, but i am not getting the expected result. </p>
  
  <pre><code>/n/node/page[@id&gt;"1" and .='true']/@id
  </code></pre>
  
  <p>Extending my question:</p>
  
  <p>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.</p>
  
  <p>Please help me.</p>