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

Re: innerHTML in XML

From: Julian Reschke <julian.reschke@gmx.de>
Date: Sun, 01 Jun 2008 13:07:51 +0200
Message-ID: <48428307.1030200@gmx.de>
To: Ian Hickson <ian@hixie.ch>
CC: Cameron McCormack <cam@mcc.id.au>, public-html@w3.org

Ian Hickson wrote:
> On Sun, 1 Jun 2008, Cameron McCormack wrote:
>> Currently the spec says:
>>   If any of the elements in the serialization are in the null namespace,
>>   the default namespace in scope for those elements must be explicitly
>>   declared as the empty string.
>>    — http://dev.w3.org/html5/spec/#innerhtml1
>> Is there any reason for this?
> If we didn't do this, round-tripping would break. For example this:
>     <foo xmlns="a:"><bar xmlns=""/></foo>
>     foo.innerHTML = foo.innerHTML;
> ...would turn the DOM into the equivalent of:
>     <a:foo xmlns:a="a:"><a:bar/></a:foo>

I guess the question was whether this is a requirement that exceeds 
normal XML serializations requirements.

For the example, yes, obviously the xmlns="" is required.

The question is, is it required to add the xmlns="" in cases like

	<foo xmlns=""><bar xmlns=""/></foo>


It wouldn't be needed for the sake of a correct XML serialization, but 
it would be *useful* to make copy & parse robust.

BR, Julian
Received on Sunday, 1 June 2008 11:08:35 UTC

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