• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading XML Values

 
Raistlen Majere
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to retrieve all values from an xml no matter what the tag. Currently I have the code working for a normal xml:


The problem I am having is when I need to read the value of a tag in the following format:

<import resource="somecustomconfig.xml" />


I need to extract the "somecustomconfig.xml" and I can not get it to work. Is there a quick fix to this using my current code structure?
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for "beginning Java". Moving.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
element.getAttribtue(String name)?
 
Raistlen Majere
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
element.getAttribtue(String name)


The only problem is I will not know the contents of the xml, so I can not pass it name parameter.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're reading random XML?

public NamedNodeMap getAttributes()

Reading the API will help you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic