DOM is a platform- and language-neutral
API that allows programs and scripts to dynamically access and update the content, structure and style of
WWW documents (currently, definitions for
HTML and
XML documents are part of the specification). The document can be further processed and the results of that processing can be incorporated back into the presented page. DOM is a
Tree-based
API to documents, which requires the whole document to be represented in memory while processing it. A simpler alternative to DOM is the event-based
SAX, which can be used to process very large
XML documents that do not fit into the memory available for processing.