[whatwg] markup as authored in practice (was: something about slashes)

On 11/30/06, Ian Hickson <ian at hixie.ch> wrote:
>
> > I'd gladly put in a <!DOCTYPE html> in my page, the question is: would
> > the WHATWG be willing to meet me half way and allow xmlns attributes in
> > a very select and carefully prescribed set of locations?
>
> This seems like a bad idea. If you have HTML, parse it as HTML. If you
> have XML, parse it as XML. Don't try to use an XML parser to parse HTML or
> vice versa. The syntaxes, although superficially similar to the extent
> that it is possible to make a single document that is parsable using
> either processor, are not similar enough to be treated equivalently.

I think the point is more subtle.

>
> > My theory is that we live in a cut and paste world, one based on partial
> > understanding.  Few understand DOCTYPEs and xmlns attributes, mostly
> > people crib from something that works.
>
> Too true.

I haven't done a study, but the observation you've agreed with is very
accurate in my experience. If you assume that most people don't
understand xmlns attributes, and most people use very few namespaces,
you'll find that xmlns attributes that bind the default namespace are
most common. I suspect this is because they are very easy to cut and
paste in a modular fashion. In syndication feeds, there are colloquial
default namespace prefixes (dc *always* means Dublin Core), but that
is an edge case.

When the 'xmlns:dc' attribute name is encountered, most people are
using it as a magic flag. It is almost never a good example of
decentralized naming, with an arbitrary prefix and scope.

So, is it poisonous to allow

<!DOCTYPE html>
<html lang="en-US">
 <head> <title> Demonstration </title> </head>
 <body>
 <div>
  <p>hmm</p>
  <svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"
style="float:right">
  </svg>
 </div>
 </body>
</html>

in HTML5? Basically, user-defined tags would be allowable if the
boundary between HTML5 and those tags were delineated with a URI in an
attribute with the name 'xmlns' (no prefix machinery). This suggestion
should not be confused with using an XML parser or XML Namespaces to
process HTML5.

-- 

Robert Sayre

Received on Friday, 1 December 2006 01:39:36 UTC