Expand description
Rules for rewriting the constructed XML document, after core processing has completed
Modules§
- declare
- The
\lxDeclarepattern compiler and its paired structural matcher.
Structs§
- Multi
Select Entry - A single sub-pattern in a MultiSelect clause.
Perl:
[$xpath, $nnodes, @wilds] - Rewrite
- Rewrite
Clause - Rewrite
Options
Enums§
Functions§
- dom_
to_ xpath - Convert a DOM subtree to an XPath expression + wildcard position tracking. Perl: domToXPath() → domToXPath_rec() → domToXPath_seq()
- mark_
wildcards - Mark wildcard nodes in the matched tree. Perl: markWildcards($node, @wilds)
- set_
attributes_ wild - Set attributes on a tree containing wildcards, creating XMDual wrappers. Perl: setAttributes_wild($document, $attributes, @nodes) — Rewrite.pm L195-217
- set_
wildcard_ ids - Collect xml:ids of wildcard-marked nodes, generating IDs if needed. Collect xml:ids of wildcard-marked nodes, generating IDs if needed. Perl: set_wildcard_ids($document, $node) — Rewrite.pm L219-231 Faithfully translated: if node has _wildcard, return its ID. If node has _matched, skip (already processed by prior rule). Otherwise recurse into children.
- unmark_
wildcards - Unmark wildcard nodes after processing.
Type Aliases§
- Compiled
Match - Result of domToXPath compilation: xpath string, node count, wildcard paths.
- Rewrite
Regexp Closure - Regexp closure: Perl signature is ($string) → modified in-place via s///g.
- Rewrite
Replace Closure - Rewrite
Test Closure - Test closure: Perl signature is ($document, $node) → $nnodes (0/undef = skip).
- Wild
Path - Wildcard position path: indices to navigate from matched root to wildcard node. First index uses nth_sibling (sibling offset), rest use nth_child (child position).