Share via


XDocument.CreateDOM Method

InfoPath Developer Reference

Creates a new instance of the XML Document Object Model (DOM) in memory.

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.CreateDOM

expression   An expression that returns a XDocument object.

Return Value
[IXMLDOMDOCUMENT]

Remarks

Using the CreateDOM method to create an instance of the XML DOM is equivalent to using the following method of creating a Microsoft XML Core Services (MSXML) 5.0 DOMDocument object:

JScript
  var objDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");

Security Level 2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Example

In the following example, the CreateDOM method of the XDocument object is used to create an instance of XML DOM and assign it to a variable.

JScript
  var objDOM = XDocument.CreateDOM();

See Also