Skip to main content

Module xml_walk

Module xml_walk 

Source
Expand description

Read-only walks for the XPath location paths LaTeXML asks on every document and every formula (//ltx:Math[not(ancestor::ltx:Math)], descendant-or-self::*[@_pvis or @_cvis], //ltx:ref//*[@fragid], …).

libxml2 answers such a query by building a node set over every element it passes and rust-libxml then wraps each result; on a large document the node set also hits libxml2’s 10M ceiling, where the evaluation returns NULL and “no matches” cannot be told from “could not answer” (a 614 MB core XML: six queries failed, post wrote 0 bytes). A WalkQuery tests read-only nodes and makes Node handles only for its matches. It answers only shapes it can prove equal to XPath (the same nodes, document order, each once) and declines everything else, so the caller evaluates those as XPath unchanged. It keeps no state between queries: each one reads the live tree.

Structs§

WalkQuery
A parsed query inside the walk’s grammar (see the module doc).