Share via


Uncommented Code for the Write Annotations Application

 

[This sample code uses features that were only implemented in MSXML 6.0.]

Set oSchemaCache   = CreateObject("Msxml2.XMLSchemaCache.6.0")
Set oAnnotationDoc = CreateObject("Msxml2.DOMDocument.6.0")
Set writer         = CreateObject("Msxml2.MXXMLWriter.6.0")
writer.output=""

nsTarget="http://www.example.microsoft.com/po"
oSchemaCache.add nsTarget, "po3.xsd"
Set oSchema = oSchemaCache.getSchema(nsTarget)

oSchema.writeAnnotation(oAnnotationDoc)
WScript.Echo oAnnotationDoc.documentElement.xml

Set oAnnotationDoc.documentElement = oAnnotationDoc.createElement("root")
oSchema.writeAnnotation(oAnnotationDoc.documentElement)
WScript.Echo oAnnotationDoc.documentElement.xml

oSchema.writeAnnotation(writer)
WScript.Echo writer.output

Set ua = oSchema.types.itemByName("USAddress")
Set oAnnotationDoc.documentElement = oAnnotationDoc.createElement("root")
ua.writeAnnotation(oAnnotationDoc)
WScript.Echo oAnnotationDoc.documentElement.xml

ua.writeAnnotation(oAnnotationDoc.documentElement)
WScript.Echo oAnnotationDoc.documentElement.xml