Vendor W3C MathML 4 grammar (marked modifications); rework metanorma-mathml wrapper#40
Merged
Conversation
Refs #39 Refs metanorma/metanorma#585 Replaces the vendored W3C MathML 3.0 RNC with the MathML 4 set (www.w3.org/Math/RelaxNG/mathml4/, retrieved 2026-07-16, WD nearing CR, pinned with provenance). Unlike the v3 vendoring, the files carry marked modifications (each tagged METANORMA MODIFICATION in place, upstream text preserved): the draft-generated grammar violates RELAX NG's duplicate-attribute restriction across the full-profile composition and is rejected outright by jing (data-other, dir/mathsize/mathvariant, id, alttext, maxsize, href, attributionsrc, displaystyle, encoding), and the anyElement/annotation-xml combine re-opens plus a nested-include override had to be adjusted so the metanorma wrapper's foreign-markup bans stay expressible for both jing and libxml2. metanorma-mathml.rnc wrapper: include mathml4.rnc; data-metanorma-numberformat augmentation and annotation-xml/anyElement bans re-applied; documents the one v4 loosening a wrapper cannot subtract (embedded XHTML/SVG in token content via textorHTML). Verified with jing: valid MathML 4 with intent/arg + data-metanorma-numberformat passes, text-only annotation passes, plurimath's own emitted MathML passes, foreign annotation-xml is rejected.
Refs #39 libxml2's RELAX NG rejects the compiled grammar outright on the svg branch of mathml4-core's textorHTML ("Element svg attributes have a content type error"), which breaks every passthrough validation in metanorma-standoc. metanorma's serialiser never emits embedded HTML/SVG in math tokens, so both foreign branches are removed as a further marked modification (textorHTML = text | math), and the wrapper's "known loosening" note is replaced by the resolution. Verified: jing probes unchanged (v4 intent/arg + numberformat pass, annotation-xml rejected), libxml2 compiles clean, metanorma-standoc schema/validation specs green against the recompiled set.
This was referenced Jul 15, 2026
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Merged
opoudjis
added a commit
to metanorma/metanorma-standoc
that referenced
this pull request
Jul 16, 2026
) Refs #1212 Replaces the compiled mathml3*.rng set in lib/metanorma/validate with the MathML 4 set compiled (trang) from the basicdoc-models vendoring (metanorma/basicdoc-models#40: W3C 2026-07-16 draft snapshot with marked modifications — the draft-generated grammar violates RELAX NG's duplicate-attribute restriction throughout and its embedded-HTML/SVG token content breaks libxml2; see that PR). metanorma-mathml.rng keeps its name, so basicdoc.rng's externalRef is unchanged; its documentation comment is updated to MathML 4. jing id_check: false remains required (the v4 grammar still types id as xsd:ID in MathMLPGlobalAttributes and CommonAtt). Verified: schema_spec + validate_spec green (including passthrough fragment validation through libxml2), math_spec green, full suite green.
opoudjis
added a commit
to metanorma/metanorma-model-iso
that referenced
this pull request
Jul 19, 2026
#140) * bump basicdoc-models to MathML 4 grammar; propagate mathml4 in copy.sh Refs metanorma/metanorma-standoc#1212 basicdoc-models submodule advanced to the merged MathML 4 vendoring (metanorma/basicdoc-models#40); copy.sh now propagates mathml4*.rng in place of mathml3*.rng to metanorma-standoc and the flavour gems. Local compile artifacts regenerated from the bumped submodule via trang are byte-identical to the grammar files already shipped in metanorma/metanorma-standoc#1214 and the 15 flavour re-vendoring PRs; flavour basicdoc.rng copies will pick up the updated documentation comment at the next copy.sh propagation. * add lutaml-xsd to Gemfile: grammar build workflow requires its CLI Refs metanorma/metanorma-standoc#1212 The Build and Deploy Grammars workflow runs `bundle exec lutaml-xsd build`, but the lutaml-xsd executable dropped out of the lutaml dependency chain in the early-July restructuring; the workflow has been failing on main since 2026-07-05 (last green 2026-06-28), independently of this branch. NB the Gemfile is Cimas-generated: the same line needs adding to the Cimas source so the next cimas-sync does not revert it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #39
Vendors the W3C MathML 4 RNC set (2026-07-16 draft snapshot, provenance in README) in place of MathML 3, and reworks the
metanorma-mathml.rncwrapper (numberformat augmentation + foreign-markup bans re-applied). Note for review: unlike v3 this is not an unmodified vendoring — the draft-generated W3C grammar is rejected outright by jing (duplicate-attribute violations across the full-profile composition), so the files carry markedMETANORMA MODIFICATIONcomments (12, upstream text preserved in place; class-by-class summary in the README and commit message). Verified with jing: MathML 4intent/arg+data-metanorma-numberformatpass, plurimath's own emission passes, foreignannotation-xmlrejected. One v4 loosening a wrapper cannot subtract (embedded XHTML/SVG in token content) is documented in the wrapper.🤖