Skip to main content

declare_node_matches

Function declare_node_matches 

Source
pub fn declare_node_matches(
    document: &Document,
    node: &Node,
    pat: &DeclarePattern,
) -> bool
Expand description

Rust-side filtering for \lxDeclare pattern matching. XPath matches are broad (to avoid nested predicate bugs); this function verifies the matched node’s children match the specific pattern.

Pattern types:

  • “subscript”: node is XMApp[@role='POSTSUBSCRIPT'], check base text + optional sub text
  • “prime”: node is XMApp[@role='POSTSUPERSCRIPT'], check base text
  • “accent”: node is XMApp, check accent name in first child, optional base text
  • “simple”: no extra filtering needed (XPath is specific enough)