Skip to main content

eval_node

Function eval_node 

Source
pub fn eval_node<N: DomNavigator>(
    arena: &AstArena,
    id: AstNodeId,
    ctx: &mut DynamicContext<'_, N>,
) -> Result<XPathValue<N>, XPathError>
Expand description

Evaluate an AST node and return the result.

This function recursively evaluates the AST, dispatching to appropriate handlers based on node type. The AST must have been bound using bind_node() before evaluation.

§Arguments

  • arena - The AST arena containing all nodes
  • id - The ID of the node to evaluate
  • ctx - The dynamic context for evaluation

§Returns

  • Ok(XPathValue) containing the evaluation result
  • Err(XPathError) if evaluation fails

§Errors

  • XPDY0002 - Context item is undefined when required
  • XPST0008 - Variable is not bound
  • Various function-specific errors