Mathml visualization in webapp 18.1

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
aleh.haidash
Posts: 32

Mathml visualization in webapp 18.1

Fri Nov 04, 2016 4:10 pm

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
Posts: 38

Re: Mathml visualization in webapp 18.1

Mon Nov 07, 2016 11:19 am

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

Re: Mathml visualization in webapp 18.1

Tue Nov 08, 2016 10:07 am

Thank you, Gabriel.
Best Regards,
Aleh
aleh.haidash
Posts: 32

Re: Mathml visualization in webapp 18.1

Tue Nov 08, 2016 3:24 pm

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
Posts: 38

Re: Mathml visualization in webapp 18.1

Wed Nov 09, 2016 3:32 pm

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

Re: Mathml visualization in webapp 18.1

Wed Nov 09, 2016 5:22 pm

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
Posts: 38

Re: Mathml visualization in webapp 18.1

Mon Nov 14, 2016 3:39 pm

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 [b] 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
[b] 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

Re: Mathml visualization in webapp 18.1

Wed Nov 16, 2016 9:48 am

Thanks for the help, now everything works.
The problem was in the rendering of formulas in the images.
Best Regards,
Aleh
cristi_talau
Posts: 168

Re: Mathml visualization in webapp 18.1

Mon Apr 10, 2017 1:15 pm

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

Re: Mathml visualization in webapp 18.1

Tue Apr 11, 2017 2:27 pm

Hello,
Thanks.
Best Regards,
Aleh

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 2 guests