XML Dom
XML Dom
The DOM defines a standard for accessing documents like XML and HTML:
"The W3C Document Object Model (DOM) is a platform and language-neutral interface
that allows programs and scripts to dynamically access and update the content, structure,
and style of a document."
The DOM defines the objects and properties of all document elements, and the
methods (interface) to access them.
The XML DOM defines the objects and properties of all XML elements, and the
methods (interface) to access them.
In other words: The XML DOM is a standard for how to get, change, add, or delete
XML elements.
SAX
SAX (Simple API for XML) is a sequential access parser API for XML. SAX provides a
mechanism for reading data from an XML document. It is a popular alternative to the
Document Object Model (DOM).
A parser which implements SAX (ie, a SAX Parser) functions as a stream parser, with an
event-driven API. The user defines a number of callback methods that will be called
when events occur during parsing. The SAX events include:
Events are fired when each of these XML features are encountered, and again when the
end of them is encountered. XML attributes are provided as part of the data passed to
element events.
SAX parsing is unidirectional; previously parsed data cannot be re-read without starting
the parsing operation again.