Scoped XMLNode - getTextContent()

Gets the text content of the current node. The text content of a node consists of all the node's child text nodes

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
String The text content of 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('//one/two');
gs.info(node.getTextContent());

Output: abcd1234