| Author |
how can i parse?
|
Suhas Madap
Ranch Hand
Joined: Aug 29, 2006
Posts: 49
|
|
Hi, How can i parse a XML which is in String i.e. String str="<?xml version="1.0" encoding="UTF-8"?> <book> <title>This is my first Xml program</title> <prod id="15-12" media="internet"></prod> <chapter>Introduction to XML <para>what is XML</para> <para>How to code XML</para> </chapter> <chapter>Intro to syntax <para>Elements of XML</para> <para>Attribute of XML</para> </chapter> </book>"; So which parser will be a good option, SAX or DOM?
|
Thank you,<br /> <br />Suhas K Madap<br /> <br />If you understand what you're doing, you're not learning anything."
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
To parse XML from a string, you do something like this:As for which parser to use, that depends on several things. Have you read any Java XML tutorials yet? Here's a link to one: http://java.sun.com/xml/tutorial_intro.html
|
 |
Suhas Madap
Ranch Hand
Joined: Aug 29, 2006
Posts: 49
|
|
|
ThanQ paul. this will help me. ThanQ once again.
|
 |
 |
|
|
subject: how can i parse?
|
|
|