Page 1 of 1

Mathml visualization in webapp 18.1

Posted: Fri Nov 04, 2016 4:10 pm
by aleh.haidash
Hello.
I see some differences between Oxygen Standalone Editor 18.0 and Oxygen Standalone Editor 18.1 (and webapp 18.1 too) in mathml formulas visualization. Oxygen can't display inner formulas, like this

Code: Select all


 <mml:math class="+ topic/foreign math-d/math ">
<mml:semantics>
<mml:mrow>
<mml:mrow>
<mml:mi mathvariant="italic">score</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mi mathvariant="italic">rule_weight</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mo>∗</mml:mo>
<mml:mrow>
<mml:mrow>
<mml:munderover>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mi>n</mml:mi>
</mml:munderover>
<mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="italic">weight</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo stretchy="false">∗</mml:mo>
<mml:msub>
<mml:mi mathvariant="italic">similarity</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:mrow>
<mml:annotation encoding="StarMath 5.0">score = {1} over {n} * rule_weight *
sum { weight_i * similarity_i } </mml:annotation>
</mml:semantics>
</mml:math>
This functionality work good in prev. version of Standalone Editor ( for example in 18.0), but I didn't try it in prev version of webapp.

Details of error message in Standalone Editor:
Cannot display image
Cannot render the MathML equation using JEuclid: The prefix "mml" for element "mml:math" is not bound.
But resolving formulas from href links works fine.
How can I fix it for inner formulas in webapp?

Re: Mathml visualization in webapp 18.1

Posted: Mon Nov 07, 2016 11:19 am
by Gabriel Titerlea
Hello,

It looks like you forgot to declare the mml namespace.

Code: Select all

<mml:math class="+ topic/foreign math-d/math "> 
should be

Code: Select all

<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" class="+ topic/foreign math-d/math "> 
Best,
Gabriel

Re: Mathml visualization in webapp 18.1

Posted: Tue Nov 08, 2016 10:07 am
by aleh.haidash
Thank you, Gabriel.

Re: Mathml visualization in webapp 18.1

Posted: Tue Nov 08, 2016 3:24 pm
by aleh.haidash
Gabriel Titerlea wrote:Hello,
It looks like you forgot to declare the mml namespace.
[/code]
Yes,this helped fix the problem in Oxygen Standalone Editor 18.1. But in Webapp the problem still remained, see screens
Image
Image

Re: Mathml visualization in webapp 18.1

Posted: Wed Nov 09, 2016 3:32 pm
by Gabriel Titerlea
Hello Aleh,

I could not reproduce this issue, can you send a sample file where this bug can be reproduced to support@oxygenxml.com?
If rewriting the xml content is an option, you can try to replace the 'mml' namespace with 'm'. This might fix the issue in Web Author.

Best,
Gabriel

Re: Mathml visualization in webapp 18.1

Posted: Wed Nov 09, 2016 5:22 pm
by aleh.haidash
Gabriel Titerlea wrote:Hello Aleh,

I could not reproduce this issue, can you send a sample file where this bug can be reproduced to support@oxygenxml.com?
If rewriting the xml content is an option, you can try to replace the 'mml' namespace with 'm'. This might fix the issue in Web Author.

Best,
Gabriel
I sent an email. Please, keep me in touch.

Re: Mathml visualization in webapp 18.1

Posted: Mon Nov 14, 2016 3:39 pm
by Gabriel Titerlea
Hello,

Still no luck, it works for me.
Here are the steps I took to reproduce the issue:
- Generated a sample project using the oxygen-sdk archetype [1][2]
- Built the oxygen-sample-webapp module [3]
- Modified the dita framework to include your custom catalog
- Put the generated war into tomcat and ran it

I could use some additional information:
- What is rendered inside the math-ml element? [4]
- Are there any errors shown in the browser console?
- Do you see any difference if you modify the math-ml plugin [a] to delete lines 36 an 37 of the JEuclidRenderer class and rebuild the sample webapp module [c]?

[a] Which is located inside sdkSampleProj\oxygen-sample-plugins\oxygen-sample-plugin-mathml\src\main\java\your\group\mathml\JEuclidRenderer.java
xml = "<!DOCTYPE math PUBLIC \"-//W3C//DTD MathML 2.0//EN\" \"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd\">\n" + xml;
[c] mvn clean package -am -pl oxygen-sample-webapp -DskipTests

[1] https://www.oxygenxml.com/oxygen_sdk_maven.html
[2] mvn archetype:generate -DarchetypeGroupId=com.oxygenxml.samples -DarchetypeArtifactId=oxygen-sdk-samples-archetype -DarchetypeVersion=18.1.0.0 -DgroupId=myGroup -DartifactId=mySample -Dversion=1.0-SNAPSHOT -DarchetypeRepository=http://oxygenxml.com/maven/
[3] mvn package -am -pl oxygen-sample-webapp -DskipTests
[4] http://i.imgur.com/FCybLst.gif

Re: Mathml visualization in webapp 18.1

Posted: Wed Nov 16, 2016 9:48 am
by aleh.haidash
Thanks for the help, now everything works.
The problem was in the rendering of formulas in the images.

Re: Mathml visualization in webapp 18.1

Posted: Mon Apr 10, 2017 1:15 pm
by cristi_talau
Hello,

I wanted to let you know that Web Author version 19.0 is released and that the MathML plugin is now more tolerant with the namespace of the MathML namespace.

Best,
Cristian

Re: Mathml visualization in webapp 18.1

Posted: Tue Apr 11, 2017 2:27 pm
by aleh.haidash
Hello,
Thanks.