Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Finds schema documents during load.

Script Syntax

Copy Code
var objXMLDOMSchemaCollection = objIXMLDOMDocument2.schemas;
objXMLDOMDocument.schemas = objXMLDOMSchemaCollection;

Remarks

Script Parameters

None.

Script Return Value

Object. The schema collection that is returned. This is the same object that was previously set, or Null if none has been set.

C/C++ Syntax

Copy Code
HRESULT get_schemas(
  VARIANT* 
otherCollection
);
HRESULT putref_schemas(
  VARIANT 
otherCollection
);

Remarks

C/C++ Parameters

otherCollection

[out, retval][in] The schema collection that is returned. This is the same object that was previously set, or Null if none has been set.

C/C++ Return Values

S_OK

Value returned if the method executes successfully and a schema collection is set.

S_FALSE (for get_schemas only)

Value returned if no schema collection is set.

E_POINTER (for get_schemas only)

Value returned if pSchemaCollection= Null.

E_FAIL (for putref_schemas only)

Value returned if an IXMLSchemaCollectioninterface cannot be obtained from SchemaCollection with formatted IErrorInfo.

Null if no schema collection is currently set. You will always get the same collection object you put in.

Requirements

Header msxml2.h, msxml2.idl
Windows Embedded CE Windows CE .NET 4.0 and later

General Remarks

The schemasproperty provides a way of associating preloaded schemas with any namespace. It also provides a way to override the schemas that are used by the document you are about to load. Setting a new schema collection has no effect on the current document until the next loador loadXMLcall. The schemas loaded by the document during loaddo not automatically get added to this collection.

Setting any non-null schema collection automatically disables document type definition (DTD) processing because you cannot use both DTD and XML schema processing on the same document. This means DTDs will be ignored. Setting the schemas collection to Null re-enables DTD processing.

This property applies to the following objects and interfaces:

XMLSchemaCache/IXMLDOMSchemaCollection, and IXMLDOMDocument2.