validateOnLoad Property


Indicates whether the schema will be compiled and validated when it is loaded into the schema cache. The validateOnLoad Property must be set to false before any schemas that are not to be validated are loaded into the schema cache.

Set oSchemaCache = CreateObject("Msxml2.XMLSchemaCache.6.0")
Set oAnnotationDoc = CreateObject("Msxml2.DOMDocument.6.0")

' Load the schema.

' Setting validateOnLoad to true is optional; true is the default value.
oSchemaCache.validateOnLoad = true 
oSchemaCache.add "urn1", schema1 ' Validated on add.
oSchemaCache.add "urn2", schema2 ' Validated on add.
oSchemaCache.validateOnLoad = false
oSchemaCache.add "urn3", schema3 ' Not validated yet.
oSchemaCache.add "urn4", schema4 ' Not validated yet.
' Schema3 and schema4 are validated now. Schema1 and schema2 are not validated now, because they already were.


bolValidate = objXMLSchemaCache.validate;  
objXMLSchemaCache.validate = boolTrueFalse;  

bolValidate = objXMLSchemaCache.validate  
objXMLSchemaCache.validate = boolTrueFalse  

HRESULT get_validateOnLoad(  
    VARIANT_BOOL *validate);  
HRESULT put_validateOnLoad(  
    VARIANT_BOOL validate);  


validate[out, retval][in]
If True, the schema is validated when added to the schema cache. If False, the schema is not validated until the validate method is called.

C/C++ Return Values


Implemented in:

MSXML 3.0, MSXML 6.0


validate Method (IXMLDOMSchemaCollection2-XMLDOMSchemaCollection)