Package xml :: Package sax :: Module expatreader :: Class ExpatParser
[hide private]
[frames] | no frames]

_ClassType ExpatParser

    xmlreader.XMLReader --+    
                          |    
xmlreader.IncrementalParser --+
                              |
          xmlreader.Locator --+
                              |
                             ExpatParser

SAX driver for the pyexpat C module.

Instance Methods [hide private]
 
__init__(self, namespaceHandling=0, bufsize=65516)
 
parse(self, source)
Parse an XML document from a URL or an InputSource.
 
prepareParser(self, source)
This method is called by the parse implementation to allow the SAX 2.0 driver to prepare itself for parsing.
 
setContentHandler(self, handler)
Registers a new object to receive document content events.
 
getFeature(self, name)
Looks up and returns the state of a SAX2 feature.
 
setFeature(self, name, state)
Sets the state of a SAX2 feature.
 
getProperty(self, name)
Looks up and returns the value of a SAX2 property.
 
setProperty(self, name, value)
Sets the value of a SAX2 property.
 
feed(self, data, isFinal=0)
This method gives the raw XML data in the data parameter to the parser and makes it parse the data, emitting the corresponding events.
 
close(self)
This method is called when the entire XML document has been passed to the parser through the feed method, to notify the parser that there are no more data.
 
_reset_cont_handler(self)
 
_reset_lex_handler_prop(self)
 
reset(self)
This method is called after close has been called to reset the parser so that it is ready to parse new documents.
 
getColumnNumber(self)
Return the column number where the current event ends.
 
getLineNumber(self)
Return the line number where the current event ends.
 
getPublicId(self)
Return the public identifier for the current event.
 
getSystemId(self)
Return the system identifier for the current event.
 
start_element(self, name, attrs)
 
end_element(self, name)
 
start_element_ns(self, name, attrs)
 
end_element_ns(self, name)
 
processing_instruction(self, target, data)
 
character_data(self, data)
 
start_namespace_decl(self, prefix, uri)
 
end_namespace_decl(self, prefix)
 
start_doctype_decl(self, name, sysid, pubid, has_internal_subset)
 
unparsed_entity_decl(self, name, base, sysid, pubid, notation_name)
 
notation_decl(self, name, base, sysid, pubid)
 
external_entity_ref(self, context, base, sysid, pubid)
 
skipped_entity_handler(self, name, is_pe)

Inherited from xmlreader.XMLReader: getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, setDTDHandler, setEntityResolver, setErrorHandler, setLocale

Method Details [hide private]

__init__(self, namespaceHandling=0, bufsize=65516)
(Constructor)

 
Overrides: xmlreader.XMLReader.__init__

parse(self, source)

 

Parse an XML document from a URL or an InputSource.

Overrides: xmlreader.XMLReader.parse

prepareParser(self, source)

 

This method is called by the parse implementation to allow the SAX 2.0 driver to prepare itself for parsing.

Overrides: xmlreader.IncrementalParser.prepareParser
(inherited documentation)

setContentHandler(self, handler)

 

Registers a new object to receive document content events.

Overrides: xmlreader.XMLReader.setContentHandler
(inherited documentation)

getFeature(self, name)

 

Looks up and returns the state of a SAX2 feature.

Overrides: xmlreader.XMLReader.getFeature
(inherited documentation)

setFeature(self, name, state)

 

Sets the state of a SAX2 feature.

Overrides: xmlreader.XMLReader.setFeature
(inherited documentation)

getProperty(self, name)

 

Looks up and returns the value of a SAX2 property.

Overrides: xmlreader.XMLReader.getProperty
(inherited documentation)

setProperty(self, name, value)

 

Sets the value of a SAX2 property.

Overrides: xmlreader.XMLReader.setProperty
(inherited documentation)

feed(self, data, isFinal=0)

 

This method gives the raw XML data in the data parameter to the parser and makes it parse the data, emitting the corresponding events. It is allowed for XML constructs to be split across several calls to feed.

feed may raise SAXException.

Overrides: xmlreader.IncrementalParser.feed
(inherited documentation)

close(self)

 

This method is called when the entire XML document has been passed to the parser through the feed method, to notify the parser that there are no more data. This allows the parser to do the final checks on the document and empty the internal data buffer.

The parser will not be ready to parse another document until the reset method has been called.

close may raise SAXException.

Overrides: xmlreader.IncrementalParser.close
(inherited documentation)

reset(self)

 

This method is called after close has been called to reset the parser so that it is ready to parse new documents. The results of calling parse or feed after close without calling reset are undefined.

Overrides: xmlreader.IncrementalParser.reset
(inherited documentation)

getColumnNumber(self)

 

Return the column number where the current event ends.

Overrides: xmlreader.Locator.getColumnNumber
(inherited documentation)

getLineNumber(self)

 

Return the line number where the current event ends.

Overrides: xmlreader.Locator.getLineNumber
(inherited documentation)

getPublicId(self)

 

Return the public identifier for the current event.

Overrides: xmlreader.Locator.getPublicId
(inherited documentation)

getSystemId(self)

 

Return the system identifier for the current event.

Overrides: xmlreader.Locator.getSystemId
(inherited documentation)