3.8 Parser

The Parser interface is the basic interface for SAX (Simple API for XML) parsers.

All SAX parsers must implement this basic interface; it allows applications to register handlers for different types of events and to initiate a parse from a URI, or a character stream.

All SAX parsers must also implement a zero-argument constructor (though other constructors are also allowed).

SAX parsers are reusable but not re-entrant; the application may reuse a parser object (possibly with a different input source) once the first parse has completed successfully, but it may not invoke the parse() methods recursively within a parse.

The SAX Parser interface is useful for any reporting of XML structure events. For example, this interface can convert a DOM tree to a series of SAX events.

This specification extends the Java org.xml.sax.DocumentHandler with the following methods:

    int enableExceptions (int enable);