2005-02-09 09:12:06

This module supports document serialization in HTML syntax.

Copyright 2005 Fourthought, Inc. (USA). Detailed license and copyright information: http://4suite.org/COPYRIGHT Project home, documentation, distributions: http://4suite.org/

An HtmlPrinter instance provides functions for serializing an XML or XML-like document to a stream, based on SAX-like event calls initiated by an instance of Ft.Xml.Lib.Print.PrintVisitor.

The methods in this subclass of XmlPrinter attempt to emit a document conformant to the HTML 4.01 syntax, with no extra whitespace added for visual formatting. The degree of correctness of the output depends on the data supplied in the event calls; no checks are done for conditions that would result in syntax errors, such as two attributes with the same name, "--" in a comment, etc.

Creates an HtmlPrinter instance.

stream must be a file-like object open for writing binary data. encoding specifies the encoding which is to be used for writing to the stream.

Handles an attribute event.

Extends the overridden method by writing boolean attributes in minimized form.

Handles a doctype event.

Extends the overridden method by adding support for the case when there is a publicId and no systemId, which is allowed in HTML but not in XML.

Handles an endElement event.

Differs from the overridden method in that an end tag is not generated for certain elements.

Handles a processingInstruction event.

Differs from the overridden method by writing the tag with no "?" at the end.

Handles a startDocument event.

Differs from the overridden method in that no XML declaration is written.

Handles a startElement event.

Extends the overridden method by disabling output escaping for the content of certain elements (SCRIPT and STYLE).

Handles a text event.

Extends the overridden method by disabling output escaping if in the content of certain elements like SCRIPT or STYLE.
<cEntityMap>
<cEntityMap>
{'checked': ['input'], 'compact': ['dl', 'ol', 'ul', 'dir', 'menu', 'li'], 'declare': ['object'], 'defer': ['script'], 'disabled': ['input', 'select', 'optgroup', 'option', 'textarea', 'button'], 'ismap': ['img', 'input'], 'multiple': ['select'], 'nohref': ['area'], 'noresize': ['frame'], 'noshade': ['hr'], ...}
{'area': True, 'base': True, 'basefont': True, 'br': True, 'col': True, 'frame': True, 'hr': True, 'img': True, 'input': True, 'isindex': True, ...}
{'script': True, 'style': True}
<cEntityMap>
{'action': ['form'], 'background': ['body'], 'cite': ['blockquote', 'del', 'ins', 'q'], 'classid': ['object'], 'codebase': ['applet', 'object'], 'data': ['object'], 'href': ['a', 'area', 'base', 'link'], 'longdesc': ['frame', 'iframe', 'img'], 'profile': ['head'], 'src': ['frame', 'iframe', 'img', 'input', 'script'], ...}
None