Package Bio :: Package Entrez :: Module Parser :: Class DataHandler
[hide private]
[frames] | no frames]

Class DataHandler

source code

Instance Methods [hide private]
 
__init__(self, dtd_dir) source code
 
read(self, handle)
Set up the parser and let it parse the XML results
source code
 
parse(self, handle) source code
 
xmlDeclHandler(self, version, encoding, standalone) source code
 
startNamespaceDeclHandler(self, prefix, un) source code
 
startElementHandler(self, name, attrs) source code
 
endElementHandler(self, name) source code
 
characterDataHandler(self, content) source code
 
elementDecl(self, name, model)
This callback function is called for each element declaration: <!ELEMENT name (...)> encountered in a DTD.
source code
 
externalEntityRefHandler(self, context, base, systemId, publicId)
The purpose of this function is to load the DTD locally, instead of downloading it from the URL specified in the XML.
source code
Method Details [hide private]

elementDecl(self, name, model)

source code 

This callback function is called for each element declaration: <!ELEMENT name (...)> encountered in a DTD. The purpose of this function is to determine whether this element should be regarded as a string, integer, list dictionary, structure, or error.

externalEntityRefHandler(self, context, base, systemId, publicId)

source code 

The purpose of this function is to load the DTD locally, instead of downloading it from the URL specified in the XML. Using the local DTD results in much faster parsing. If the DTD is not found locally, we try to download it. In practice, this may fail though, if the XML relies on many interrelated DTDs. If new DTDs appear, putting them in Bio/Entrez/DTDs will allow the parser to see them.