resolveExternals Property

MSXML 5.0 SDK

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

resolveExternals Property

Indicates whether external definitions, resolvable namespaces, document type definition (DTD) external subsets, and external entity references, are to be resolved at parse time, independent of validation.

[Script]

Script Syntax

boolValue = oXMLDOMDocument.resolveExternals;
objXMLDOMDocument.resolveExternals = boolVal;

Example

The following script example sets the resolveExternals property to false before loading a document.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
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.resolveExternals
objXMLDOMDocument.resolveExternals = boolVal;

Example

The following Microsoft® Visual Basic® example sets the resolveExternals property to false before loading a document.

Dim xmlDoc As New Msxml2.DOMDocument50
xmlDoc.async = False
xmlDoc.resolveExternals = False
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_resolveExternals(
    VARIANT_BOOL *isResolving);
HRESULT put_resolveExternals(
    VARIANT_BOOL isResolving);

Parameters

isResolving [out, retval][in]
True if external definitions are to be resolved at parse time; False otherwise. The default is True.

C/C++ Return Values

S_OK
The value returned if successful.
E_INVALIDARG (for get_resolveExternals only)
The value returned if the isResolving parameter is Null.

Remarks

Boolean. The property is read/write.

When the isResolving parameter is True, external definitions are resolved at parse time. This allows default attributes and data types to be defined on elements from the schema and allows use of the DTD as a file inclusion mechanism.

This setting is independent of whether validation is to be performed, as indicated by the value of the validateOnParse property. If externals cannot be resolved during validation, a validation error occurs. When the value of isResolving is False, externals are not resolved and validation is not performed.

A resolvable namespace is indicated by a namespace Universal Resource Identifier (URI) that begins with "x-schema:" as its prefix.

The default setting 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

validateOnParse Property

Applies to: DOMDocument