• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing xml file ??

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Lots of thanks for all of ur's help.
Thanks & Regards
Bikash
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic