This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Xml Parsing Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Xml Parsing Question" Watch "Xml Parsing Question" New topic
Author

Xml Parsing Question

John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
Hi I need to parse the following line out of this xml:
<PostagePrice TotalAmount="10.85">

I am able to use the below code to parse out other tags, however i cant figure out how to get the numeric value out of that particular tag
Any help would be appreciated

thanks
john



Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


John,



Check getAttributes() method for the Node will lead you to the value.


John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
Balu Sadhasivam wrote:
John,



Check getAttributes() method for the Node will lead you to the value.




Thanks, that did the trick

Solution below

 
 
subject: Xml Parsing Question