• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

DOM vs SAX

 
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 ??
 
Leverager of our synergies
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.
 
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.
 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!