Generating SAX Events from a Text File
So far, you have learned how to parse an XML file and handle events generated by a SAX parser. In this section, you will learn how to use the SAX events to process a text file.
To understand how to use SAX events to process a text file, you must do the following:
Create a text file containing a hypothetical email message.
Create a SAX parser that generates callback events for each of the elements of the email message. The application implementing the SAX parser will handle the callback events.
Create the application that will use the SAX parser.
Let's look at each of these steps in detail.
Creating the SampleMailMessage.txt File
The first step is to create the text file containing the mail message. ...