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 with Reporting Services 2008 r2. So here's my issue: We have 5 reports
Working with cakePHP this is my situation: I have Users and Order s. Order
Working with some basic java apps on CentOS 5 linux and I have my
Working in Visual Studio 2008 (C#)... I use a List collection to store instances
Working in the JBoss AS portlet we have been unable to open a jsp
Working in Xcode on Mac OS X Leopard in C++: I have the following
Working on a Online Test. I have 3 tables Questions Subject Topic I have
Working with SSRS and a SQL 2000 source, I have a stored procedure that

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.