FindNode method: XmlNode class
Syntax
FindNode(Path)
Description
Use the FindNode method to return a reference to an XmlNode.
The path is specified as the list of tag names, to the node that you want to find, each separated by a slash (/).
Parameters
| Parameter | Description |
|---|---|
|
Path |
Specify the tag names up to and including the name of the node that you want returned, starting with a slash and each separated by a slash (/). This is known as the XPath query language. |
Returns
An XmlNode matching the path if successful. If not successful, the IsNull property on the XmlNode is set to True.
Example
Suppose your XmlDoc has the following structure:
<?xml version="1.0"?>
<myroot>
<postreqresponse>
<candidate>
<user>
<location scenery="great" density="low" blank="eh?"/>
</user>
</candidate>
</postreqresponse>
</myroot>
You want to return a reference to the location attribute. Use the following Path to do it:
&XmlNode = &MyDoc.FindNode("/myroot/postreqresponse/candidate/user/location");