Partager via


validateOnParse Property

 

Indicates whether the parser should validate this document.

Script Syntax

boolValue = oXMLDOMDocument.validateOnParse;  
objXMLDOMDocument.validateOnParse = boolValue;  

Example

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDoc.async = false;
xmlDoc.validateOnParse = true;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
   var myErr = xmlDoc.parseError;
   WScript.Echo("You have error " + myErr.reason);
}

Visual Basic Syntax

boolValue = oXMLDOMDocument.validateOnParse  
objXMLDOMDocument.validateOnParse = boolValue  

C/C++ Syntax

HRESULT get_validateOnParse(  
    VARIANT_BOOL *isValidating);  
HRESULT put_validateOnParse(  
    VARIANT_BOOL isValidating);  

Parameters

isValidating[out, retval][in]
If True, validates during parsing. If False, parses only for well-formed XML.

C/C++ Return Values

S_OK
The value returned if successful.

E_INVALIDARG (for get_validateOnParseonly)
The value returned if the isValidating parameter is Null.

Remarks

Boolean. The property is read/write. If True, it validates during parsing. If False, it parses only for well-formed XML. The default is True.

This member is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

Versioning

Implemented in:

MSXML 3.0, MSXML 6.0

Applies to

IXMLDOMDocument-DOMDocument