MathML Sucks

I’ve been try­ing all damn day to get any­thing (any­thing!) to ren­der in Mozil­la that I’ve writ­ten in MathML. Noth­ing. Even if I copy their stu­pid exam­ple page, it does­n’t ren­der. WTF? Is is pos­si­ble that I’m actu­al­ly that lame of a writer? If I can’t fig­ure this out, how is this sup­posed to be read­i­ly adopt­ed by anyone?

And I read today that Microsoft is plan­ning on hav­ing all of their Office suite save to XML file types for the next release. Good luck! If this is the wave of the future, I’m going to revert to tables and .gif spac­er images. Suck a nut.

Published
Categorized as General

By Jason Coleman

Structural engineer and technical content manager Bentley Systems by day. Geeky father and husband all the rest of time.

4 comments

  1. Calm down, man! It’ll be okay! It’s not your fault. You are writ­ing the MathML right. It’s just that the web serv­er is not serv­ing your page as XML. So, the brows­er does­n’t know you’ve got XML in there and it’s just dis­play­ing it as HTML.

    There are sev­er­al ways to send the head­er info to the brows­er. One is to use PHP to send an extra head­er to the brows­er before it sends the page. To do this, you have to put this line of PHP:

    header(“Content-type: application/xhtml+xml”);

    at the *very* top of the page.

    Prob­lem is, if IE gets a page that is served as XML (i.e. Con­tent-type: application/xhtml+xml), it gets com­plete­ly con­fused because it does­n’t know what real XHTML is. So, you’d have to use PHP to deter­mine what mime types the brows­er will accept. Then, con­di­tion­al­ly send the header:

    if (stristr($_SERVER[“HTTP_ACCEPT”],“application/xhtml+xml”)) {
    header(“Content-type: application/xhtml+xml”);
    } else {
    header(“Content-type: text/html”);
    }

    I don’t know if all of that is going to come out look­ing right after I sub­mit this form. I guess we’ll see. Give me a call if you want to discuss.

    Cheers.

  2. Okay, as I sus­pect­ed, that PHP code did not come out right. There were some char­ac­ters that Word­Press threw out. I’ll have to send you the code in an email.

  3. All this is not bla­tant­ly obvi­ous to the guy who is read­ing “Learn­ing php 5.” Thanks for all the help. I would call you tonight, but work the bed beck­ons (work tomor­row for the non-self employed).

    So does php need some work in order to be more eas­i­ly reck­on­ciled with XML? I would expect this is a bit piecemill to be using a lot.

  4. It’s not PHP that’s caus­ing prob­lems. It’s actu­al­ly IE’s fault. If it weren’t for IE’s not being able to under­stand real XML, you could just tell Apache to serve all of your files as application/xhtml+xml. I’ll explain in more detail when we have a chance to talk on the phone.

Leave a comment

Your email address will not be published. Required fields are marked *