Skip to main content

Module relaxng

Module relaxng 

Source
Expand description

Native Rust port of LaTeXML’s LaTeXML::Common::Model::RelaxNG.

Walks a RelaxNG XML schema, builds an in-memory pattern AST, simplifies it (binding/grammar/include resolution, definition recording), and can emit the LaTeX manual.tex consumed by latexmlman.sty for schema documentation.

Three sub-modules carry the implementation, mirroring the natural sections of the upstream Perl source:

  • scan — RNG XML → AST (port of scanPattern etc., L100–390).
  • simplify — AST normalization (port of simplify*, L438–525).
  • tex — schema-doc TeX emission (port of documentModules, toTeX*, L550–815).

The shared state — definition tables, element index, “Used by” graph — lives on Relaxng and is populated by scan + simplify, then consumed by tex. The Perl original mutates $$self{...} from several methods at once; the Rust version threads &mut self the same way.

Modules§

embedded
Embedded RelaxNG schema tree — bundled at compile time so a single-binary distribution can serve compiled .model files and .rng schemas without an accompanying resources/RelaxNG/ tree on disk.
scan
RelaxNG XML → AST scanner.
simplify
AST normalization. Port of RelaxNG.pm lines 397–525.
tex
Schema-doc TeX emission. Port of RelaxNG.pm lines 545–815.

Structs§

Relaxng
Internal representation of a RelaxNG schema. Built by scan and simplify; consumed by tex (and, for runtime validation, would be consumed by Model::add_tag_content etc.).

Enums§

CombineOp
Combiner kind for a <group|interleave|choice|optional|zeroOrMore| oneOrMore|list> pattern wrapper.
DefCombiner
Combiner kind on a <define> element.
Pattern
One node in the RelaxNG AST, mirroring Perl RelaxNG.pm’s [$op, $name, @forms] arrays.