On 12/02/2016 11:31 AM, Hugo van Versendaal wrote:
Hi,



I’m currently trying out some text editors for MathML in DTBook
documents. I’ve installed XMLmind XML Editor 7.2.0 and I noticed that
the whitespace within MathML elements is automatically stripped. For
example:



<m:math xmlns:dtbook="http://www.daisy.org/z3986/2005/dtbook/";
display="inline">

<m:mn>6</m:mn>

<m:mrow>

<m:mtext> km</m:mtext>

</m:mrow>

<m:mo>/</m:mo>

<m:mrow>

<m:mtext>h</m:mtext></m:mrow></m:math>



When opened in XMLmind becomes:



<m:math xmlns:dtbook="http://www.daisy.org/z3986/2005/dtbook/";
display="inline">

<m:mn>6</m:mn>

<m:mrow>

<m:mtext>km</m:mtext>

</m:mrow>

<m:mo>/</m:mo>

<m:mrow>

<m:mtext>h</m:mtext></m:mrow></m:math>



Is there any possibility to avoid this?



No, there is no way to avoid this other than "fixing" the schema of MathML. I mean, <m:mtext> has no xml:space="preserve" as a default attribute.

It seems that the MathML schema (which comes from the W3C; not from XMLmind) is incorrect in that respect because the spec says:

---
An mtext element can be used to contain "renderable whitespace"
---
https://www.w3.org/TR/MathML2/chapter3.html#presm.mtext

We'll carefully re-read the spec in order to try to fix the problem in the next release of XXE.


--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to