This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi all friends, Iam new to XML I want to clear my some doubts how I can parse my xml file,I have created my own xml and dtd file.I have heard that there is only two ways of parsing xml file is it right ? if it is right then what are the two ways ? Another question is validation and parsing are same thing ? Thanks & Regards Bikash [ August 31, 2003: Message edited by: Bikash Paul ]
I am new to XML I want to clear my some doubts how I can parse my xml file,I have created my own xml and dtd file.I have heard that there is only two ways of parsing xml file is it right ? if it is right then what are the two ways ?
You're probably talking about SAX and DOM. SAX is an event-based approach to parsing (i.e. the XML parser sends your application events when encountering elements, attributes, text nodes, etc.) while DOM is a document-based approach (the XML parser builds a complete document object hierarchy for you to navigate and pick the info you need).
Another question is validation and parsing are same thing ?
No. Parsing is the act of transforming a character stream/file/string/whatever into an XML document while validation is the act of checking that the resulting document follows the structure it should follow (i.e. compare the XML document to its DTD document).
Hi, First of all thanks for your reply.Can I parse my xml file using java and DOM parser.Can you plz give me some help link so that I can take help from there.I want to parse my xml file using java and DOM parser. Thanks & Regards Bikash
The The Java Developers Almanac 1.4 is always a great source for examples. I do suggest however you first learn more about XML parsing before you proceed to parse you document using DOM. DOM aint easy. see XML Tutorial It might also want to look at JDom Good luck. [ September 01, 2003: Message edited by: Johannes de Jong ]
Joined: Jan 23, 2002
There is also a JSR for a pull-based Streaming API for XML. Take a look at this article about the differences of these three in the Oracle Technology Network.
Joined: Dec 04, 2001
Hi, Lots of thanks for all of ur's help. Thanks & Regards Bikash