Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dom parser for XML file

 
fang eve
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a xml file format in the following format:

<parent>
<values>1</values>
<values>1</values>
<values>1</values>
<values>1</values>
<values>1</values>
<values>1</values>
</parent>

I would like to retrieve all the "values", value. How shld i do it? Thanks

my code is:


[ July 17, 2006: Message edited by: fang eve ]
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That code sort of looks right. Except that I don't think your getTextValue() method should be calling getElementsByTagName; that would cause it to look for "values" elements inside your "values" element. And you will want to use the actual element name ("values") that you are interested in, not something that is just similar to it ("Values").
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic