VC中的MSXML问题++ 6

发布于 2024-09-04 03:37:17 字数 398 浏览 3 评论 0原文

我有这段代码:

typedef CComQIPtr<MSXML::IXMLDOMDocument2> XML_DocumentPtr;

然后在某个类中:

XML_DocumentPtr m_spDoc;

然后在某个函数中:

XML_NodePtr rn=m_spDoc->GetdocumentElement();

我在 MSDN 文档中找不到 GetDocumentElement() 应该做什么?谁能告诉我为什么它似乎不是 IXMLDOMDocument2 接口的一部分?

哪个接口有它?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

殊姿 2024-09-11 03:37:17

IXMLDocument2 继承自IXMLDocumentGetDocumentElement() 方法是在该接口中定义的。请参阅此处

基本上,GetdocumentElement 返回 XML 文档的根元素。

该属性是读/写的。它返回
表示的 IXMLDOMElement
代表的单个元素
XML 文档树的根。它
如果不存在根则返回 Null。

设置 documentElement 时
property,指定元素节点
被插入到子列表中
任何文档类型节点之后的文档。
精确地将节点放置在
该文档的子级,调用
IXMLDOMNode 的 insertBefore 方法。

parentNode 属性重置为
由此产生的文档节点
操作。

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.

染墨丶若流云 2024-09-11 03:37:17

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

GetdocumentElement returns the root element of the document or NULL if no root exists.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文