Section 1 - DOM / SAX
What this topic covers
Explain how DOM represents XML as a logical node tree and how SAX reports document events through callbacks. Account for their different access patterns and the lexical details DOM may not preserve.
Does a DOM tree keep the original quote marks and entity spelling?
No. DOM exposes a logical tree of nodes and does not guarantee that quote delimiters, entity-reference spelling, or original byte encoding survive parsing. Write code that depends only on element, attribute, and text values, not on how they were typed.