W3C home > Mailing lists > Public > public-html@w3.org > June 2008

Re: Trying out SVG and MathML parsing

From: Philip Taylor <pjt47@cam.ac.uk>
Date: Thu, 19 Jun 2008 19:47:44 +0100
Message-ID: <485AA9D0.50405@cam.ac.uk>
To: Henri Sivonen <hsivonen@iki.fi>
CC: "public-html@w3.org WG" <public-html@w3.org>

Henri Sivonen wrote:
> There was some discussion about SVG parsing on IRC today. Since I 
> happened to have something almost ready, I figured I'd put a build out 
> there before I head to Midsummer/St.John festivities (national holiday; 
> big deal over here). [...]

I tried this by taking a few hundred random SVG files from Wikipedia, 
passing them through html2xml to produce XHTML output, then visually 
comparing against the originals. The problems I noticed are:

* Lots have attributes like xlink:href and sodipodi:version and 
i:vieworigin, which make html2xml's output ill-formed since it doesn't 
provide an appropriate xmlns. (This may have masked other problems from 
me, since it made most of the images unviewable.)

* HTML5's treatment of <font> (i.e. exiting from the SVG mode) breaks a 
number of images:


* In many cases, Illustrator's fancy doctype tricks like:

   <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
     "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
       <!ENTITY ns_svg "http://www.w3.org/2000/svg">
       <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
   <svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" ...

make the text "]>" appear in the <body> (because HTML5 breaks out of the 
doctype when it sees the first '>'). (Also it triggers 

* Often the sizes seem to get broken so the SVG-in-XHTML image is tiny 
or huge, e.g. 
<http://upload.wikimedia.org/wikipedia/en/6/69/CDGlogo.svg> vs 
<http://philip.html5.org/misc/CDGlogo.xhtml>. (I don't know enough about 
SVG sizing to understand why this problem occurs.)

* The "gradientUnits" attribute is converted into "gradientunits" which 
doesn't work, breaking 

Apart from those problems, it appeared to work fine on that SVG content.

Philip Taylor
Received on Thursday, 19 June 2008 18:48:23 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:32 UTC