DOMParser - XML Parsing 2


In DOMParser everything is a node. A node has childNodes which might have childNodes. DOM Structure

I always find DOMParser a better choice when the whole xml files need to be loaded to a single object. When doing a lot of calculations on the xml use a SAXParser.

I will post in an example soon.

Use a SAXParser over a DOMParser.
Reason:
SAXParser gives better performance. SAX is faster!
DOMParser reads the whole XML File in the memory, if the file is big.. we might get Memory issues!


Comments

Popular posts from this blog

Writing your own ejabberd Module

npm ECONNREFUSED error

Conditional Flow - Spring Batch Part 6