Skip to main content

xsltTestMatchPattern

Function xsltTestMatchPattern 

Source
pub unsafe fn xsltTestMatchPattern(
    node: *mut _xmlNode,
    pattern_node: *mut _xmlNode,
) -> bool
Expand description

Test whether a node matches a compiled pattern tree.

In libxslt, the match attribute is compiled into a tree of _xmlNode elements during stylesheet compilation. This function walks that tree to determine whether node matches the pattern.

The pattern tree structure uses element nodes where:

  • The node name encodes the step type (element name, “*”, “node()”, etc.)
  • Children represent path steps (inner to outer)
  • Siblings at the root level represent union alternatives

§Parameters

  • node — The document node to test.
  • pattern_node — The compiled pattern tree root (from _xsltTemplate.r#match).

§Returns

true if the node matches, false otherwise.

§Safety

Both pointers must be valid (or null — null pointers return false).