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

  • Home
  • SEARCH
  • 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 7014705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:33:22+00:00 2026-05-27T22:33:22+00:00

I am querying document in XOM, getting a Node, and then querying this Node

  • 0

I am querying document in XOM, getting a Node, and then querying this Node for another Node. However, querying Node behaves like it’s querying whole document, not only this node.

XML is like this:

<root>
  <someotherstuff>
    <DifferentNode>
      <Value1>different-value1</Value1>
    </DifferentNode>
    <Node>
      <Node>
        <Value1>value1</Value1>
        <Value2>value2</Value2>
      </Node>
      <Node>
        <Value1>value3</Value1>
        <Value2>value4</Value2>
      </Node>
      <!-- more Node's -->
    </Node>
  </someotherstuff>
</root>

And I’m doing this:

Nodes nodes = document.query("//Node/Node", X_PATH_CONTEXT);
Node node = nodes.get(0);

Nodes innerNodes = node.query("/Value1");

And innerNodes contains 0 children. When I change "/Value1" to "//Value1" (slash added) then I’m getting different-value1, so it looks like it’s querying whole document, instead of my selected Node.

How can I query specific Node in XOM?

  • 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-27T22:33:23+00:00Added an answer on May 27, 2026 at 10:33 pm

    When your query starts with a single slash then this looks for the document root node with the given name. Two slashes in contrast means to look for all ancestors of the given name. Your query should work if you simply omit the leading slash:

    Nodes innerNodes = node.query("Value1");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm querying a database like this: SELECT * from Log WHERE cookieId IN (select
This page shows a update reaching into a previously retrieved (find) document and querying
I am trying to create an html table by querying on an xml document.
I need to use YQL to query an XML document that contains only one
I'm querying Sharepoint server-side and getting back results as Xml. I want to slim
Querying a Nested Set Model table , here's the SQL... how can this be
I might not like it, but the number of unofficial Android devices is growing
I have an XML document of the form: <metadata> <item name=Name type=xs:string length=102/> <item
I have something that looks like the following document structure: public class Document {
I'd like to implement a filter/search feature in my application using Lucene. Querying Lucene

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.