IXMLDOMDocument/DOMDocument Represents the top level of the XML source. Includes members for retrieving and creating all other XML objects.[Script] Example The following script examples demonstrate how to create the two types of objects.var objDoc = new ActiveXObject("Msxml2.DOMDocument.4.0"); var objFTDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0"); [Visual Basic] Example The following Microsoft® Visual Basic® examples demonstrate how to create the two types of objects.Dim objDoc As New Msxml2.DOMDocument40 Dim objFTDoc As New Msxml2.FreeThreadedDOMDocument40 [C/C++] Example The following C/C++ example creates DOMDocument and queries for the other interfaces.HRESULT hr; IXMLDOMDocument40 * pXMLDoc; IXMLDOMNode * pXDN; //... hr = CoInitialize(NULL); // Check the return value, hr... hr = CoCreateInstance(CLSID_DOMDocument40, NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument40, (void**)&pXMLDoc); // Check the return value, hr... hr = pXMLDoc->QueryInterface(IID_IXMLDOMNode, (void **)&pXDN); // Check the return value.
Represents the top level of the XML source. Includes members for retrieving and creating all other XML objects.[Script]
Example
The following script examples demonstrate how to create the two types of objects.var objDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var objFTDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0");
[Visual Basic]
Example
The following Microsoft® Visual Basic® examples demonstrate how to create the two types of objects.Dim objDoc As New Msxml2.DOMDocument40
Dim objFTDoc As New Msxml2.FreeThreadedDOMDocument40
[C/C++]
Example
The following C/C++ example creates DOMDocument and queries for the other interfaces.HRESULT hr;
IXMLDOMDocument40 * pXMLDoc;
IXMLDOMNode * pXDN;
//...
hr = CoInitialize(NULL);
// Check the return value, hr...
hr = CoCreateInstance(CLSID_DOMDocument40, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument40, (void**)&pXMLDoc);
// Check the return value, hr...
hr = pXMLDoc->QueryInterface(IID_IXMLDOMNode, (void **)&pXDN);
// Check the return value.