Hello
I cannot find the correct way to add mathml to an odt document using
odftoolkit.
I create a TextPElement / DrawFrameElement / DrawObjectElement container
with the MathML element in it this way:
TextPElement p = odt.getContentRoot().newTextPElement();
DrawFrameElement drawFrame = p.newDrawFrameElement();
DrawObjectElement drawObject= drawFrame.newDrawObjectElement();
MathMathElement math = drawObjectElement.newMathMathElement();
Then the actual mathml nodes in the object
OdfElement semantics = odt.getContentDom().createElement("semantics");
math.appendChild(semantics);
and so on using standard dom operations...
When I open the resulting odt, the object is empty.
Now if I hand-edit the odt zip content.xml file to add an
xmlns="http://www.w3.org/1998/Math/MathML" attribute to the <math:math>
tag, everything displays just fine.
creating the math element using
OdfElement math =
odt.getContentDom().createElementNS("http://www.w3.org/1998/Math/MathML","math:math");
yields the same (non working) result
working and non-working documents are in attachements.
So my question is : what would be the correct way to add mathml inside a
document (with the correct mathml namespace attribute) ?
Any help would be appreciated !
V.
--
To unsubscribe e-mail to: dev+unsubscribe@odftoolkit.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.odftoolkit.org/dev/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
- [dev] Adding mathml in a document · vivien guillet
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.