JAXP SAX: Difference between revisions
Jump to navigation
Jump to search
Line 8: | Line 8: | ||
=Overview= | =Overview= | ||
To use a SAX parser, use SAXParserFactory to generate a parser instance. Then call parsers's parse() method. The parser contains a SAXReader instance, which invokes callback methods the application must implement. The methods are defined by the ContentHandler, ErrorHandler, DTDHandler and EntityResolver interfaces. | |||
For a working example of SAX parsing, see [[SAX Example]] below. | |||
=SAX Example= | =SAX Example= |
Revision as of 20:32, 9 November 2016
External
Internal
Overview
To use a SAX parser, use SAXParserFactory to generate a parser instance. Then call parsers's parse() method. The parser contains a SAXReader instance, which invokes callback methods the application must implement. The methods are defined by the ContentHandler, ErrorHandler, DTDHandler and EntityResolver interfaces.
For a working example of SAX parsing, see SAX Example below.
SAX Example
Component Packages
- javax.xml.parsers
- org.xml.sax the basic SAX API.