SAX programming depends on recognizing events that occur during the process of parsing an XML document.
In this section, you will use pseudocode to see what happens as an XML document is parsed using a SAX parser.
Listing 18.1 shows a short XML document that you will use to illustrate the SAX approach.
<?xml version='1.0'?> <?xml-stylesheet href="myCSS.css" type="text/css" ?> <!-- This is an XML comment. --> <myDocument> Some text content. </myDocument>
A SAX parser would respond to parsing an XML document like this by signaling events, similar to the following:
start_document; processing_instruction; start_element (<myDocument>); characters; end_element ...