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


Difference between domparser and saxparser.

could you explain the mechanism include in domparser
Manikandan Thiagarajan
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).

* The DOMParser parses an XML document and creates an inmemory Object representation for the whole XML as a DOM object.
* 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..



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