Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6646645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:26:29+00:00 2026-05-26T00:26:29+00:00

I am working on Orbeon forms and i have to use Xpath to retrieve

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:26:30+00:00Added an answer on May 26, 2026 at 12:26 am

    I gather you would like to get the first page with @id higher than 1 and content equal to true. Then the following will do the trick:

    (/n/node/page[@id>"1" and .='true'])[1]/@id/string()
    

    Compared to what you had, picking the “first item that matches…” is done with (…)[1], and I use /string() at the end to get the value of the attribute. Depending on where you are using this expression, this won’t be necessary as the attribute will be converted to a string for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on Orbeon forms and i have a performance related issue as
Working on dom html . I want to convert node value to string: $html
Working on a project at the moment and we have to implement soft deletion
Working on a somewhat complex page for configuring customers at work. The setup is
Working on an extension that use the new experimental devtools apis. How do you
Working with an API where I need to send a value over in an
Working sample using one Table SELECT t.* FROM ( SELECT TITLE.name, (TITLE.value-TITLE.msp) AS Lower,
Working with a Lucene index, I have a standard document format that looks something
Working in Java: I have a JFrame class, and separate classes for my two
Working on game. I have a movable basket and a - for now -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.