• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dom Versus sax

 
Yi Si
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?
 
Bernd Hennson
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.
 
Mudunuri Raju
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
 
Peer Reynders
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic