Skip to main content

xptr_eval

Function xptr_eval 

Source
pub unsafe fn xptr_eval(expr: &str, doc: *mut _xmlDoc) -> Option<*mut _xmlNode>
Expand description

Evaluate an XPointer expression and return the pointed-to node.

Supports:

  • Shorthand pointers — bare name treated as an element ID.
  • element() schemeelement(id) selects the element with that ID; element(id/N) selects the N-th child (1-indexed) of that element, etc.

Returns None if the pointer does not resolve to a node.

§Parameters

  • expr — the XPointer expression (without the leading #).
  • doc — pointer to the XML document to search in.

§Safety

doc must be a valid, non-null pointer to a fully parsed _xmlDoc.