| Author |
iterate through string get elements
|
dale con
Ranch Hand
Joined: Apr 15, 2005
Posts: 93
|
|
hi all can someone please tell me how i convert a string to xml, so that i can iterate through it and grab the elements and their values e.g. if my string is this String xml = "<person><firstname>first</firstname><lastname>first</lastname></person>"; i want to iterate through to get the firstname and lastname elements and then get their vlaues thanks for any help
|
 |
Seb Mathe
Ranch Hand
Joined: Sep 28, 2005
Posts: 225
|
|
You can use XML parsers. Look at the javax.xml.parsers package.
|
Regards,<br />Seb<br /> <br />SCJP 1.4
|
 |
Naveen Vooka
Greenhorn
Joined: Oct 13, 2004
Posts: 25
|
|
Have a look at various XML parsers available http://www.devx.com/xml/Article/16921 http://xml.apache.org/xerces-j/ http://www.xml.com/pub/rg/Java_Parsers -------------- Naveen Vooka www.devsquare.com DevSquare - Online Application Development
|
 |
 |
|
|
subject: iterate through string get elements
|
|
|