Reputation: 2164
I'm trying to use OpenMath in MathML by MathJax. The code is below
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mixed Markup</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
MathML: {
extensions: ["content-mathml.js"]
}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</head>
<body>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<mrow>
<mrow>
<mi>sin</mi>
<mo>⁡<!--FUNCTION APPLICATION--></mo>
<mfenced><mi>x</mi></mfenced>
</mrow>
<mo>+</mo>
<mn>5</mn>
</mrow>
<annotation encoding="application/x-tex">
\sin x + 5
</annotation>
<annotation-xml encoding="application/openmath+xml">
<OMA xmlns="http://www.openmath.org/OpenMath">
<OMS cd="arith1" name="plus"/>
<OMA><OMS cd="transc1" name="sin"/><OMV name="x"/></OMA>
<OMI>5</OMI>
</OMA>
</annotation-xml>
</semantics>
</math>
</body>
When I wrote above code, the content of annotation-xal tag and OMA are colored red like captured image following
(for more detail,
the reason of red line on encoding
is Wrong attribute value
and on xmlns
is URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)
And in the document of MathML3 (http://www.w3.org/TR/MathML3/chapter5.html#html.annotation.xml), they said
"Note that the Namespace extensibility used in the examples may not be available if the MathML is not being treated as an XML document. ... In particular HTML parsers treat xmlns attributes as ordinary attributes, so the OpenMath example would be clasified as invalid by an HTML validator."
But I don't understand the meaning of it, expecially 'MathML is not being treated as an XML document'
What can I do to use OpenMath(?) in MathML and MathJax ?
Upvotes: 1
Views: 526
Reputation: 88286
Maintainer of the W3C HTML checker (validator) here. I don’t know what tool produced the output in the question, but I’m guessing the reason those parts are in red are just because the HTML checker reports errors for those parts.
For MathML, I guess the checker’s a bit more strict than needed. In particular, it doesn’t recognize OpenMath at all, because some years ago I yanked all OpenMath-specific code from the checker at the request of somebody from the MathML working group.
However, that doesn’t mean your code won’t work correctly in MathJax. If it works as expected in MathJax then you can safely ignore the messages from whatever tool is reporting those errors.
Upvotes: 2