Hi Jason thanks for your answer, that's exactly what I'm trying to do
jason wrote:If you want XHTML or PDF, then I guess what you want to do during the docx export, take the Office Math and convert it to MathML, then include that in your XHTML or XSL FO. If you are getting there via docx4j's XSLT, you may be able to just import|include omml2mathml in the relevant xslt.
Are you referring to this flag ?
- Code: Select all
Docx4J.FLAG_EXPORT_PREFER_XS
I tried to include omml2mml.xsl inside docx2xhtml.xslt but I have the feeling something rewrites tag with docx2xhtml.xslt
When I use omml2mml.xsl outside Docx4j I get this which is pretty good :
- Code: Select all
<mml:math
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:mml="http://www.w3.org/1998/Math/MathML">
<mml:mi>x</mml:mi>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mo>-</mml:mo>
<mml:mi>b</mml:mi>
<mml:mo>±</mml:mo>
<mml:msqrt>
<mml:msup>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>-</mml:mo>
<mml:mn>4</mml:mn>
<mml:mi>a</mml:mi>
<mml:mi>c</mml:mi>
</mml:msqrt>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:mfrac>
</mml:math>
But with Docx4j I get this :
- Code: Select all
<p class="Normal DocDefaults ">
<mi xmlns="http://www.w3.org/1998/Math/MathML">x</mi>
<mo xmlns="http://www.w3.org/1998/Math/MathML">=</mo>
<mfrac xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mo>-</mo>
<mi>b</mi>
<mo>±</mo>
<msqrt>
<msup>
<mrow>
<mi>b</mi>
</mrow>
<mrow>
<mn>2</mn>
</mrow>
</msup>
<mo>-</mo>
<mn>4</mn>
<mi>a</mi>
<mi>c</mi>
</msqrt>
</mrow>
<mrow>
<mn>2</mn>
<mi>a</mi>
</mrow>
</mfrac>
</p>
What am I doing wrong or should I need to edit
docx2xhtml-core.xslt ?