Creating a DOMDocument Object

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Developer's Guide

Creating a DOMDocument Object

Before you can parse or create XML documents using the Document Object Model (DOM), you must create a DOMDocument object. After you have created that object, you can use it to load, parse, navigate, and manipulate XML files.

To create a new, empty DOMDocument object

Use the following Microsoft® JScript® code.

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

Use the following Microsoft Visual Basic® Scripting Edition (VBScript) code.

Dim xmldoc
Set xmldoc = CreateObject("Msxml2.DOMDocument.5.0")

Use the following Microsoft Visual Basic code.

Set xmldoc = New DOMDocument50

See Also

IXMLDOMDocument/DOMDocument