select-node-text

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"

Exported from

Modifiers

sealed

Arguments

nodeAn instance of <xml-element>.
pathAn instance of <string>.
default:An instance of <string>.  A string to return if a matching XML element is not found.  Defaults to “”.

Values

textAn instance of <string>.
Returns nodes matching a path.
Returns the character data of the first XML element matching a path.
The simple-xml module provides basic XML parsing and navigation.
A class representing an XML element.
The class of sequences with elements that are characters.