
8
Alternative API: SAX
In the previous chapter, you learned how to use DOM, an object-based API
for XML parsers. This chapter complements the discussion on XML parsers
with an introduction to an event-based interface, SAX.
In this chapter, you learn how to use event-based interfaces. You will see
that these interfaces
• operate at a lower level than object-based interfaces
• give you more control than object-based interfaces
• are more efficient than object-based interfaces
• require more work than object-based interfaces
Why Another API?
✔ The “What Is a Parser?” section in Chapter 7, “The Parser and DOM” (page 191),
introduced you to XML parsers.
Parsers ...