XMLNodesCollection 接口

定义

包含由 XML 文档对象模型 (DOM) 节点组成的集合。

public interface class XMLNodesCollection : Microsoft::Office::Interop::InfoPath::SemiTrust::XMLNodes
[System.Runtime.InteropServices.Guid("096cd6c1-0786-11d1-95fa-0080c78ee3bb")]
public interface XMLNodesCollection : Microsoft.Office.Interop.InfoPath.SemiTrust.XMLNodes
type XMLNodesCollection = interface
    interface XMLNodes
Public Interface XMLNodesCollection
Implements XMLNodes
属性
实现

示例

在以下示例中,将引用设置为 对象的 GetSelectedNodes 方法返回的 XML DOM 节点集合 ViewObject 。 然后代码使用消息框显示在集合中找到的第一个节点的名称和源 XML:

<span class="label">XMLNodes</span> selectedNodes;

selectedNodes = thisXDocument.View.GetSelectedNodes();

if (selectedNodes.Count &gt; 0)
{
 thisXDocument.UI.Alert(selectedNodes[0].nodeName + "\n\n" + selectedNodes[0].text);
}

注解

此类型是用于 Coclass(托管代码需要此 Coclass 来实现 COM 互操作性)的包装。 使用此类型来访问由此 Coclass 实现的 COM 接口。 有关 COM 接口的信息(包括指向其成员说明的链接),请参阅XMLNodes

XMLNodesCollection 集合是许多 Microsoft InfoPath 方法使用的常规用途集合。

XMLNodesCollection 集合提供可用于访问 XML DOM 节点集合的属性,并且由 GetSelectedNodes()GetContextNodes(Object, Object) 方法返回。

在设置了对 XMLNodesCollection 集合包含的某个 XML DOM 节点对象的引用之后,可以使用 XML DOM 所提供的用于与 XML 节点进行交互的任何属性和方法。

属性

Count

获取集合中包含的 XML 文档对象模型 (DOM) 节点对象数的 XMLNodesCollection 计数。

(继承自 XMLNodes)
Item[Object]

XMLNodesCollection 集合中获取对指定 XML 文档对象模型的引用 (DOM) 节点。

(继承自 XMLNodes)

方法

GetEnumerator()

获取一个循环访问对象中所有条目的 XMLNodesCollectionIEnumerator

(继承自 XMLNodes)

适用于