Returns the character data of the first XML element matching a path. This function calls select-nodes with node and path and returns the character data for the first element. See select-nodes for more about path.
<population>
<pack id="1">
<name>Scar</name>
<name>Notch</name>
</pack>
<pack id="2">
<leader>Rex</leader>
<name>Spotty</name>
</pack>
</population>
Given the above example document, select-node-text behaves as follows.
select-node-text(rootNode, "pack/name")
⇒ "Scar"
sealed
| node | An instance of <xml-element>. |
| path | An instance of <string>. |
| default: | An instance of <string>. A string to return if a matching XML element is not found. Defaults to “”. |
| text | An instance of <string>. |