Hitachi

uCosminexus Application Server XML Processor User Guide


5.5.2 General Procedure for Creating the Sample Program

The following figure shows the general procedure for creating a sample program that uses the SAX parser.

Figure 5‒3: General procedure for creating a sample program that uses the SAX parser

[Figure]

  1. Create the callback handler.

    When parsing is started using the SAX parser, the information in the XML document is reported from the SAX parser. Create the callback handler to receive the information.

  2. Register the callback handler with the SAX parser.

    Register the callback handler you created in step 1 with the SAX parser.

  3. Pass the XML document to the SAX parser to parse it.

    Parse the XML document.

    Methods called by the SAX parser:

    The following diagram shows the methods called by the SAX parser:

[Figure]