SAX in a nutshell
- SAX is a protocol: It defines generic functions signifying events when walking over an XML document. Event is a fancy name for a function call.
- You handle SAX by defining CLOS methods for those events that you are interested in. Conversely, you generate SAX events by calling the functions.
- The first argument is always the SAX handler, usually an (indirect) instance of SAX:ABSTRACT-HANDLER.
Rough overview:
SAX:ABSTRACT-HANDLER | class |
SAX:START-ELEMENT (handler uri lname qname attrs) | generic function |
SAX:END-ELEMENT (handler uri lname qname) | generic function |
SAX:CHARACTERS (handler data-string) | generic function |