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

validateOnParse Property

Indicates whether the parser should validate this document.

[Script]

Script Syntax

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

Example

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
xmlDoc.async = false;
xmlDoc.validateOnParse = true;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode <> 0) {
   var myErr = xmlDoc.parseError;
   alert("You have error " + myErr.reason);
}
[Visual Basic]

Visual Basic Syntax

boolValue = oXMLDOMDocument.validateOnParse
objXMLDOMDocument.validateOnParse = boolValue

Example

Dim xmlDoc As New Msxml2.DOMDocument50
xmlDoc.async = False
xmlDoc.validateOnParse = True
xmlDoc.Load "books.xml"
If (xmlDoc.parseError.errorCode <> 0) Then
   Dim myErr
   Set myErr = xmlDoc.parseError
   MsgBox("You have error " & myErr.reason)
End If
[C/C++]

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_validateOnParse only)
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).

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Applies to: DOMDocument