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.
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)