Do SAX and DOM validating parsers take the same amount of memory while validating a document?
Created May 4, 2012
Frank Nestel If you only need to validate a document
and not do anything else with it,
SAX does it without actually taking memory for the document.
Just implement an empty handler which captures all SAX-events and ignores them.
All existing DOM parsers actually seem to be built on top of SAX parsers and a DOM is a very costly (but also valuable at times) data structure in memory. DOM comes in handy if you have to manipulate documents in memory.