ValidateOnParse Property

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Reference

ValidateOnParse Property

[This feature was first implemented for MSXML 5.0.]

This property is used to specify whether the XML parser should validate (true) this document against document type definition (DTD), schema, or schema cache on loading.

[JScript]

JScript Syntax

domObj.setProperty(strProp, vBool);
vBool = domObj.getProperty(strProp);
[VisualĀ Basic]

Visual Basic Syntax

domObj.setProperty(strProp, vBool)
vBool = domObj.getProperty(strProp)
[C/C++]

C/C++ Syntax

HRESULT setProperty(BSTR strProp, VARIANT vBool);
HRESULT getProperty(BSTr strProp, VARIANT* vBool);

Value

strProp
A BSTR string whose value is "ValidateOnParse".
vBool
A VARIANT_BOOL value of true/false. The default value is true.

Remarks

The following rules apply for the validation:

  1. If an external schema cache is set, the DTD will not be used to validate the document.
  2. If an external schema cache is not set, and the document has a DTD, XSD, or XDR schema file, will not be used to validate the document.
  3. Mixing XSD and XDR validation outside external cache is not permitted.

ValidateOnParse is also a first-level property on an XML DOM with the same effect. Thus, the following JScript code fragments accomplish the same:

dom.setProperty("ValidateOnParse", true);

and

dom.validateOnParse = true;

The second-level properties of ValidateOnParse, ResolveExternals, UseInlineSchema, and NonValidatingSchemaUse all deal with validation of an XML document. Collectively, they influence the behavior of the parser in different ways. For more information see the Remarks section of the UseInlineSchema property.

Apply To

Component: MSXML 5.0 and later

Interface: IXMLDOMDocument2

Method: setProperty | getProperty

See Also

ResolveExternals | UseInlineSchema