简体   繁体   中英

MSXML problem in VC++ 6

I have this bit of code:

typedef CComQIPtr<MSXML::IXMLDOMDocument2> XML_DocumentPtr;

then inside some class:

XML_DocumentPtr m_spDoc;

then inside some function:

XML_NodePtr rn=m_spDoc->GetdocumentElement();

I cannot find anywhere in the MSDN documentation what that GetDocumentElement() is supposed to do? Can anyone tell me why it doesn't seem to be part of IXMLDOMDocument2 interface?

And which interface does have it?

IXMLDocument2 inherits from IXMLDocument . The GetDocumentElement() method is defined in that interface. See here .

Basically GetdocumentElement returns the root element of the XML document.

The property is read/write. It returns an IXMLDOMElement that represents the single element that represents the root of the XML document tree. It returns Null if no root exists.

When setting the documentElement property, the specified element node is inserted into the child list of the document after any document type node. To precisely place the node within the children of the document, call the insertBefore method of theIXMLDOMNode.

The parentNode property is reset to the document node as a result of this operation.

GetdocumentElement返回文档的根元素;如果不存在根,则返回NULL。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM