July 2002
Intermediate to advanced
864 pages
22h 32m
English
Unlike the DOM, SAX is not an object model. A SAX parser represents a document using events initiated sequentially while parsing the document tags. For example, the portion of the XML document demonstrated in Listing 15.1 will translate into the following sequence of events:
startElement
characters
endElement
...
<my-element>
this is sample text
</my-element>
...
|
SAX is designed in such a way that it is very easy to use the API with different implementations of parsers. The only requirement is that parsers should implement a set of standard interfaces—otherwise, there is considerable freedom in implementing SAX-compliant parsers.
Currently, there are several implementations of SAX parsers ...