
Parser defines the following methods:
•
parse() starts parsing an XML document. There are two versions of
parse()—one accepts a filename or a URL, the other an InputSource
object (see section “InputSource”).
• setDocumentHandler(), setDTDHandler(), setEntityResolver(), and
setErrorHandler() allow the application to register event handlers.
• setLocale() requests error messages in a specific Locale.
ParserFactory
ParserFactory creates the parser object. It takes the class name for the
parser. For XML for Java, it is com.ibm.xml.parsers.SAXParser. To switch
to another parser, you can change one line and recompile:
protected static final String
PARSER_NAME ...