Used by the schemas and namespaces properties on XMLDOMDocument2.
The SchemaCache object is free-threaded and can be used in multiple documents at the same time. A single schema document can belong to multiple schema collections and will remain read-only until it is removed from all collections. Schema documents belonging to a collection must be free-threaded.
You can create a SchemaCache object in JScript as follows:
var cache = new ActiveXObject("MSXML2.XMLSchemaCache");
Or in VBScript:
Dim cache Set cache = CreateObject("MSXML2.XMLSchemaCache");
The following example shows how to build a reusable schema cache:
var xmldoc = new ActiveXObject("MSXML2.DOMDocument"); xmldoc.async = false; xmdoc.load("http://myserver/mydata.xml");
var cache = new ActiveXObject("MSXML2.XMLSchemaCache"); cache.addCollection(xmldoc.namespaces);
var xmldoc2 = new ActiveXObject("MSXML2.DOMDocument"); xmldoc2.async = false; xmldoc2.schemas = cache; xmldoc2.load("http://myserver/newdata.xml");
"Xmldoc2" will load much faster because the schemas are cached.
Properties, Methods, and Events