Skip to main content

bind_node

Function bind_node 

Source
pub fn bind_node(
    arena: &mut AstArena,
    id: AstNodeId,
    ctx: &XPathContext<'_>,
    binder: &mut NameBinder,
) -> Result<(), XPathError>
Expand description

Bind an AST node and all its children.

This function performs static analysis on the AST:

  • Resolves function calls to FunctionId
  • Resolves variable references to slot indices
  • Validates namespace prefixes

§Arguments

  • arena - The AST arena containing all nodes
  • id - The ID of the node to bind
  • ctx - The static context for namespace resolution
  • binder - The name binder for variable slot allocation

§Returns

  • Ok(()) if binding succeeds
  • Err(XPathError) with appropriate error code if binding fails

§Errors

  • XPST0081 - Undefined namespace prefix
  • XPST0017 - Function not found
  • XPST0008 - Undefined variable