|
Java™ by example!
|
|
|
How do I get the attributes of a Node?
Use a NamedNodeMap. The following example shows you how to print out all elements for the tag customer. customer.xml (!!remove the space between ? and xml):
Main.java:
outputs:
To get a specific attribute, you can use the method getNamedItem. Main.java:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|