Added
A document-ingestion service handles XML files up to several gigabytes. A downstream audit requires the service to preserve the exact source formatting, including quote style, entity-reference spelling, and whitespace, while also exposing the complete document as a navigable tree. The team proposes DOM Level 2 Core because it represents the document as nodes and allows arbitrary navigation. The service has a strict memory ceiling and cannot retain a separate copy of the original bytes. Which design decision best addresses the requirements?
DOM exposes a logical tree of nodes; it does not guarantee preservation of lexical details such as quote delimiters, entity-reference spelling, or the original byte encoding. Exact source reproduction therefore requires retaining the original bytes separately, which conflicts with the stated memory ceiling and must be addressed as an architectural constraint. Namespace awareness does not add lexical preservation. SAX reports parsing events rather than retaining source token spelling, and entity-reference settings do not make DOM a lossless source archive.