Page 1 of 1

How to add MathML support to DITA customization?

Posted: Tue Apr 28, 2015 6:57 pm
by Frank Ralf
Hi,

We use a customized DITA framework and want to add MathML support. I've already tried adding adding the DTD, MOD, and ENT files from the mathml DITA-OT plug-in to our customization along with referencing them from our customized topic DTD but I'm not sure that this is the right approach. Any pointers welcome.

TIA
Frank

Re: How to add MathML support to DITA customization?

Posted: Wed Apr 29, 2015 9:19 am
by Radu
Hi Frank,

If it helps you, the DITA OT distribution which comes with Oxygen contains a mathml plugin inside it which you could use as a starting point:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\mathml

besides contributing XSLT for publishing PDF and XHTML-based topics with the equations embedded the plugin contributes a new Public ID for a DITA composite-type topic which can contain inside it the equation wrapped in two DITA specialized elements, an equation element which extends DITA fig and a mathml element which extends DITA foreign.

You can create in Oxygen using the File->New dialog a Composite with MathML file and see that in action.

Regards,
Radu

Re: How to add MathML support to DITA customization?

Posted: Wed Apr 29, 2015 11:37 am
by Frank Ralf
Hi Radu,

Thanks for the pointers.

PDF transformation
Actually, I already had a look at the mathml plugin and the additional document type. But because we don't want to create a separate document type I copied over the files from the mathml plugin to our own DITA-OT plugin and integrated them into our DTD. This does work already in oXygen and the files validate but the PDF transformation still breaks because of some unresolved references. So I suppose I should have a closer look at the XSLT files from the mathml plugin to see how the MathML is rendered in the PDF.

Multiple MathML plugins
In addition, I had a closer look at the DITA-OT plugins and found that there is also a MathML plugin for DITA4Publishers (net.sourceforge.dita4publishers.math) which comes with two additional document types, mathml2 and mathml3. There I stumbled across the following comment in mathml2.dtd:
<!-- WEK:
Removed use of public identifier here to ensure that we always
get this version of the mathml2-qname-1.mod and not one
from another source, especially in tools like OxygenXML
where there could be any number of copies of MathML
referenced from different catalogs.
-->
So which is the plugin with the most current implementation of MathML? And which files should I reference?

Kind regards,
Frank

Re: How to add MathML support to DITA customization?

Posted: Wed Apr 29, 2015 12:39 pm
by Radu
Hi Frank,

The Oxygen provided mathml plugin does not come with MathML DTDs.
Instead, its modules refer to it using the public ID -//W3C//DTD MathML 2.0//EN.
Also the catalog.xml from our plugin has an entry like:

Code: Select all

<nextCatalog catalog="../../../../mathml/catalog.xml"/>
which means that we wanted the XML catalog from the "mathml" framework we bundle with Oxygen to be actually used to resolve that public ID.
What MathML 2 DTD gets used in the end I'm not sure, it depends on the order of the catalog entries in the catalog-dita.xml. It probably does not matter much though.

Regards,
Radu

Re: How to add MathML support to DITA customization?

Posted: Thu Apr 30, 2015 4:51 pm
by Frank Ralf
Hi Radu,

Many thanks for this explanation, that will help me a lot.

Kind regards,
Frank