Interface for reading an XML document using callbacks.
XMLReader is the interface that an XML parser's SAX2 driver must
implement. This interface allows an application to set and query features
and properties in the parser, to register event handlers for document
processing, and to initiate a document parse.
All SAX interfaces are assumed to be synchronous: the parse methods
must not return until parsing is complete, and readers must wait for an
event-handler callback to return before reporting the next event.
Method Summary |
|
__init__(self)
|
|
getContentHandler (self)
Returns the current ContentHandler. |
|
getDTDHandler (self)
Returns the current DTD handler. |
|
getEntityResolver (self)
Returns the current EntityResolver. |
|
getErrorHandler (self)
Returns the current ErrorHandler. |
|
getFeature (self,
name)
Looks up and returns the state of a SAX2 feature. |
|
getProperty (self,
name)
Looks up and returns the value of a SAX2 property. |
|
parse (self,
source)
Parse an XML document from a system identifier or an InputSource. |
|
setContentHandler (self,
handler)
Registers a new object to receive document content events. |
|
setDTDHandler (self,
handler)
Register an object to receive basic DTD-related events. |
|
setEntityResolver (self,
resolver)
Register an object to resolve external entities. |
|
setErrorHandler (self,
handler)
Register an object to receive error-message events. |
|
setFeature (self,
name,
state)
Sets the state of a SAX2 feature. |
|
setLocale (self,
locale)
Allow an application to set the locale for errors and warnings. |
|
setProperty (self,
name,
value)
Sets the value of a SAX2 property. |