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

Re: Error handling for SVG and MathML in HTML

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sat, 15 Mar 2008 12:27:40 -0500
Message-ID: <47DC070C.7050209@mit.edu>
To: Ben Boyle <benjamins.boyle@gmail.com>
CC: HTML WG <public-html@w3.org>

Ben Boyle wrote:
> It would be ideal that with text/html parsing rules apply to the
> nested html markup... parser building the dom and working like: found
> SVG element, parse element as XML

This is very difficult to do with a stock XML parser (because you have no way to 
tell it when to stop).  Writing a custom parser is a good way to have a broken 

If you additionally require to switch out of XML mode on hitting <foreignobject> 
containing HTML (which is not a foregone conclusion, but seems like a good 
idea), you _really_ can't use a stock XML parser.

I should note that there are other differences between an "XML parser" and an 
"HTML parser" that have nothing to do with closing tags, attributes, etc, and 
become issues much earlier in the parsing process.  For example, for XML an 
encoding error is supposed to be fatal, while HTML recovers, inserts the 
replacement char, and moves on.

> (That's right isn't it... even when non-conforming markup is parsed,
> the parsing rules are such that a conforming DOM is constructed?)

This part is correct.

Received on Saturday, 15 March 2008 17:28:32 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:31 UTC