• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

parser

Difference between domparser and saxparser.

could you explain the mechanism include in domparser
0
Manikandan Thiagarajan
Asked:
Manikandan Thiagarajan
3 Solutions
 
Mayank SAssociate Director - Product EngineeringCommented:
A Sax parser will give you better performance than a DOM parser. DOM will load the entire object into memory and will give you easier API access/ control to the tree (adding/ removing nodes is simpler).
0
 
arun_kuttzCommented:
basically..

* The DOMParser parses an XML document and creates an inmemory Object representation for the whole XML as a DOM object.
whereas..
* The SAXParser reads the XML file and as it reads, as it reads, it searches for registered callback funtions (which are written by the user) so that as the parser encounters a particular tag/element etc. while reading, those corresponding callback functions are fired.

as u can see, DOM is more memory intensive, but its more flexible/easier to use..

-KuTtZ

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now