XML Reader

The XMLReader interface replaces the Parser interface. The parser must implement this interface, and the methods below are therefore guaranteed to be accessible to the application.

The following methods are unchanged from SAX 1.0, except for the name of one of them:

void  parse(InputSource src)
                 throws SAXException, IOException;
void  parse(String src)
                 throws SAXException, IOException;
void  setContentHandler(ContentHandler handler);
void  setDTDHandler(DTDHandler handler);
void  setEntityResolver(EntityResolver resolver);
void  setErrorHandler(ErrorHandler handler);

The following methods are new:

 void setFeature(String name, boolean value) throws SAXNotRecognisedException, SAXNotSupportedException; boolean getFeature(String name) throws ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.