XMLNodesCollection interface

Contains a collection of XML Document Object Model (DOM) nodes.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
<GuidAttribute("096CD6C1-0786-11D1-95FA-0080C78EE3BB")> _
Public Interface XMLNodesCollection _
    Inherits XMLNodes
'Usage
Dim instance As XMLNodesCollection
[GuidAttribute("096CD6C1-0786-11D1-95FA-0080C78EE3BB")]
public interface XMLNodesCollection : XMLNodes

Remarks

This type is a wrapper for a COM interface implemented by a coclass that is required by managed code for COM interoperability. To access the members specified by this interface, use the type that wraps the coclass that implements this interface. For information about that type, including usage, remarks, and examples, seeXMLNodes.

The XMLNodesCollection collection is a general-purpose collection that is used by a number of Microsoft Office InfoPath 2003 methods.

The XMLNodesCollection collection provides properties that can be used to access a collection of XML DOM nodes, and it is returned by both GetSelectedNodes and GetContextNodes methods.

After you have set a reference to one of the XML DOM node objects that the XMLNodesCollection collection contains, you can use any of the properties and methods that the XML DOM provides for interacting with an XML node object.

Examples

In the following example, a reference is set to a collection of XML DOM nodes returned by the GetSelectedNodes method of the ViewObject object. Then the code displays the name and source XML of the first node found in the collection using a message box:

XMLNodes selectedNodes;

selectedNodes = thisXDocument.View.GetSelectedNodes();

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

See also

Reference

XMLNodesCollection members

Microsoft.Office.Interop.InfoPath namespace