Edgewall Software

genshi.input

(Not documented)

ParseError

Exception raised when fatal syntax errors are found in the input being parsed.

XMLParser

Generator-based XML parser based on roughly equivalent code in Kid/ElementTree.

The parsing is initiated by iterating over the parser object:

>>> parser = XMLParser(StringIO('<root id="2"><child>Foo</child></root>'))
>>> for kind, data, pos in parser:
...     print kind, data
START (u'root', [(u'id', u'2')])
START (u'child', [])
TEXT Foo
END child
END root

parse(self)

(Not documented)

XML(text)

(Not documented)

HTMLParser

Parser for HTML input based on the Python HTMLParser module.

This class provides the same interface for generating stream events as XMLParser, and attempts to automatically balance tags.

The parsing is initiated by iterating over the parser object:

>>> parser = HTMLParser(StringIO('<UL compact><LI>Foo</UL>'))
>>> for kind, data, pos in parser:
...     print kind, data
START (u'ul', [(u'compact', u'compact')])
START (u'li', [])
TEXT Foo
END li
END ul

parse(self)

(Not documented)

handle_starttag(self, tag, attrib)

(Not documented)

handle_endtag(self, tag)

(Not documented)

handle_data(self, text)

(Not documented)

handle_charref(self, name)

(Not documented)

handle_entityref(self, name)

(Not documented)

handle_pi(self, data)

(Not documented)

handle_comment(self, text)

(Not documented)

HTML(text, encoding='utf-8')

(Not documented)


See ApiDocs/0.3.x, Documentation

Last modified 8 years ago Last modified on Dec 10, 2015, 6:15:05 AM