Mathml visualization in webapp 18.1

Having trouble installing Oxygen? Got a bug to report? Post it all here.
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Mathml visualization in webapp 18.1

Post 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?
Best Regards,
Aleh
Gabriel Titerlea
Site Admin
Posts: 95
Joined: Thu Jun 09, 2016 2:01 pm

Re: Mathml visualization in webapp 18.1

Post 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
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Re: Mathml visualization in webapp 18.1

Post by aleh.haidash »

Thank you, Gabriel.
Best Regards,
Aleh
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Re: Mathml visualization in webapp 18.1

Post 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
Best Regards,
Aleh
Gabriel Titerlea
Site Admin
Posts: 95
Joined: Thu Jun 09, 2016 2:01 pm

Re: Mathml visualization in webapp 18.1

Post 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
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Re: Mathml visualization in webapp 18.1

Post 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.
Best Regards,
Aleh
Gabriel Titerlea
Site Admin
Posts: 95
Joined: Thu Jun 09, 2016 2:01 pm

Re: Mathml visualization in webapp 18.1

Post 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
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Re: Mathml visualization in webapp 18.1

Post by aleh.haidash »

Thanks for the help, now everything works.
The problem was in the rendering of formulas in the images.
Best Regards,
Aleh
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: Mathml visualization in webapp 18.1

Post 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
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Re: Mathml visualization in webapp 18.1

Post by aleh.haidash »

Hello,
Thanks.
Best Regards,
Aleh
Post Reply