[Webinar] Streamline your web hosting managementRegister Today


Can JDOM and/or XPath find an element without starting from root?

Posted on 2008-02-08
Medium Priority
Last Modified: 2008-03-06
Dear Experts,

When using JDOM and/or XPath, is it always necessary to specify the path from the root?  Can I just say "Go get the <bob>...</bob> element--no matter where it is?  Instead of "Go get 'MyRoot/ThisNode/ThatNode/bob'".

I know that's a little funky, but I have good funky reasons for wanting to do it.

Question by:BrianMc1958
  • 2
LVL 60

Accepted Solution

Geert Bormans earned 2000 total points
ID: 20853633
use a "//" at the start of the expression
means from the root at any depth

so the XPath would be "//bob"

Author Comment

ID: 20853711
Hey!  It works!

Thanks a lot!
LVL 60

Expert Comment

by:Geert Bormans
ID: 20853724

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

640 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question