Loading an XML Schema for Use with the ISchema Interface

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SOM Developer's Guide

Loading an XML Schema for Use with the ISchema Interface

An XML Schema must be loaded into a schema cache before it is available to the SOM interfaces. The add method of the IXMLDOMSchemaCollection interface adds the XML Schema into a schema cache. The getSchema method of the IXMLDOMSchemaCollection2 interface returns a schema object to be used with the ISchema interface.

Example

The following Visual Basic example shows an XML Schema being loaded into a schema cache, then retrieved into a schema object.

Dim oSchemaCache As New XMLSchemaCache50
Dim oSchema as ISchema
Dim nsTarget as String
nsTarget = "http://www.samples.microsoft.com/sampletarget"
oSchemaCache.add nsTarget, PO.xsd
Set oSchema = oSchemaCache.getSchema(nsTarget)

See Also

Concepts