Description: In Html5 <math> tags can be found without the attribute xmlns="http://www.w3.org/1998/Math/MathML". It would make sense if we could import such mathml into LO ( At the moment it's not working at all). Steps to Reproduce: Go to eg. https://developer.mozilla.org/en-US/docs/Web/MathML/Examples, select an example (let say Pythagorean Theorem) and using you browser's "inspect" contextual menu (in Firefox or Chromium/Chrome, at least), select a <math> tag representing a formula and Copy it. It gives : <math> <mrow> <msup> <mi>a</mi> <mn>2</mn> </msup> <mo>+</mo> <msup> <mi>b</mi> <mn>2</mn> </msup> <mo>=</mo> <msup> <mi>c</mi> <mn>2</mn> </msup> </mrow> </math> Then in LO formula editor try "Tools-> Import Mathml from clipboard" Actual Results: Nothing is pasted. Import from file would not work either. Expected Results: The selected tag has no xmlns attribute, yet it is perfectly valid Mathml (in the context of html5 which is everywhere now) and should pose no problem of interpretation. The absence of xmlns attribute in <math> should not prevent import; Requiring its presence seems an artificial limit, and I see no good reason for it. Reproducible: Always User Profile Reset: No Additional Info: Version: 7.4.3.2 / LibreOffice Community Build ID: 40(Build:2) CPU threads: 4; OS: Linux 6.0; UI render: default; VCL: gtk3 Locale: fr-FR (fr_FR.UTF-8); UI: en-US Debian package version: 1:7.4.3-2 Calc: threaded
I don't think this would be appropriate. The XML Namespace (xmlns:) is significant to sm parsing as it declares the syntax of the content, and then for correctly holding its source in the resulting ODF archive. For example if we eventually were to extend the import filter parsing to include TeX / LaTeX (bug 96208), or maybe AsciiMath markups--the import parsers have to be able to identify the source formatting. The prescribed xmlns: for MathML flags this cleanly for clipboard import of MathML, it is needed to validate content.
The RELAX NG schema, and I believe we are talking about this, has been introduced a while ago and we should support it. What do you think, Regina?
(In reply to Heiko Tietze from comment #2) > The RELAX NG schema, and I believe we are talking about this, has been > introduced a while ago and we should support it. What do you think, Regina? Looks to me that RELAX NG still requires a DTD of the xmlns: tag for the content.
I think, it is a valid enhancement request. It might be duplicate to bug 98827, at least strong related. From a user point of view such feature is important as it would allow to import <math> fragments. I would restrict the request to texts, which have <math> root element and start with <math>. The result might not be as expected because LibreOffice's MathML support is at version 2.0. But getting something the user then can edit is better than getting nothing.
Regina, I think this is the same as bug 98827 which I logged. If you look in that bug, the xlmns in <math xmlns="http://www.w3.org/1998/Math/MathML"> is definitely optional and going forward with HTML5 will be seen less. It should be a simple fix, if you get <math>, assume it implies <math xmlns="http://www.w3.org/1998/Math/MathML"> This should be safe, because if LibeOffice just gets <math> it does not understand it and can do nothing. So you don;t lose anything by doing that...