This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XPath for elements at the same level Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XPath for elements at the same level" Watch "XPath for elements at the same level" New topic
Author

XPath for elements at the same level

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Here is a portion of my XML...



Basically, there are many attribute definitions in the XML. Each has its own type.
I wish to pull out the value of displayvalue for specifc types...

//attributedefinition/[type='Alive']

Will get me the attributedefinition. But I was wondering is it possible to get the displayvalue all in one XPath expression?

Thanks.
Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Got it. POsting it here in case it is any use to anyone.
It's


Good tool here...
http://xmltoolbox.appspot.com/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XPath for elements at the same level
 
Similar Threads
nested iterate with parameterized getter
Applet-Servlet , AttributeValues does not work in browser
Match XML data value with the mysql database
Problem populating a newly created HashMap in a Struts2 Action
XML Parsing Issue