validate Method

Performs run-time validation on the currently loaded document using the currently loaded document type definition (DTD), schema, or schema collection.

objXMLDOMDocument2.validate();

HRESULT validate(
  IXMLDOMParseError** errorObj
);

General Remarks

This method only validates fully loaded documents (readyState == 4).

The validate method returns IXMLDOMParseError that is independent of the value returned by the parseError property on a document. Only the errorCode and reason properties of the returned value are set.

Unlike load, validate will fail if there is no DTD or schema applied to the document element. Therefore, validate will not be able tell you whether the document is just well-formed.

The validate method does not parse new schemas, but can import a schema from a SchemaCache associated with the document through the schemas property. If there is no schema for a given namespace, the elements in that namespace will not be validated.

This method applies to the following interface:

IXMLDOMDocument2.

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.