W3C home > Mailing lists > Public > www-validator@w3.org > August 2008

Re: More transparency concerning "Missing xmlns attribute for element html" or [VE][no-xmlns]

From: Frank Ellermann <nobody@xyzzy.claranet.de>
Date: Sat, 16 Aug 2008 03:37:45 +0200
To: www-validator@w3.org
Message-ID: <g85atn$scr$1@ger.gmane.org>

doug shults wrote:
 
> Can someone please explain what this means.

Somebody will correct me when (not if :-) I get this wrong.

In XML all tags and attributes are actually shorthands for
long globally-unique-identifier-somewhere-tag names.

E.g., <div> could mean what it is in (X)HTML, and it could
be about a div-operator in MathML.  In documents where you
actually mix (X)HTML <div> and some other <div> it has to
be clear what is what.

For that purpose you define "prefixes" for the different
namespaces with xmlns, example:

 xmlns:a="globally-unique-identifier-somewhere"

After that it is in theory clear what <a:div> means, or at
least it is clearly not the same as <b:div>, <xml:div>, or
a plain <div>.

The <xml:div> case is special, you don't need an explicit
namespace definition for it, anything starting with "xml"
is whatever the W3C says it is.  As it happens there is no
such thing as an <xml:div>, but xml:lang is no nonsense.

The plain <div> case is also special, it uses the "empty"
namespace:  not "a", "b", "xml", etc., but "", empty.  The
empty namespace needs an explicit definition.

For XHTML you use the following definition:

 xmlns="http://www.w3.org/1999/xhtml"

Put that in the <head> tag at the begin of your document.

It is clearly obscure for a simple XHTML 1 document, where
you use only one empty namespace in addition to the special
xml:lang and implicit xml:space cases.

But the validator is a script, it doesn't know what is and
what is not obscure, and it supports other document types,
where using more than one namespace is important.

 Frank
Received on Saturday, 16 August 2008 01:36:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:30 GMT