Scoped XMLDocument2 - getNode(String xPath)

Gets the node specified in the xpath.

Table 1. Parameters
Name Type Description
xPath String The xpath
Table 2. Returns
Type Description
XMLNode The current node.
var xmlString = "<test>" +
                "  <one>" +
                "    <two att=\"xxx\">abcd1234</two>" +
                "    <three boo=\"yah\" att=\"yyy\">1234abcd</three>" +
                "    <two>another</two>" +
                "  </one>" +
                "  <number>1234</number>" +
                "</test>";
var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(xmlString);
var node = xmlDoc.getNode("/test/one/two");
gs.info(node);
Output:
<two att="xxx">abcd1234</two>