Pike v8.1 release 6

Method Parser.XML.Tree.RootNode()->get_element_by_id()


Method get_element_by_id

ElementNode get_element_by_id(string id, int|void force)

Description

Find the element with the specified id.

Parameter id

The XML id of the node to search for.

Parameter force

Force a regeneration of the id lookup cache. Needed the first time after the node tree has been modified by adding or removing element nodes, or by changing the id attribute of an element node.

Returns

Returns the element node with the specified id if any. Returns UNDEFINED otherwise.

See also

flush_node_id_cache