Module sgmllib :: Class SGMLParser
[show private | hide private]
[frames | no frames]

Class SGMLParser

ParserBase --+
             |
            SGMLParser

Known Subclasses:
Stripper

Method Summary
  __init__(self, verbose)
Initialize and reset this instance.
  close(self)
Handle the remaining data.
  error(self, message)
  feed(self, data)
Feed some data to the parser.
  finish_endtag(self, tag)
  finish_shorttag(self, tag, data)
  finish_starttag(self, tag, attrs)
  get_starttag_text(self)
  goahead(self, end)
  handle_charref(self, name)
Handle character reference, no need to override.
  handle_comment(self, data)
  handle_data(self, data)
  handle_decl(self, decl)
  handle_endtag(self, tag, method)
  handle_entityref(self, name)
Handle entity references.
  handle_pi(self, data)
  handle_starttag(self, tag, method, attrs)
  parse_endtag(self, i)
  parse_pi(self, i)
  parse_starttag(self, i)
  report_unbalanced(self, tag)
  reset(self)
Reset this instance.
  setliteral(self, *args)
Enter literal mode (CDATA).
  setnomoretags(self)
Enter literal mode (CDATA) till EOF.
  unknown_charref(self, ref)
  unknown_endtag(self, tag)
  unknown_entityref(self, ref)
  unknown_starttag(self, tag, attrs)
    Inherited from ParserBase
  getpos(self)
Return current line number and offset.
  parse_comment(self, i, report)
  parse_declaration(self, i)
  parse_marked_section(self, i, report)
  unknown_decl(self, data)
  updatepos(self, i, j)

Class Variable Summary
dict entitydefs = {'amp': '&', 'lt': '<', 'gt': '>', 'apos': ...

Method Details

__init__(self, verbose=0)
(Constructor)

Initialize and reset this instance.
Overrides:
markupbase.ParserBase.__init__

close(self)

Handle the remaining data.

feed(self, data)

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 '
').  (This just saves the text,
        all the processing is done by goahead().)

handle_charref(self, name)

Handle character reference, no need to override.

handle_entityref(self, name)

Handle entity references.

There should be no need to override this method; it can be tailored by setting up the self.entitydefs mapping appropriately.

reset(self)

Reset this instance. Loses all unprocessed data.
Overrides:
markupbase.ParserBase.reset

setliteral(self, *args)

Enter literal mode (CDATA).

Intended for derived classes only.

setnomoretags(self)

Enter literal mode (CDATA) till EOF.

Intended for derived classes only.

Class Variable Details

entitydefs

Type:
dict
Value:
{'amp': '&', 'lt': '<', 'gt': '>', 'apos': "'", 'quot': '"'}           

Generated by Epydoc 2.1 on Tue Feb 7 21:43:57 2006 http://epydoc.sf.net