Write Annotations

 

[This sample application uses features that were first implemented in MSXML 6.0.]

This sample application writes annotations to all types of objects: IXMLDOMDocument, IXMLDOMNode, IVBSAXContentHandler, and ISAXContentHandler. First, the code instantiates a schema cache object, a DOM Document object, and a Sax writer object. The DOM Schema Cache is used to store the XML Schema. The schema object is obtained by the getSchema method of the IXMLDOMSchemaCollection2 interface. The writeAnnotation method of the ISchemaItem interface creates the annotations in the separate objects. The documentElement and output properties echo the declaration text of the annotations that are created.

This topic is divided into the following sections.