Skip to main content

Module document

Module document 

Source
Expand description

Post-processing document wrapper with XML/DOM, ID management, and caching.

Port of LaTeXML::Post::Document. Wraps an XML::LibXML::Document (via the libxml crate) and provides:

  • Namespace management
  • ID tracking (idcache, reusable, reserved)
  • XPath queries with registered namespaces
  • Node manipulation (addNodes, removeNodes, cloneNode, etc.)
  • Persistent cache (key-value store)

Structs§

PostDocument
Post-processing document: wraps an XML document with ID management, namespace tracking, XPath helpers, and a persistent cache.
PostDocumentOptions
Options for creating a PostDocument.

Enums§

Conjunction
Conjunction for joining node lists.
NodeData
Recursive representation for building XML nodes.
XMBranch
Which branch of an ltx:XMDual to follow — Perl’s $branch string argument to realizeXMNode, which is only ever 'content' or 'presentation'.

Constants§

LTX_NSURI
The LaTeXML namespace URI.

Functions§

element_children
Get element children of a node (skipping text, comments, etc.).
element_children_iter
Iterator version of element_children — walks the sibling chain lazily. Prefer this in hot paths that only need to read or filter children without materializing a Vec. Callers that need len() or random access still want the Vec version.
escape_xml
Escape a string for XML text content or a double-quoted attribute value.
get_xml_id
Get the xml:id attribute value from a node. Handles both namespace-aware and plain attribute access.