IMXWriter interface is a complementary application programming interface (API) to the latest version of the Simple API for XML (SAX2) implementation of Microsoft® XML Core Services (MSXML). MSXML provides two CoClasses that implement
|MXXMLWriter||Generates XML or DOM output.|
|MXHTMLWriter||Generates HTML output.|
The following can be set as output for
Any implementation of the
IStreaminterface. (The resulting document will be written into the provided
For more information about setting the
outputproperty to a
DOMDocumentobject, see Create a DOMDocument Object from SAX Events.
IMXWriter also enables you to:
control the output of a document by setting properties, such as
generate XML or HTML content by invoking methods of the
IMXWriterinterface implements the
ISAXLexicalHandlerinterfaces. However, to enable the writer to catch handler events passed by
SAXXMLReader, you must set the writeras the
ContentHandler, and, optionally, as any of the other handlers. For more information about how to set a writer as a handler, see Use MXXMLWriter.
Ideally, a writerconnected to
SAXXMLReader produces the same document as provided on the input. However, the writer may miss content deemed ignorable by XML 1.0 specifications or may output in a different encoding. For example, national encoding can be replaced with Unicode Transformation Format (UTF-8 or UTF-16). Replacing the encoding becomes useful if you use a custom
SAXXMLReader and the writer.
IMXWriter uses the generous input approach, which means it outputs what is entered. It is the responsibility of the application to ensure that SAX events and parameters match those of a well-formed or valid XML document.
|byteOrderMark||Determines whether to write the Byte Order Mark (BOM). The
|encoding||Sets and gets encoding for the output.|
|indent||Sets whether to indent output.|
|output||Sets the destination and the type of output for
|standalone||Sets the value of the
|version||Specifies the version to include in XML declarations.|
In addition to the preceding properties, the following method also applies to the
|flush||Flushes the object's internal buffer to its destination IStream/string. The
msxml3.dll, msxml2.lib (MSXML 3.0)
msxml6.dll, msxml6.lib (MSXML 6.0)
Header and LIB files: msxml2.h, msxml2.lib, msxml6.h, msxml6.lib
Implemented in: MSXML 3.0 and later