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 Syntax
domObj.setProperty(strProp, vBool); vBool = domObj.getProperty(strProp);
Visual Basic Syntax
domObj.setProperty(strProp, vBool) vBool = domObj.getProperty(strProp)
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 istrue
.
Remarks
The following rules apply for the validation:
- If an external schema cache is set, the DTD will not be used to validate the document.
- 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.
- 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