• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DOM vs SAX

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic