my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes Getting the value from an attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Getting the value from an attribute" Watch "Getting the value from an attribute" New topic
Author

Getting the value from an attribute

phillip nash
Greenhorn

Joined: Feb 08, 2011
Posts: 21
Hello. I'm starting out using XML within my java program. I've managed to retrieve all of my elements etc, but I dunno how I retrieve my groupNumber (in this case its 3). The structure of my XML file is below, I've omitted the employee data for brevity.



Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
When you have a "Group" Element, use the methods in org.w3c.dom.Element to manipulate attributes.

While you have the JavaDocs for the org.w3c.dom package open, study the Node Javadocs - there is a table which every XML programmer needs to be familiar with.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting the value from an attribute