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 node. path 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")
⇒ #[]
sealed
| node | An instance of <xml-element>. |
| path | An instance of <string>. |
| nodes | An instance of <vector> containing <xml-element> objects. |