mathml entities

bulbab
Posts: 4

mathml entities

Tue Feb 19, 2013 6:24 pm

Hi,

The following mathml works in oXygen as a standalone mathml file :

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE m:math PUBLIC "-//W3C//DTD MathML 2.0//EN"
    "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"[
    <!ENTITY % MATHML.prefixed "INCLUDE">
    <!ENTITY % MATHML.prefix "m">]>
<m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
    <m:mover accent="true"><m:mrow><m:mi>aaaA</m:mi></m:mrow><m:mo>&OverBar;</m:mo></m:mover>
</m:math>

but when I try to embed it in a docbook equation I have an error because the &OverBar; entity is not known.

Code: Select all

<equation>
  <m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
    <m:mover accent="true"><m:mrow><m:mi>aaaA</m:mi></m:mrow><m:mo>&OverBar;</m:mo></m:mover>
  </m:math>
</equation>

Is it possible to tell the docbook configuration where to find the mathml entities ?

Best regards,
Bulbab
Radu
Posts: 5867

Re: mathml entities

Wed Feb 20, 2013 9:26 am

Hi Bulbab,

In the Oxygen File->New dialog wizard there is a new file template called "Article with MathML" which references a DTD from:

OXYGEN_INSTALL_DIR/frameworks/docbook/4.3/dtd/dbmathml.dtd

You can open the referenced DTD and see how it is composed, it references both the Docbook 4.3 DTD and the Math ML DTDs.

You either need to use that one our build your custom DTD which references both the Docbook DTD and the MathML DTDs.

Or all your Docbook files could have a DOCTYPE like:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
                         "http://www.docbook.org/xml/4.5/docbookx.dtd"[
<!ENTITY % equation.content "(alt?, (graphic|mediaobject|m:math)+)">
<!ENTITY % inlineequation.content "(alt?, (graphic|inlinemediaobject|m:math)+)">
<!-- tell the MathML DTD to do the right prefixing -->
<!ENTITY % NS.prefixed     "INCLUDE">
<!ENTITY % MATHML.prefix   "m">
<!ENTITY % NamespaceDecl.attrib "
   xmlns:m
      CDATA   #FIXED 'http://www.w3.org/1998/Math/MathML'
">
<!-- You must also include the MathML DTD -->
<!ENTITY % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"
                  "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
%mathml;
]>
<article>
    <title>Article Title</title>
    <sect1>
        <title>Section1 Title</title>
        <para>Text</para>
        <equation>
            <m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
                <m:mover accent="true"><m:mrow><m:mi>aaaA</m:mi></m:mrow><m:mo>&OverBar;</m:mo></m:mover>
            </m:math>
        </equation>
    </sect1>
</article>


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “DocBook”

Who is online

Users browsing this forum: No registered users and 0 guests