Methods
|
|
|
|
__init__
|
__init__ ( self, verbose=0 )
- Interface
initialize and reset this instance
|
|
close
|
close ( self )
- Interface
handle the remaining data
|
|
feed
|
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
|
finish_endtag ( self, tag )
- Internal
finish processing of end tag
|
|
finish_starttag
|
finish_starttag (
self,
tag,
attrs,
)
- Internal
finish processing of start tag
Return -1 for unknown tag, 1 for balanced tag
|
|
goahead
|
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
|
handle_cdata ( self, data )
- Example
handle cdata, could be overridden
|
|
handle_charref
|
handle_charref ( self, name )
- Example
handle character reference, no need to override
|
|
handle_comment
|
handle_comment ( self, data )
- Example
handle comment, could be overridden
|
|
handle_data
|
handle_data ( self, data )
- Example
handle data, should be overridden
|
|
handle_doctype
|
handle_doctype (
self,
tag,
pubid,
syslit,
data,
)
- Overridable
handle DOCTYPE
|
|
handle_endtag
|
handle_endtag (
self,
tag,
method,
)
- Overridable
handle end tag
|
|
handle_entityref
|
handle_entityref ( self, name )
- Example
handle entity reference, no need to override
|
|
handle_proc
|
handle_proc (
self,
name,
data,
)
- Example
handle processing instructions, could be overridden
|
|
handle_starttag
|
handle_starttag (
self,
tag,
method,
attrs,
)
- Overridable
handle start tag
|
|
handle_xml
|
handle_xml (
self,
encoding,
standalone,
)
- Overridable
handle xml processing instruction
|
|
parse_attributes
|
parse_attributes (
self,
tag,
k,
j,
attributes=None,
)
- Internal
parse attributes between i and j
|
|
parse_cdata
|
parse_cdata ( self, i )
- Internal
handle CDATA tag, return length or -1 if not terminated
|
|
parse_comment
|
parse_comment ( self, i )
- Internal
parse comment, return length or -1 if not terminated
|
|
parse_doctype
|
parse_doctype ( self, res )
- Internal
handle DOCTYPE tag, return length or -1 if not terminated
|
|
parse_endtag
|
parse_endtag ( self, i )
- Internal
parse endtag
|
|
parse_proc
|
parse_proc ( self, i )
- Internal
handle a processing instruction tag
|
|
parse_starttag
|
parse_starttag ( self, i )
- Internal
handle starttag, return length or -1 if not terminated
|
|
reset
|
reset ( self )
- Interface
reset this instance. Loses all unprocessed data
|
|
setliteral
|
setliteral ( self, *args )
- For derived classes only
enter literal mode (CDATA)
|
|
setnomoretags
|
setnomoretags ( self )
- For derived classes only
enter literal mode (CDATA) till EOF
|
|
syntax_error
|
syntax_error ( self, message )
- Example
handle relatively harmless syntax errors, could be overridden
|
|
translate_references
|
translate_references (
self,
data,
all=1,
)
- Interface
translate references
|
|
unknown_charref
|
unknown_charref ( self, ref )
|
|
unknown_endtag
|
unknown_endtag ( self, tag )
|
|
unknown_entityref
|
unknown_entityref ( self, ref )
|
|
unknown_starttag
|
unknown_starttag (
self,
tag,
attrs,
)
- To be overridden
handlers for unknown objects
|