Scoped XMLDocument2 - getNodeText(String xPath)

Gets all the text child nodes from the node referenced in the xpath.

Table 1. Parameters
Name Type Description
xPath String the xpath.
Table 2. Returns
Type Description
XMLNode The text children in the xpath.
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); 
gs.info(xmlDoc.getNodeText("//two"));

Output: abcd1234