I’ll join in the fun. The CVS HEAD version of the Universal Feed Parser now supports “Jacques Distler’s subset of MathML”.
Take a look at this test feed. MathML. In RSS 2.0. No declaration of xlink anywhere to be found. It is not even well-formed XML (missing angle bracket on closing rss element). No problem.
These changes have also gone into my branch of planet (Note to Jeff, this can wait for a 1.1 or 2.0 release; please get a 1.0 out as soon as possible).
Jacques: what more do I need to do to make Planet Intertwingly itself support MathML? Is it just a matter of a proper DOCTYPE and Mime type at this point?
DOCTYPE schmocktype!
If it’s well-formed XML, just send it out to compatible browsers as application/xhtml+xml.
Unfortunately, it currently contains HTML named-entities. You’ll need to convert those to NCRs or UTF-8 characters.
It’s also, currently, not well-formed. (Bill Humphries “Post WisCon” post is ill-formed.) So you’ve got a little bit of work left.
If you want to avail yourself of the W3C Validator, and wish to avoid wading through the MathML-induced errors (you’ll still have to wade through the missing alt-attribute errors), use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" >
Unfortunately, it currently contains HTML named-entities. You’ll need to convert those to NCRs or UTF-8 characters.
Isn’t that what the DTD is for?
In a validating XML parser, yes. Browsers, however, don’t use a validating parser. They use a pseudo-DTD to resolved named entities in “known” DOCTYPEs.
If you want all browsers to do the right thing, you either do what I used to do (send application/xhtml+xml only to a select set of browsers known to support XHTML+MathML) or convert all the “unsafe” named entities to NCRs, and send application/xhtml+xml to all browsers that claim to ACCEPT it.
N.B.: I still browser sniff for IE6 with the MathPlayer plugin installed. Despite not really being an XHTML-UA, it does render the MathML if you send the document with an application/xhtml+xml MIME-type.
If you want all browsers to do the right thing, you either do what I used to do (send application/xhtml+xml only to a select set of browsers known to support XHTML+MathML) or convert all the “unsafe” named entities to NCRs, and send application/xhtml+xml to all browsers that claim to ACCEPT it.
I went with utf-8. Seems to be working w/firefox 1.5.
Considering the dog’s breakfast of input you’re starting with, it’s quite amazing that, at the end of the day, well-formed XHTML comes out the other end.
Considering the dog’s breakfast of input you’re starting with, it’s quite amazing that, at the end of the day, well-formed XHTML comes out the other end.
You think that’s a dog’s breakfast of input? Take a look at this.
Planet orchestrates. UFP worries about feeds. BeautifulSoup worries about HTML. I just had to convince each of them to accept a few patches.
Ah the synergies, Sam Ruby talk about getting MathML supported in planet, and the Ephox weblog talks about getting EditLive! for Java to automatically upload image versions of MathML equations so they render in any browser. The nice thing about...
Ah the synergies, Sam Ruby talk about getting MathML supported in planet, and the Ephox weblog talks about getting EditLive! for Java to automatically upload image versions of MathML equations so they render in any browser. The nice thing about...