Java Tutorial - Java Scipt : DOM Parsing

Java Tutorial - Java Scipt :

DOM Parsing


DOM is the W3C standard for language-neutral object model for representing and working with XML. DOM represents XML as a treelike structure of objects. Working with DOM is more in line with the object-oriented programming design of Java, although it is still not as natural as some of the higherlevel XML tools because DOM objects represent documents rather than business objects.
Because DOM keeps the entire XML document in memory, it requires more resources than SAX. The benefit is that operations require less processing after the initial memory is allocated. Certain implementations use tricks such as
compact representations and deferred the parsing of subtrees to minimize the initial resource hit.

For situations that require heavy manipulation of the XML document, extensive querying, or XML schemas, DOM is better than SAX. Despite this, DOM is best viewed as a common denominator technology that is best used as
the basis for higher-level tools.