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)
Starts the XML document.
source code
 
startElement(self, name, attrs={}, children=False)
Starts an XML element.
source code
 
endElement(self, name)
Ends and XML element of the given name.
source code
 
startParent(self, name, attrs={})
Starts an XML element which has children.
source code
 
endParent(self)
Ends an XML element with children.
source code
 
startParents(self, *names)
Starts XML elements without children.
source code
 
endParents(self, num)
Ends XML elements, according to the given number.
source code
 
simpleElement(self, name, content=None)
Creates 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: endElementNS, endPrefixMapping, ignorableWhitespace, processingInstruction, startElementNS, startPrefixMapping

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

Inherited from xml.sax.handler.ContentHandler: endDocument, 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 
Starts the XML document.
Overrides: xml.sax.handler.ContentHandler.startDocument

startElement(self, name, attrs={}, children=False)

source code 
Starts 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 
Ends and XML element of the given name.
Overrides: xml.sax.handler.ContentHandler.endElement

startParent(self, name, attrs={})

source code 
Starts 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)