w3c / epubcheck

The conformance checker for EPUB publications
https://www.w3.org/publishing/epubcheck/
BSD 3-Clause "New" or "Revised" License
1.63k stars 403 forks source link

MathML contentequiv annotations are for content mathml #1104

Open mattgarrish opened 4 years ago

mattgarrish commented 4 years ago

In porting over the MathML tests, I noticed that one of the valid mathml annotation tests has a presentation MathML contentequiv annotation for a presentation MathML equation:

<annotation-xml encoding="application/mathml-presentation+xml" name="contentequiv">

This gets flagged by validator.nu as invalid, however.

Looking at the section on content equivalents in the MathML spec, it says:

Consequently, in MathML 3, the contentequiv annotation key should be used to make an explicit assertion that the annotation provides a definitive content markup equivalent for an expression.

While it doesn't have to contain content MathML, the suggestion is that it should contain that or some other semantically meaningful markup. Another case of presentation mathml should at least result in a warning, in other words, which makes the validator.nu result closer to what I would have expected.

(Oddly, if you switch the encoding to "MathML-Presentation", the error in validator.nu goes away, but that looks like a bug.)

rdeltour commented 1 year ago

validator.nu rejects any encoding value that is not one of ("application/xhtml+xml", "text/html", "SVG1.1", "MathML", "MathML-Content", or "MathML-Presentation"). It does not reject the "application/mathml-presentation+xml" value because the annotation is a content equivalent, but simply because the value is not in the allowed subset.

I would say this is a bug in validator.nu, that we should not strive to port.

As for issuing a warning if the contentequiv key is used with any other encoding than "application/mathml-presentation+xml" or "MathML-Content", I have no strong opinion. It would certainly be in the spirit of the MathML spec language quoted by @mattgarrish above, but not sure it is worth implementing this specifically (with a schematron check or in Java).

Thoughts @mattgarrish?

I'm moving this out of the v5.0.0 milestone, as this looks low priority.