[html4all] default namesapce declarations

Robert J Burns rob at robburns.com
Tue Apr 29 03:21:37 PDT 2008


Hello all,

Yesterday I raised namespaces (along with parsing) as the only thing I  
think HTML 4.1 should be focussed on right now. After further  
reflection on that I had some more ideas. First, many in the WhatWG  
claim that namespaces are unwieldy. While I find this claim way  
overblown, I had an idea that could probably satisfy most of the  
WhatWG concerns and also make authoring with HTML4.1 (or HTML5  
whatever one wants to call it) a lot easier.

HTML5 could make default namespace declarations. These could be  
overridden by  authors at their discretion, but for other authors,  
they would never need to think about the namespace URIs.

It would work something like this. We would declare several default  
attributes values for the root HTML element.

For the extensions from HTML5 (i.e., proposed content models, new  
elements, and new attributes):
xmlns:h4='http://www.w3.org/1999/xhtml'

For
xmlns:svg = 'http://www.w3.org/2000/svg'


Also include default namespace declarations of:

  • xmlns:a (for ARIA);
  • xmlns:m (for MathML);
  • xmlns:ev (for XEvents);

and any others we feel authors will want to use easily and meet  
certain agreed upon criteria. These namespace declarations would all  
be the default values for these attributes on the HTML root element.

This would allow authors to incorporate these other standards into  
their HTML documents without making any xmlns declarations. They could  
at their own option make new declarations that would override these  
defaults, but I think that would seldom happen. The issue as I see it  
is that the W3C wanted to set a good example for others by choosing  
namespaces that were fully qualified http schema identifiers. On the  
other hand, since these are so often the basis from which we use other  
namespaces, it would have been nice to have namespaces that were much  
shorter, and make declarations for other namespaces. This solution  
addresses the problem in a way that satisfies both goals: 1) W3C  
continues to set a good example by using fully qualified http schema  
URIs as their namespace URIs; 2) authors can use minimized and easily  
remembered prefixes without necessarily ever encountering a namespace  
declaration.

A simple example document making use of this approach might look like  
this:


<html lang='en' >
<head>
...
<h4:meta name='abstract' >
An abstract of the document with <em>rich</em> markup …
</h4:meta>
</head>
<body>
<h4:section>
<h4:h>A heading<h4:h>
<h4:p>some text and then
<ul>
<li>A list of items within a paragraph</li>
...
</ul>
<p>just a regular paragraph with <em>only strictly inline</em> content  
a and an img <h4:img id='myimg' alt='' >a lengthy description of the  
image</img>
Another copy of the same image with the color adjusted <img  
a:described-by='myimg' >
</p>
<h4:p>
<m:plus> some more MathML content…</m:plus>
</h4:p>
</h4:section>
</body>


If we do this right, the above namespaced content should work in IE (I  
think back to IE5 or IE6: i.e., back nearly a decade). The other  
browsers could be more responsive in adopting the namespace mechanism  
to text/html, but the same document could be authored for serving to  
IE back to IE5 as text/html and the other browsers as XHTML. Obviously  
there could be all sorts of nagging issues to get in the way, but its  
worth consideration. Once namespaces had been added to all browsers  
for text/html authors could easily choose to use text/html or  
application/xml+xhtml at their own discretion.

Take care,
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wilbur.bytowninternet.com/pipermail/list_html4all.org/attachments/20080429/94d5806e/attachment-0001.html 


More information about the List_HTML4all.org mailing list