Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting the value from an attribute

 
phillip nash
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic