Package Bio :: Package SearchIO :: Package BlastIO :: Module blast_xml :: Class _BlastXmlGenerator
[hide private]
[frames] | no frames]

Class _BlastXmlGenerator

source code

xml.sax.handler.ContentHandler --+    
                                 |    
     xml.sax.saxutils.XMLGenerator --+
                                     |
                                    _BlastXmlGenerator

Event-based XML Generator.
Instance Methods [hide private]
 
__init__(self, out, encoding='utf-8', indent=' ', increment=2) source code
 
startDocument(self)
Start the XML document.
source code
 
startElement(self, name, attrs=None, children=False)
Start an XML element.
source code
 
endElement(self, name)
End and XML element of the given name.
source code
 
startParent(self, name, attrs=None)
Start an XML element which has children.
source code
 
endParent(self)
End an XML element with children.
source code
 
startParents(self, *names)
Start XML elements without children.
source code
 
endParents(self, num)
End XML elements, according to the given number.
source code
 
simpleElement(self, name, content=None)
Create an XML element without children with the given content.
source code
 
characters(self, content)
Receive notification of character data.
source code

Inherited from xml.sax.saxutils.XMLGenerator: endDocument, endElementNS, endPrefixMapping, ignorableWhitespace, processingInstruction, startElementNS, startPrefixMapping

Inherited from xml.sax.saxutils.XMLGenerator (private): _qname

Inherited from xml.sax.handler.ContentHandler: setDocumentLocator, skippedEntity

Method Details [hide private]

__init__(self, out, encoding='utf-8', indent=' ', increment=2)
(Constructor)

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

startDocument(self)

source code 
Start the XML document.
Overrides: xml.sax.handler.ContentHandler.startDocument

startElement(self, name, attrs=None, children=False)

source code 
Start an XML element.
Parameters:
  • name (string) - element name
  • attrs (dictionary {string: object}) - element attributes
  • children (bool) - whether the element has children or not
Overrides: xml.sax.handler.ContentHandler.startElement

endElement(self, name)

source code 
End and XML element of the given name.
Overrides: xml.sax.handler.ContentHandler.endElement

startParent(self, name, attrs=None)

source code 
Start an XML element which has children.
Parameters:
  • name (string) - element name
  • attrs (dictionary {string: object}) - element attributes

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)