Equation element remains empty in HTML
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Equation element remains empty in HTML
Hello, everyone!
I crammed Eliot Kimber's tutorials about specialization and custom attributes. I got good results while following the step by steps and I start to better understand the principles between .mod, .ent and .dtd.
However, I am struggling now to understand how to debug a plugin based on mathml and using equations.
A client sent me a project were equations are written like this:
So far, so good. However, when I publish my project with an HTML scenario, the source outputs an empty element instead of the maths:
When exploring the dtd, it seems a .mod file contains elements that may produce the problem because Oxygen indicates that the bolded elements below are not declared. However, I assume %image and %basic.ph are regular elements in DITA-OT
.
Is there any way or methodology to unravel this issue? Something that would help determining which file is problematic.
Thanks a lot for any feedback and support
I crammed Eliot Kimber's tutorials about specialization and custom attributes. I got good results while following the step by steps and I start to better understand the principles between .mod, .ent and .dtd.
However, I am struggling now to understand how to debug a plugin based on mathml and using equations.
A client sent me a project were equations are written like this:
Code: Select all
<equation-inline>
<mathml>
<m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
<m:mn>0</m:mn>
<m:mo>.</m:mo>
<m:mn>4</m:mn>
<m:mi>L</m:mi>
</m:math>
</mathml>
</equation-inline>
Code: Select all
<span class="ph equation-inline"></span>
.
Code: Select all
<!ENTITY % equation.cnt
"#PCDATA |
mathml |
[b]%basic.ph; |
%data.elements.incl; |
%foreign.unknown.incl; |
%image; |
%txt.incl;[/b]
">
Thanks a lot for any feedback and support

------
Gaspard
Gaspard
-
- Posts: 9423
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Equation element remains empty in HTML
Hi,
This does not look like a problem with the DTD, probably the XSLT stylesheets used to convert the DITA content to HTML simply have no processing in place for that mathml element.
You are probably using a custom DITA OT distribution, right?
As an example Oxygen's bundled DITA OT installation comes with this plugin created by Eliot Kimber pre-installed:
"OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita-community.dita13.html"
The plugin has a "org.dita-community.dita13.html/xsl/mathml-d2html.xsl" stylesheet which matches mathml elements and then serializes them further in the output HTML document.
Regards,
Radu
This does not look like a problem with the DTD, probably the XSLT stylesheets used to convert the DITA content to HTML simply have no processing in place for that mathml element.
You are probably using a custom DITA OT distribution, right?
As an example Oxygen's bundled DITA OT installation comes with this plugin created by Eliot Kimber pre-installed:
"OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita-community.dita13.html"
The plugin has a "org.dita-community.dita13.html/xsl/mathml-d2html.xsl" stylesheet which matches mathml elements and then serializes them further in the output HTML document.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Re: Equation element remains empty in HTML
Hello, Radu!
Thanks for your answer.
Actually, I installed Eliott's plugin and checked if the XSL files are correctly installed. That's why I suspect a conflict or an override from the customer's plugin with this. And my current concern is to understand if there are any ways to trace and notice where the processing of this element would occur, because I don't have errors raised during the publishing. It's just the fact that somewhere the transformation doesn't apply as expected.
Thanks for your answer.
Actually, I installed Eliott's plugin and checked if the XSL files are correctly installed. That's why I suspect a conflict or an override from the customer's plugin with this. And my current concern is to understand if there are any ways to trace and notice where the processing of this element would occur, because I don't have errors raised during the publishing. It's just the fact that somewhere the transformation doesn't apply as expected.
------
Gaspard
Gaspard
-
- Posts: 9423
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Equation element remains empty in HTML
Hi,
I'm not sure how to help further, the XSLT "DITA-OT3.x/plugins/org.dita-community.dita13.html/xsl/mathml-d2html.xsl" has this template:
which should match the <mathml> DITA element, maybe you can add an xsl:message inside the template to see if it gets called. If not maybe you can set a priority attribute on the template to increase its priority.
Regards,
Radu
I'm not sure how to help further, the XSLT "DITA-OT3.x/plugins/org.dita-community.dita13.html/xsl/mathml-d2html.xsl" has this template:
Code: Select all
<xsl:template match="*[contains(@class, ' mathml-d/mathml ')]">
<span>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</span>
</xsl:template>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Re: Equation element remains empty in HTML
Interesting... Thanks for the pointer, it appears that the template declaration on my side is incomplete:
I will look at the template's priority...
Code: Select all
<xsl:template match="*[contains(@class, ' mathml-d/mathml ')]">
<xsl:apply-templates/>
</xsl:template>
------
Gaspard
Gaspard
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service