[whatwg] Getting .innerHTML in XML well-formedness issues

Anne van Kesteren fora at annevankesteren.nl
Sat Oct 28 09:32:58 PDT 2006

On Sat, 28 Oct 2006 15:12:46 +0200, Henri Sivonen <hsivonen at iki.fi> wrote:
>> One idea would be to update DOM Level 3 Core to make sure you can never  
>> get documents that are not serializable. I don't really know if that's  
>> feasible though.
> In that case, the HTML parsing section would need to be revised to  
> forbid element and attributes names that are not conforming XML 1.0 +  
> Namespaces local names, to forbid non-XML characters in character data  
> and attribute values and to forbid "--" in comments.

Not really, as innerHTML works differently for HTML documents.

> Personally, I'd welcome such a change, since it would truly make  
> text/html an alternative infoset serialization for a subset of XML 1.0.

I suppose you mean Namespaces in XML 1.0? I guess that might be useful.

> Non-browsers that use XML tools to process HTML5 will have to enforce  
> those constraints anyway in one way or another. Current text/html  
> browsers don't, though.
> Or did you mean that browsers would not enforce XML 1.0 serializability  
> if the DOM was created by parsing text/html? Would you then throw an  
> exception if a subtree is imported from such a DOM into a DOM that  
> enforces serializability?
> The exposure of CDATA sections in the DOM is, IMO, a design flaw in the  
> DOM. I wouldn't mind serializing them as normal character data.

Yes, it would be really nice if we could drop the whole CDATA section  
thing from the DOM. Together with entities...

Anne van Kesteren

More information about the whatwg mailing list