Package backend :: Package satellite_tools :: Module xmlSource :: Class BaseDispatchHandler
[hide private]
[frames] | no frames]

Class BaseDispatchHandler

source code


Base class we use as a SAX parsing handler

We expect the meaningful data to be on the third level. The root element defines what the export contains, while the collection element defines what this collection contains

Instance Methods [hide private]
 
__init__(self) source code
 
restoreParser(self) source code
 
process(self, stream=None) source code
 
reset(self) source code
 
close(self) source code
 
clear(self) source code
 
set_container(self, obj) source code
 
get_container(self, name) source code
 
has_container(self, name) source code
 
setDocumentLocator(self, locator)
Called by the parser to give the application a locator for locating the origin of document events.
source code
 
startElement(self, name, attrs)
Signals the start of an element in non-namespace mode.
source code
 
characters(self, content)
Receive notification of character data.
source code
 
endElement(self, name)
Signals the end of an element in non-namespace mode.
source code
 
error(self, exception)
Handle a recoverable error.
source code
 
fatalError(self, exception)
Handle a non-recoverable error.
source code
 
warning(self, exception)
Handle a warning.
source code
 
_check_version(self) source code

Inherited from xml.sax.handler.ContentHandler: endDocument, endElementNS, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startElementNS, startPrefixMapping

Static Methods [hide private]
 
setStream(stream) source code
Class Variables [hide private]
  rootElement = None
hash(x)
  __stream = None
hash(x)
  container_dispatch = {}
Method Details [hide private]

__init__(self)
(Constructor)

source code 
Overrides: xml.sax.handler.ContentHandler.__init__

setDocumentLocator(self, locator)

source code 

Called by the parser to give the application a locator for locating the origin of document events.

SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the DocumentHandler interface.

The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.

Note that the locator will return correct information only during the invocation of the events in this interface. The application should not attempt to use it at any other time.

Overrides: xml.sax.handler.ContentHandler.setDocumentLocator
(inherited documentation)

startElement(self, name, attrs)

source code 

Signals the start of an element in non-namespace mode.

The name parameter contains the raw XML 1.0 name of the element type as a string and the attrs parameter holds an instance of the Attributes class containing the attributes of the element.

Overrides: xml.sax.handler.ContentHandler.startElement
(inherited documentation)

characters(self, content)

source code 

Receive notification of character data.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.

Overrides: xml.sax.handler.ContentHandler.characters
(inherited documentation)

endElement(self, name)

source code 

Signals the end of an element in non-namespace mode.

The name parameter contains the name of the element type, just as with the startElement event.

Overrides: xml.sax.handler.ContentHandler.endElement
(inherited documentation)

error(self, exception)

source code 

Handle a recoverable error.

Overrides: xml.sax.handler.ErrorHandler.error

fatalError(self, exception)

source code 

Handle a non-recoverable error.

Overrides: xml.sax.handler.ErrorHandler.fatalError

warning(self, exception)

source code 

Handle a warning.

Overrides: xml.sax.handler.ErrorHandler.warning