W3C home > Mailing lists > Public > public-html@w3.org > August 2007

Namespaces in HTML (Re: Use Cases for The <canvas> Element)

From: Thomas Broyer <t.broyer@gmail.com>
Date: Wed, 1 Aug 2007 20:41:51 +0200
Message-ID: <a9699fd20708011141g7c9c7389o916d8d6e9a747a03@mail.gmail.com>
To: public-html@w3.org

2007/8/1, James Graham:
>
> Doug Schepers wrote:
> >
> > I think that there is a lack of will to integrate SVG into HTML, not a
> > serious technical issue.  As Sam Ruby has pointed out, the namespace
> > issue is hardly insurmountable.
>
> FWIW my perception is that there are enough people interested in making this
> happen that the issue will be seriously addressed at some point even if is not
> appealing to everyone.

For the record, Internet Explorer already has some support for
namespaces: elements name have to contain at least colon (they may
have more, the name is split onto the first colon to isolate the
scopeName from the tagName), the tagName part can be used with
getElementsByTagName.

Test case:
<!DOCTYPE html>
<body>
<a:b:c><a:b:c/></a:b:c>
<script>
var b_c = document.getElementsByTagName("b:c")[0];
w("scopeName: " + b_c.scopeName);
w("tagName: " + b_c.tagName);
</script>

http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cbody%3E%0D%0A%3Ca%3Ab%3Ac/%3E%0D%0A%3Cscript%3E%0D%0Avar%20b_c%20%3D%20document.getElementsByTagName%28%22b%3Ac%22%29%5B0%5D%3B%0D%0Aw%28%22scopeName%3A%20%22%20+%20b_c.scopeName%29%3B%0D%0Aw%28%22tagName%3A%20%22%20+%20b_c.tagName%29%3B%0D%0A%3C/script%3E

Compare the DOM tree of the above with the one of the following, where
colons have been replaced with semi-colons:
<!DOCTYPE html>
<body>
<a;b;c><a;b;c/></a;b;c>

http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cbody%3E%0D%0A%3Ca%3Bb%3Bc%3E%3Ca%3Bb%3Bc/%3E%3C/a%3Bb%3Bc%3E%0D%0A

-- 
Thomas Broyer
Received on Wednesday, 1 August 2007 18:42:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:03 GMT