14.3. Using SAX
Now we'll look at using SAX to process a request for the Conference standings. The task to be performed is nearly identical to what must be done to process a request for the Division standings, but the implementation is quite different.
While DOM is based on having an in-memory representation of the entire document, and navigating around the tree, SAX is event-based, and deals with the document as it is being parsed. This has both advantages and drawbacks. One advantage is less memory use; DOM requires that the document fit in memory, and will fail if the entire document tree cannot be built in memory. However, once the DOM tree is built, you can navigate around it freely, moving back and forth, revisiting nodes, and so forth. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access