What is a namespace ... really?

Roger L. Costello costello at mail11.mitre.org
Fri Jan 15 18:27:13 GMT 1999

I have been closely monitoring (with great interest!) all the discussion
arising from my question on what is a namespace.  It seems that people have
differing ideas on what it is. I would like to try to summarize the points
of view, and add my own two cents.

(1) A namespace is just a URI.  It references some domain.  It is simply
there to tell an application/processor what domain the associated XML
elements hail from.

(2) A namespace is a URI to a DTD.  It references a domain and also a DTD
within the domain.  In addition to telling an application/parser what
domain the associated XML elements hail from, with this namespace
declaration a validating parser could validate that portion of your XML
document against the DTD at that URI.

So, with point-of-view (2) this is a valid namespace declaration:

<BookCatalogue xmlns="file://localhost/BookCatalogue.dtd">

and this is not a valid namespace declaration:

<BookCatalogue xmlns="file://localhost/">

because there is no referenced DTD at that domain.

Is this a fair assessment of the points of view?

My two cents:

What is the purpose of namespaces?  It is my understanding that the purpose
of namespaces is twofold:

(a) Disambiguation.  e.g., if BookCatalogue is defined in another
    DTD that you are using then namespaces allow you to distinguish
    BookCatalogue in DTD A from Bookcatalogue in DTD B

(b) Reuse/validation. e.g., if you declare that BookCatalogue
    comes from a DTD in some domain then conceivably a parser
    could validate that portion of the XML document.

Who's right?  What is "truth"?  /Roger

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/
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