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 ofscanPatternetc., L100–390).simplify— AST normalization (port ofsimplify*, L438–525).tex— schema-doc TeX emission (port ofdocumentModules,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
.modelfiles and.rngschemas without an accompanyingresources/RelaxNG/tree on disk. - scan
- RelaxNG XML → AST scanner.
- simplify
- AST normalization. Port of
RelaxNG.pmlines 397–525. - tex
- Schema-doc TeX emission. Port of
RelaxNG.pmlines 545–815.
Structs§
- Relaxng
- Internal representation of a RelaxNG schema. Built by
scanandsimplify; consumed bytex(and, for runtime validation, would be consumed byModel::add_tag_contentetc.).
Enums§
- Combine
Op - 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.