Name
XMLReader
Synopsis
This is the basic parser interface used in SAX 2. It provides methods to get and set the handler objects and a control variety of configurable options.
parse(source)Starts the parser working on the document in the entity identified by
source. The parameter may be a filename, a URL, or anInputSourceobject. TheInputSourceinterface is described later in this Appendix.getContentHandler( )Returns the currently configured content handler, or
Noneif there isn’t one.getDTDHandler( )Returns the currently configured DTD handler, or
Noneif there isn’t one.getEntityResolver( )Returns the currently configured entity resolver, or
Noneif there isn’t one.getErrorHandler( )Returns the currently configured error handler, or
Noneif there isn’t one.getFeature(name)Get the current Boolean value for the feature identified by
name. This method returnstrueif the feature is enabled, andfalseif it is disabled, or it raises theSAXNotRecognizedorSAXNotSupportedexception if name is not known or supported.getProperty(name)Returns the current value of the property identified by
name. This method returns whatever Python object is appropriate for the specific property; the application must be written to follow the rules associated with that property. If the specific property for which the value is requested is not known or supported by the parser, the appropriate subclass of theSAXExceptionis raised as an exception.setContentHandler(handler)Sets the content ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access