We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

MathML does not inserted correctly into document by insertHTML uising Java

Someone help me whats preventing mathmL not rendering properly when trying to print on docx file using documentbuilder.insertHTML(xmlString);

xmlString is below.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:mfrac xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns1="http://www.w3.org/1999/xlink">
			<ns2:mfrac bevelled="true">

expected o/p: image.png (370 Bytes)

output printed on word document is : 5678


We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-20291 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@tahir.manzoor Thanks for looking into it.


It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-20291) as ‘Not a Bug’.

The given MathML is incorrect for MS Word. Please use following code example to get the desired output.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
    "<math xmlns = \"http://www.w3.org/1998/Math/MathML\">" +
    "<mfrac>" +
    "<msup>" +
    "<mn>5</mn>" +
    "<mfrac bevelled=\"true\">" +
    "<mn>6</mn>" +
    "<mn>7</mn>" +
    "</mfrac>" +
    "</msup>" +
    "<mn>8</mn>" +
    "</mfrac>" +

doc.Save(MyDir + "20.5.docx");