Why namespaces?

Paul Prescod paul at prescod.net
Wed Sep 1 00:52:10 BST 1999


> Who said that they cannot be mixed?  

The XHTML specification: "Future work by W3C will address ways to
specify conformance for documents involving multiple namespaces."

> XHTML documents cannot (yet)
> contain markup from other Namespaces, but anyone else designing a
> document type is free to include HTML markup in theirs (say, for
> documentation in a schema).

What is the point of referencing a specification if you cannot define
conformance? I would say that it is downright a bad idea to "mix in"
HTML until there are rules for what is legal or not legal in doing so.
Right now, this is perfectly legal:

<book xmlns='urn:loc.gov:books'
       xmlns:isbn='urn:ISBN:0-395-36341-6' xml:lang="en" lang="en">
  <title>Cheaper by the Dozen</title>
  <!-- make HTML the default namespace for a hypertext commentary -->
  <p xmlns='http://www.w3.org/TR/xhtml1/strict'>
This is <title>also <table>available <a
href="http://www.w3.org/">online</a>
 </table>.... </title>.
        </p>
    </notes>
</book>

I personally don't think that the XHTML specification should even
mention the possibility of mixing in without defining contraints or
semantics.

> In fact, without a global naming scheme, I cannot even reliably answer
> the following question for an arbitrary XML document (say, text/xml):
> 
>   "Is this an HTML document?"
> 
> The DOCTYPE declaration doesn't help at all here, as Eliot has
> repeatedly (and convincingly) pointed out -- DTDs are for
> guided-authoring and for validation, not for recognition.

It helps to the exactly the same degree that the namespace declaration
does. You aren't supposed to use the XHTML doctype on a document that
isn't HTML. That can't be checked entirely by any software short of a
full HTML validator but that's not the point: it's a societal/legal
declaration, not something computer-checkable.

That's exactly the same case with namespaces. There is no off-the-shelf
software that can check that a document "conforms" to the rules of its
namespace (if indeed there are any such rules). Unfortunatley, proper
use of either XHTML declaration must be enforced in courts, not
software.

 Paul Prescod

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list