The HTMLSerializer class is accessible via the kid module.
set(['compact', 'defer', 'checked', 'nohref', 'selected', 'ismap', 'disabled', 'noshade', 'noresize', 'multiple', 'nowrap', 'declare'])
set(['img', 'area', 'basefont', 'frame', 'isindex', 'meta', 'param', 'hr', 'base', 'link', 'br', 'input', 'col'])
set(['em', 'code', 'kbd', 'font', 'select', 'span', 'sub', 'img', 'bdo', 'label', 'basefont', 'dfn', 'sup', 'strike', 'input', 'samp', 'cite', 'acronym', 'big', 'var', 'abbr', 'br', 'strong', 'a', 'b', 'textarea', 'i', 'q', 's', 'u', 'small', 'tt'])
{'http://purl.org/atom/ns#': 'atom',
'http://purl.org/rss/1.0/': 'rss',
'http://www.w3.org/1999/02/22-rdf-syntax-ns#': 'rdf',
'http://www.w3.org/1999/xhtml': 'html',
'http://www.w3.org/XML/1998/namespace': 'xml'}
('HTML',
'-//W3C//DTD HTML 4.01 Transitional//EN',
'http://www.w3.org/TR/html4/loose.dtd')
Initialize HTMLSerializer.
You can change the following parameters:
encoding: the output encoding doctype: add doctype (None, string, tuple) transpose: alter tag names (None, True/False, callable) inject_type: inject content type (True/False) entity_map: use named entities for output (True/False or mapping) format: format to be applied (string or instance of Format)
See the source for more information.