Represents the top level of the XML source. Includes methods and properties used to obtain or create all other XML objects.
This object represents the top node in the tree. It implements all of the base DOM document methods and provides additional methods and properties that support XSL and XML transformations.
Although there are many programming objects, only one object can be created: the document. All other objects are accessed or created from the document.
The document can be created using either a free-threaded or a rental-threaded model. The behavior of the two models is identical; rental-threaded documents exhibit better performance because the parser doesn't need to manage concurrent access among threads. Note that you cannot combine nodes or documents that are created using differing threading models. The document threading model is determined by the following settings:
Setting | Rental-threaded model | Free-threaded model |
---|---|---|
Version independent ProgID | Msxml2.DOMDocument | Microsoft.FreeThreadedXMLDOM |
ProgID | Msxml2.DOMDocument.2.6 | Microsoft.FreeThreadedXMLDOM.2.6 |
ClassID | F6D90F11-9C73-11D3-B32E-00C04F990BB4 | F6D90F12-9C73-11D3-B32E-00C04F990BB4 |
VB Class Name | DOMDocument26 | FreeThreadedDOMDocument26 |
The following JScript examples demonstrate how to create the two types of objects:
var objDoc = new ActiveXObject("Msxml2.DOMDocument"); var objFTDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
The following VBScript examples demonstrate how to create the two types of objects:
Set objDoc = CreateObject("Msxml2.DOMDocument") Set objFTDoc = CreateObject("Msxml2.FreeThreadedDOMDocument")
Properties, Methods, and Events