Share via


Frequently Asked Questions about the SOM

 

[This topic discusses a feature was only implemented for MSXML 6.0.]

The following are some frequently asked questions about the SOM.

How do I get a schema object that I can query?

You obtain a schema object from a schema cache. The schema cache is created with the IXMLDOMSchemaCollection2 interface. For more information, see Loading a Schema for Use with the ISchema Interface, and the ISchema interface reference topic.

What is the schema cache used for?

The schema cache is an object created with the IXMLDOMSchemaCollection2 interface. The schema cache stores XML Schema documents according to an associated target namespace. The target namespace must be unique for each XML Schema in the cache.

The schema cache was designed to support two types of use. First, it was designed to improve performance through schema caching. This can significantly reduce the overhead when using external schemas for validation. Secondly, it can be used to override schemas referenced or included inline.

What schema version does the SOM use?

The SOM uses the XML Schema definition language (XSD) as its schema platform. The W3C recommendation for the XML Schema is found at http://www.w3.org/2001/XMLSchema\#intro. This recommendation includes a link to http://www.w3.org/2001/XMLSchema.xsd, the XML Schema that is used to validate XML Schema elements, attributes, and data types.

What does the W3C have to do with the SOM?

The SOM conforms to the W3C specifications, which are available at the Web site www.w3.org/TR/xmlschema-0/. SOM interfaces are created from the schema component definitions. For an example of the definitions for an element, see the specifications document, at URL http://www.w3.org/TR/xmlschema-1/\#Element\_Declaration\_details.

The rest of the definitions can be found throughout the specifications document.

How does the DOM work with the SOM?

The DOM has two methods that return a schema object. The first is the getDeclaration method of the IXMLDOMSchemaCollection2 interface. The second is the getSchema method of the IXMLDOMSchemaCollection2 interface. For more information, see Using the DOM with the SOM.

How does SAX work with the SOM?

SAX has two functions that return a schema object. The first is the schemaElementDecl method of the IMXSchemaDeclHandler interface. The second is the getTypeFromName method of the ISAXAttributes interface. For more information, see Using SAX with the SOM.

What is an item collection used for?

An item collection is used throughout the SOM for object storage. Many of the interface functions return item collections that contain an array of specific or mixed objects. The item collection is indexed, and begins with the index of zero. The objects returned in the collection implement their specified interface when they are queried individually. Use the itemType property of the ISchemaItem interface to get the type of the items in the collection.

ISchema Item Collection Interface

Does the SOM support the multi-thread apartment model?

Yes, the SOM does support the multi-thread apartment model. You can marshal between rental mode and free threaded model in your application.

Note

In MSXML, "free-threaded" means ThreadingModel='Both', and cross-thread marshalling is supported.

See Also

XML Schema Reference (XSD)