Published 19 January 1999
|Revision 0.3||27 December 1998|
|Revision 0.4||31 December 1998|
|Small change in how to specify a SAX driver file|
|Revision 0.5||19 January 1999|
|Several changes suggested by Lars M. Garshol|
I give a short overview of the Simple API for XML (SAX). I describe how a SAX-compliant parser and a SAX application interact, and how one should proceed to write a SAX application. The description focuses on the Python implementation of SAX. The examples are written in Python.
Write DocumentHandler, DTDHandler, EntityResolver, and ErrorHandler classes.
Select a SAX-compliant parser. E.g.,
Register the handlers with the parser. E.g.,
Run the parser by calling its parse method. E.g.,
Watch the result, which is completely determined by the handlers of your application.
|Scheme of the interaction between an application and an XML parser|