This application scans EPUB files and validates MathML content based on customizable rule sets. It generates structured JSON reports and human‑readable HTML summaries.
- Reads EPUB files from a predefined folder
- Extracts and validates MathML from HTML/XHTML/XML entries
- Supports optional rule filtering using
rules.txt - Supports running only the rules tagged with a given library, language and/or MathML version
- Outputs JSON and HTML validation reports
- Optionally load rule definitions from
rules.txt. - Enumerate all EPUB files recursively in the input directory.
- Open each EPUB as a ZIP archive.
- Parse HTML/XHTML/XML files.
- Run MathML validation rules.
- Produce JSON and HTML summary reports.
Instructions on how to download and run the validator can be found here: How to download and run the validator.
Place EPUB files inside the folder:
C:/mathml_validator
Run the program. Reports will be saved to:
C:/mathml_validator/report/json
C:/mathml_validator/report/html
Each rule may optionally be tagged with a Library, Language and/or MathML_version in Tests.cs:
new TestRule {
Id = "math-wrong-number-of-children-3",
Library = "tibi",
Language = "no",
MathML_version = "MathML3",
...
}To run only the matching rules, set the filter in settings.txt next to the EPUB files
(C:/mathml_validator/settings.txt). A commented-out template is written automatically on the first run:
library = tibi
language = no
mathml_version = MathML3
Notes:
- Without a settings file, or with all values empty, every active rule runs, exactly as before.
- Any combination of the three keys can be used; each one is optional.
- The values can also be set directly in code (
filterLibrary/filterLanguage/filterMathMLVersioninProgram.cs);settings.txtoverrides them when it supplies a non-empty value. - Matching is case-insensitive, and a rule may list several values:
MathML_version = "MathML3,MathML4". - A rule with no
Library/Language/MathML_versionis treated as generic and runs for every filter. To make untagged rules be skipped when a filter is given, setIncludeUntaggedRules = falseinRulesLoader.cs. - The library/language/MathML version filter is applied after the
rules.txtID filter, so the two can be combined.