File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XPath Doubt. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XPath Doubt." Watch "XPath Doubt." New topic
Author

XPath Doubt.

Jose Mon
Ranch Hand

Joined: Feb 13, 2007
Posts: 30
Hi,
I had many tags like

<ingredient name="vanilla extract" amount="1" unit="teaspoon"/>

Also I had Xpath expression like

//ingredient[@name="flour"]/@amount

to show the amount of ingredient name="flour".

But I need to get 2 attributes.
ie I need to get amount and unit too. What is the solution for this?


Thanks in Advance.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18126
    
    8

Two XPath expressions.
 
wood burning stoves
 
subject: XPath Doubt.
 
Similar Threads
JSTL and xml
A little help with my first program
Liking Spam
Understanding the DAO Pattern
JavaFx XML file read