Skip navigation.

exploreopera

| Help

Sign up | Help

Posts tagged with "browers"

IE, XHTML, MathML and SVG!

, , , ...

Yes! They can all be one happy family!

A few weeks ago I was fiddling with MathPlayer, a MathML viewer for IE. What I glanced at without letting it sink in, was that MathPlayer recommends you serve your pages using the 'application/xhtml+xml' MIME type.

The important thing is that with an appropriate DOCTYPE, MathPlayer will detect that and automatically switch IE from XML mode to HTML mode. So, with MathPlayer you can use XHTML and serve it with the correct MIME type for all browsers, without any need for special server-side processing for IE! Of course, you don't need to use any MathML on your page. You can just use MathPlayer to give IE support for correctly-served XHTML.

The next piece in the puzzle is SVG. Adobe have their SVG Viewer. Sadly, they're discontinuing it from 1 Jan 2009, even though it's currently the only way to get SVG into IE. Edit: Not true, there's also Renesis Player.

A little bit of Googling turned up a demo by Peter Jipsen that combines XHTML, MathML and SVG on the one page, served as 'application/xhtml+xml', and displays just fine in IE (with the aforementioned plugins), Firefox, and Opera (9.50 windows build 9656 or equivalent for MathML). Safari works too, apart from the MathML.

Stripped down, the page code is valid, very simple, and has a small concession for Adobe's SVG viewer:
<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:svg="http://www.w3.org/2000/svg">
  <head>
    <title>A XHTML document with ASCIIMathML, MathML and SVG</title>
     
    <!-- for inline Adobe SVG: -->
    <object id="AdobeSVG" classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2">
    </object><?import namespace="svg" implementation="#AdobeSVG"?>
    
  </head>
  <body>
    <p>MathML
      <math xmlns="http://www.w3.org/1998/Math/MathML">
        <mfrac>
          <mi>a</mi>
          <mi>b</mi>
        </mfrac>
      </math>
      
and SVG
      <svg:svg width="50px" height="50px">
        <svg:circle cx="25px" cy="25px" r="20px" fill="green"/>
      </svg:svg>
    </p>
  </body>
</html>


Christmas wish for 2007: That Microsoft start bundling Adobe's SVG Viewer and Design Science's MathPlayer plugins with IE, and make them a Windows Update. :wizard:

It would be a huge step forward for web standards, bring IE into close parity with Firefox and Opera, all for next to no effort for Microsoft.

And while we're at it, world peace would be nice too. :angel:
October 2008
SMTWTFS
September 2008November 2008
1234
567891011
12131415161718
19202122232425
262728293031