OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook] Need help using MathML ("Unknown formatting object "{http://www.w3.org/1998/Math/MathML}math" encountered")

Hi Daniel,
Your first cited example is HTML5, not plain HTML, since it starts with the HTML5 signature:

<!doctype html>

However, the second example was illuminating. That is an ordinary HTML page, but Firefox does format the MathML. The trick, it seems, is to not use a namespace prefix on the MathML elements.

This does not format in Firefox in HTML pages:

<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML";>

But this does format in Firefox:

<math xmlns="http://www.w3.org/1998/Math/MathML";>

Since HTML was an SGML application, it predates namespaces. So Firefox is probably just recognizing the element names when the prefix is not used, and does not recognize the element names like <mml:math> when the prefix is used.

Do your MathML files use a namespace prefix? If you remove the prefix (but keep the default namespace declaration on the <math> element, do they copy through to the HTML output without a prefix, and then display properly? I'm not sure if the processor will add a prefix or not.

Bob Stayton
Sagehill Enterprises

On 12/8/2013 1:43 AM, Daniel Bishop wrote:
Hello Bob,
I looked up two examples that are displayed correctly in Firefox:


The second one says in the beginning:
"*NOTE: this is a standard HTML page that cannot render the MathML
examples below! Click on this MathML examples
<http://gorupec.awardspace.com/mathml.xhtml> twin page made with the
XHTML that actually can render equations (of course, only if your
browser supports MathML). *

However both pages render correctly:


Neil Soiffer <NeilS@dessci.com> schrieb am 20:21 Freitag, 6.Dezember 2013:
MathML is supported in Firefox as part of XHTML. It is also supported as
part of HTML5, but you can't use namespace prefixes in HTML5 because
HTML5 doesn't know about namespaces. For compatibility between XHTML and
HTML5, you can do the following:

<math xmlns="http://www.w3.org/1998/math/MathML";>

This will put the math in the right namespace in XHTML and because it
has no namespace prefixes, will work in HTML5 also. Of course, the
DOCTYPE needs to be specified correctly to tell Firefox that you have
XHTML or HTML5. MathML is not part of HTML4, so make sure you get the
DOCTYPE right.

Neil Soiffer
Senior Scientist
Design Science, Inc.
www.dessci.com <http://www.dessci.com/>
~ Makers of MathType, MathFlow, MathPlayer, MathDaisy, Equation Editor ~

On Fri, Dec 6, 2013 at 10:27 AM, Bob Stayton <bobs@sagehill.net
<mailto:bobs@sagehill.net>> wrote:

    The difference between HTML and XHTML for MathML display seems to be
    a feature of Firefox.  If I manually convert the HTML file to XHTML
    with no change to the MathML markup, and rename it with .xhtml, then
    Firefox displays the MathML properly.  So if Firefox thinks the file
    is XHTML, it displays the MathML, otherwise it doesn't.

    Can you provide an example of an HTML file that displays MathML in
    Firefox?  I'd like to see what the differences are.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net <mailto:bobs@sagehill.net>

    On 12/6/2013 7:23 AM, Daniel Bishop wrote:

        Thank you Stefan and Thomas,
        you have helped me to make a big step ahead using docbook.

        Fop is now working, although not quite elegantly. I have
        installed jeuclid:
        $ sudo apt-get install libjeuclid-fop-java libjeuclid-core-java
        I had to modify the /usr/bin/fop script by adding these two lines:
        find_jars /usr/share/java/jeuclid-core.__jar
        find_jars /usr/share/java/jeuclid-fop.__jar
        I know, this is Ubuntu/Debian specific, but there must be a less
        intrusive way of letting fop know about the jeuclid jars?
        Copying the
        jars into /usr/share/fop/ didn't help.

        Concerning the math formatting only working in xhtml, not in
        html files,
        I followed Stefans advice. He is right, and I can create working
        It is strange that the formatting doesn't work for html files.
        the generated test.xhtml to test.html removes all math content
        There are many examples that display MathML content in html
        files. Is
        there any possibility to make xsltproc produce such html files
        missing content?

        Thank you

        Concerning the math formatting only working in xhtml files, not
        in html
        files, I followed Stefans advice

        Thomas Schraitle <tom_schr@web.de <mailto:tom_schr@web.de>>
        schrieb am 14:23 Freitag, 6.Dezember

        On Fri, 06 Dec 2013 07:50:16 -0500
        Stefan Seefeld <stefan@seefeld.name <mailto:stefan@seefeld.name>
        <mailto:stefan@seefeld.name <mailto:stefan@seefeld.name>>> wrote:

          > [...]
          > > Next, I process test.xml into test.pdf with the following
          > > ------------------------------__--------------------------
          > > $ xsltproc -o test.fo <http://test.fo/>
          > >
        /usr/share/xml/docbook/__stylesheet/nwalsh/fo/docbook.__xsl test.xml
          > > [...]
          > > Unknown formatting object
          > > encountered (a child of fo:instream-foreign-object}. (See
          > > 2:29495)
          > > [...]
          > > $
          > > ------------------------------__--------------------------
          > Again, use namespace-aware stylesheets.
          > In addition, I had to patch my fop installation to make it
          > MathML correctly. Whether that is an actual problem for you
          > on the platform you are on, as well as the specific FOP
        version you
          > are using.

        I don't think the problem is related to stylesheets, be it namespace
        aware or not.

        FOP needs to "know" how to format MathML markup. By default,
        this is not
        the case. Install the JEuclid plugin[1] and try it again.

        ----- References
        [1] http://jeuclid.sourceforge.__net/trunk/jeuclid-fop/

              Thomas Schraitle

        To unsubscribe, e-mail:

        For additional commands, e-mail:

    To unsubscribe, e-mail: docbook-unsubscribe@lists.__oasis-open.org
    For additional commands, e-mail: docbook-help@lists.oasis-open.__org

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]