Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SAX2 Reference

MXHTMLWriter CoClass

The MXHTMLWriter CoClass generates HTML output from Simple API for XML (SAX) events and handles many of the details of outputting content in HTML format. When connected to SAXXMLReader, and set as a ContentHandler, MXHTMLWriter accumulates content passed by events thrown by the reader. This content is stored in the output buffer of MXHTMLWriter. The MXXMLWriter CoClass implements the IMXWriter interface.

For MSXML 5.0, the version-dependent CoClass is MXHTMLWriter50, which uses the following programming class ID information:

(CLSID_MXHTMLWriter: 88d969c9-f192-11d4-a65f-0040963251e5)

Results generated by MXHTMLWriter are exposed through the MXHTMLWriter.output property. MXHTMLWriter provides several properties that enable you to modify the results generated by it. For example, to enable "pretty printing," set the MXHTMLWriter.indent property to True.

To enable MXHTMLWriter to catch handler events passed by SAXXMLReader, you must set MXHTMLWriter as the ContentHandler, and optionally as any of the other handlers. The following table shows the handler interfaces implemented by MXHTMLWriter.

Visual Basic Interfaces C++ Interfaces
IVBSAXContentHandler ISAXContentHandler
IVBSAXDeclHandler ISAXDeclHandler
IVBSAXDTDHandler ISAXDTDHandler
IVBSAXErrorHandler ISAXErrorHandler
IVBSAXLexicalHandler ISAXLexicalHandler

With MXHTMLWriter, HTML is output according to the HTML output method, as defined in the XSL Transformations (XSLT) Version 1.0 recommendation.

In general, MXHTMLWriter outputs HTML content like XML, with the following exceptions:

Properties

byteOrderMark Determines whether or not to write the Byte Order Mark (BOM).
disableOutputEscaping Determines whether disableOutputEscaping is on or off. When set to True, special symbols such as "&" are passed through literally.
encoding Sets encoding for the output.
indent Sets whether to indent output. Useful for "pretty printing."
omitXMLDeclaration Not supported by MXHTMLWriter.
output Sets the destination for the output generated by MXHTMLWriter.
standalone Not supported by MXHTMLWriter.
version Not supported by MXHTMLWriter.

Methods

flush Flushes the object's internal buffer to its destination IStream/string.

Requirements

[Visual Basic, C/C++]

Implementation: msxml5.dll, msxml2.lib

Header and LIB files: msxml2.h, msxml2.lib

To view reference material for Visual Basic or C++ only, click the Language Filter button Language Filter in the upper-left corner of the page.

Other Resources Other Resources

W3C XSL Transformations (XSLT) Version 1.0 Recommendation