select-nodes

Returns nodes matching a path.  path is a string of the form “name” or “name/name/name…” and denotes a series of child nodes relative to nodepath should not begin or end with ‘/’.

select-nodes follows node’s children down the first child of every subnode that matches the corresponding name.  If the last name in the path matches more than one element, all are returned.

<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-nodes behaves as follows.

select-nodes(rootNode, "pack")
⇒ #[ {pack id="1"}, {pack id="2"} ]

select-nodes(rootNode, "pack/name")
⇒ #[ {name "Scar"}, {name "Notch"} ]

select-nodes(rootNode, "pack/leader")
⇒ #[]

Exported from

Modifiers

sealed

Arguments

nodeAn instance of <xml-element>.
pathAn instance of <string>.

Values

nodesAn instance of <vector> containing <xml-element> objects.
Returns nodes 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.
The class of arrays of rank one (i.e., exactly one dimension).