DOM vs. SAX

  • DOM is a better approach when an XML document is essentially an arbitrarily ordered collection of data – a database.

  • SAX is a better approach when an XML document is narrative-like – where both input and output to processing essentially have the same linear structure.

New Models for Processing Text and XML with Python Sam Wilmott
Slide 30 of 51        www.wilmott.ca