Package Bio :: Package Blast :: Module NCBIXML :: Class _XMLparser
[hide private]
[frames] | no frames]

Class _XMLparser

source code

xml.sax.handler.ContentHandler --+
                                 |
                                _XMLparser
Known Subclasses:

Generic SAX Parser

Just a very basic SAX parser.

Redefine the methods startElement, characters and endElement.

Instance Methods [hide private]
 
__init__(self, debug=0)
Constructor
source code
 
_secure_name(self, name)
Removes 'dangerous' from tag names
source code
 
startElement(self, name, attr)
Found XML start tag
source code
 
characters(self, ch)
Found some text
source code
 
endElement(self, name)
Found XML end tag
source code

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

Method Details [hide private]

__init__(self, debug=0)
(Constructor)

source code 
Constructor

debug - integer, amount of debug information to print

Overrides: xml.sax.handler.ContentHandler.__init__

_secure_name(self, name)

source code 
Removes 'dangerous' from tag names

name -- name to be 'secured'

startElement(self, name, attr)

source code 
Found XML start tag

No real need of attr, BLAST DTD doesn't use them

name -- name of the tag

attr -- tag attributes

Overrides: xml.sax.handler.ContentHandler.startElement

characters(self, ch)

source code 
Found some text

ch -- characters read

Overrides: xml.sax.handler.ContentHandler.characters

endElement(self, name)

source code 
Found XML end tag

name -- tag name

Overrides: xml.sax.handler.ContentHandler.endElement