Represents an XML node in a tree in a document. The CustomXMLNode object is a member of the CustomXMLNodes collection.

Note
References to DTDs from custom XML parts are not supported. DTD references in custom XML parts will not resolve, and custom XML parts containing DTD references generate an exception when an attempt is made to save the file's content to a flat XML file.

Remarks

The CustomXMLNode object is designed to have funtional parity with the IXMLDOMNode interface. In addition, it contains an XPath property which is a great improvement over the objects provided by MSXML.

Example

The following example selects a single node from a CustomXMLPart object by using an XPath expression and assigns it to a CustomXMLNode object.

Visual Basic for Applications
Sub CustomXmlNodes() Dim cxp1 As CustomXMLPart Dim cxn As CustomXMLNode With ActiveDocument ' Returns the first custom xml part with the given root namespace. Set cxp1 = .CustomXMLParts("urn:invoice:namespace") ' Get the first node matching the XPath expression. Set cxn = cxp1.SelectSingleNode("//*[@quantity < 4]") End With End Sub

See also: