• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DOM vs SAX

 
bhuvan gupta
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many XML parsers available.
Some of them use SAX and some DOM.
Which of these should be preferred ??
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neither DOM or SAX can be preferred on the base that �DOM is better� or �SAX is better�. Each has its own class of tasks it suits best, and they both should be used complimentary. For more details you can read this and this threads.
 
Rich Wardwell
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider that SAX is a low level parsing method where you have to do all the work whereas DOM is fairly high level and creates an object tree for you. DOM also can be used to output XML where SAX inherently does not.
Generally, most DOM parsers are written using a SAX parser. Download JAXP from Sun and try them both out.
 
Hema Menon
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This short description on SAX vs DOM might help
http://www.xml-zone.com/articles/sf020101/sf0201-2.asp

-Hema
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic