[whatwg] innerHTML in HTML documents with multiple namespaces

Asbjørn Ulsberg asbjorn at ulsberg.no
Mon Apr 2 03:30:13 PDT 2007

On Tue, 27 Mar 2007 16:39:05 +0200, Thomas Broyer <t.broyer at gmail.com>  

> In other words, what should document.body.innerHTML end with after this  
> script: var svg_svg =  
> document.createElementNS("http://www.w3.org/2000/svg",
> "svg:svg"); document.body.appendChild(svg_svg);

As long as the result stays well-formed and qualified, does it really  

> Should it end with "<svg></svg>" or "<svg:svg></svg:svg>"? (Firefox
> would have "<svg></svg>")

Imo, it would be <svg xmlns="http://www.w3.org/2000/svg"></svg> or  
<svg:svg xmlns:svg="http://www.w3.org/2000/svg"></svg:svg>. The  
deserialization of those XML fragments produce the same DOM and are thus  
equal. If the namespace URI is already defined somewhere in the DOM, I  
suppose the registered prefix should be used instead.

> Also, should the "tag name" be lowercased before inclusion in the
> output or the algorithm is just assuming the "tag name" of HTML
> elements have already been lowercased elsewhere?

I think that non-XHTML elements should stay "as entered".

> Same questions with attribute names ;-)

Same answer, imo. :)

Asbjørn Ulsberg           -=|=-        asbjorn at ulsberg.no
«He's a loathsome offensive brute, yet I can't look away»

More information about the whatwg mailing list