Home   Cover Cover Cover Cover
 

SAX versus DOM

question: Discuss the pros and contras of the SAX approach versus the DOM approach for reading XML data:

answer:

SAX:

+ The non-validating, serial access, forward-only processing of XML data is the fastest possibility to access XML resources.

+ With serial access XML parsing there exists no memory size limit for the XML resource.

- Only forward processing no return to elements that were already processed.

- Not practicable for XML editing and authoring.

DOM:

+ Practicable for XML editing and authoring.

+ After the XML representation was loaded, fast access to the elements is possible.

- Size of the XML document is limited to the available system memory.