| |
- exceptions.RuntimeError(exceptions.StandardError)
-
- Error
- XMLParser
-
- TestXMLParser
class TestXMLParser(XMLParser) |
| |
Methods defined here:
- __init__(self, **kw)
- close(self)
- flush(self)
- handle_cdata(self, data)
- handle_comment(self, data)
- handle_data(self, data)
- handle_doctype(self, tag, pubid, syslit, data)
- handle_proc(self, name, data)
- handle_xml(self, encoding, standalone)
- syntax_error(self, message)
- unknown_charref(self, ref)
- unknown_endtag(self, tag)
- unknown_entityref(self, ref)
- unknown_starttag(self, tag, attrs)
Methods inherited from XMLParser:
- feed(self, data)
- # Interface -- feed some data to the parser. Call this as
# often as you want, with as little or as much text as you
# want (may include '\n'). (This just saves the text, all the
# processing is done by goahead().)
- finish_endtag(self, tag)
- # Internal -- finish processing of end tag
- finish_starttag(self, tagname, attrdict, method)
- # Internal -- finish processing of start tag
- getnamespace(self)
- # Interface - return a dictionary of all namespaces currently valid
- goahead(self, end)
- # Internal -- handle data as far as reasonable. May leave state
# and data to be processed by a subsequent call. If 'end' is
# true, force handling all data as if followed by EOF marker.
- handle_charref(self, name)
- # Example -- handle character reference, no need to override
- handle_endtag(self, tag, method)
- # Overridable -- handle end tag
- handle_starttag(self, tag, method, attrs)
- # Overridable -- handle start tag
- parse_attributes(self, tag, i, j)
- # Internal -- parse attributes between i and j
- parse_cdata(self, i)
- # Internal -- handle CDATA tag, return length or -1 if not terminated
- parse_comment(self, i)
- # Internal -- parse comment, return length or -1 if not terminated
- parse_doctype(self, res)
- # Internal -- handle DOCTYPE tag, return length or -1 if not terminated
- parse_endtag(self, i)
- # Internal -- parse endtag
- parse_proc(self, i)
- # Internal -- handle a processing instruction tag
- parse_starttag(self, i)
- # Internal -- handle starttag, return length or -1 if not terminated
- reset(self)
- # Interface -- reset this instance. Loses all unprocessed data
- setliteral(self, *args)
- # For derived classes only -- enter literal mode (CDATA)
- setnomoretags(self)
- # For derived classes only -- enter literal mode (CDATA) till EOF
- translate_references(self, data, all=1)
- # Interface -- translate references
Data and other attributes inherited from XMLParser:
- attributes = {}
- elements = {}
- entitydefs = {'amp': '&', 'apos': ''', 'gt': '>', 'lt': '<', 'quot': '"'}
|
class XMLParser |
| |
Methods defined here:
- __init__(self, **kw)
- # Interface -- initialize and reset this instance
- close(self)
- # Interface -- handle the remaining data
- feed(self, data)
- # Interface -- feed some data to the parser. Call this as
# often as you want, with as little or as much text as you
# want (may include '\n'). (This just saves the text, all the
# processing is done by goahead().)
- finish_endtag(self, tag)
- # Internal -- finish processing of end tag
- finish_starttag(self, tagname, attrdict, method)
- # Internal -- finish processing of start tag
- getnamespace(self)
- # Interface - return a dictionary of all namespaces currently valid
- goahead(self, end)
- # Internal -- handle data as far as reasonable. May leave state
# and data to be processed by a subsequent call. If 'end' is
# true, force handling all data as if followed by EOF marker.
- handle_cdata(self, data)
- # Example -- handle cdata, could be overridden
- handle_charref(self, name)
- # Example -- handle character reference, no need to override
- handle_comment(self, data)
- # Example -- handle comment, could be overridden
- handle_data(self, data)
- # Example -- handle data, should be overridden
- handle_doctype(self, tag, pubid, syslit, data)
- # Overridable -- handle DOCTYPE
- handle_endtag(self, tag, method)
- # Overridable -- handle end tag
- handle_proc(self, name, data)
- # Example -- handle processing instructions, could be overridden
- handle_starttag(self, tag, method, attrs)
- # Overridable -- handle start tag
- handle_xml(self, encoding, standalone)
- # Overridable -- handle xml processing instruction
- parse_attributes(self, tag, i, j)
- # Internal -- parse attributes between i and j
- parse_cdata(self, i)
- # Internal -- handle CDATA tag, return length or -1 if not terminated
- parse_comment(self, i)
- # Internal -- parse comment, return length or -1 if not terminated
- parse_doctype(self, res)
- # Internal -- handle DOCTYPE tag, return length or -1 if not terminated
- parse_endtag(self, i)
- # Internal -- parse endtag
- parse_proc(self, i)
- # Internal -- handle a processing instruction tag
- parse_starttag(self, i)
- # Internal -- handle starttag, return length or -1 if not terminated
- reset(self)
- # Interface -- reset this instance. Loses all unprocessed data
- setliteral(self, *args)
- # For derived classes only -- enter literal mode (CDATA)
- setnomoretags(self)
- # For derived classes only -- enter literal mode (CDATA) till EOF
- syntax_error(self, message)
- # Example -- handle relatively harmless syntax errors, could be overridden
- translate_references(self, data, all=1)
- # Interface -- translate references
- unknown_charref(self, ref)
- unknown_endtag(self, tag)
- unknown_entityref(self, name)
- unknown_starttag(self, tag, attrs)
- # To be overridden -- handlers for unknown objects
Data and other attributes defined here:
- attributes = {}
- elements = {}
- entitydefs = {'amp': '&', 'apos': ''', 'gt': '>', 'lt': '<', 'quot': '"'}
| |