Skip to main content

parse_for_xpath

Function parse_for_xpath 

Source
pub fn parse_for_xpath<'a>(
    input: &'a [u8],
    xpath_str: &str,
) -> Result<XmlIndex<'a>>
Expand description

Parse XML with query-driven optimization: only index tags relevant to the given XPath expression. Falls back to full parse if the query uses wildcards.

For selective queries like //claim/text(), this can be 2-5x faster than full parsing because it skips index construction for irrelevant tags.