Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

dom Versus sax

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody give some suggestion about when we should dom and when we should use sax in best practic?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess it's about the nature of the data you're expressing in xml. if you've got document centered xml data - DOM means document object model - such as atricles and books you would generally refer to DOM. if your data can be easily presented as a tree, you'd also pick DOM, because it makes tree traversal easier.
If your data is small and structured and can be easily transformed into java objects, you'd pick SAX.
remember DOM will build up a tree representation of your xml and keep it in memory, beware of huge documents and memory exhaustion.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please read the Chapter 4 of Blue prints - XML Processing.

You can find very good explanation.

-- Srinivas
SCJP, SCJD, SCEA-1, SCBCD, SCDJWS, Weblogic 7.0
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Designing Web Services with the J2EETM 1.4 Platform: 4 XML Processing
Blueprints PDF version

Also see the last post of need help with document based web services for a quick summary.
 
Yi Si
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks every body.

I will read blueprint chapter4 ,I think it should be very helpful.
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic