Receiving Events with SAX
The following are the building blocks of a typical SAX application.
- SAXXMLReader
SAXXMLReader
implements theISAXXMLReader
interface.SAXXMLReader
consumes the XML and throws events to the handlers that you set for the reader. First you create an instance ofSAXXMLReader
, and then set aContentHandler
and anErrorHandler
for receiving events from the reader.- IVBSAXContentHandler
- The
ContentHandlerImpl.cls
class implements theIVBSAXContentHandler
interface.IVBSAXContentHandler
catches events thrown by the reader. The main events are:startDocument
,endDocument
,startElement
,endElement
, andcharacters
. - IVBSAXErrorHandler
- The
ContentHandlerImpl.cls
class implements theIVBSAXErrorHandler
interface.IVBSAXErrorHandler
catches any errors raised during the read process. At this time, MSXML supports only thefatalError
method. - Application
- The application consists of code that typically creates an instance of the
SAXXMLReader
, sets the content handler and error handler for the reader, and then calls theparse
orparseURL
method of theSAXXMLReader
to process an XML file.
See Also
JumpStart for Creating a SAX2 Application with Visual Basic | JumpStart for Creating a SAX2 Application with C++ | Create a Simple Filter | IVBSAXXMLReader Interface | IMXWriter Interface | IVBSAXContentHandler Interface | IVBSAXDeclHandler Interface | IVBSAXDTDHandler Interface | IVBSAXErrorHandler Interface | IVBSAXLexicalHandler Interface | output Property