Re: [xsl] Namespaces conventions: Why ALWAYS "http:..." tags ?

Subject: Re: [xsl] Namespaces conventions: Why ALWAYS "http:..." tags ?
From: Abel Braaksma <>
Date: Thu, 01 Feb 2007 13:41:53 +0100
Hi Ben,

This sounds like an XML question to me, which when asked on an XML list may yield better responses.

A namespace is defined as a URI. That is a very general form and included the URN and the URL specifications. The 'http:' version is not mandatory in whatever way, but falls under the "URL" type of URI. Microsoft, and I believe OASIS as well sometimes, rather choose URNs instead (like: "urn:microsoft:excel"). There are pros and cons for either of them.

Whether you use 'http' is up to you. You can use 'file' for that matter, or 'didgeridoo'. You are right in that it does not resemble a physical resource.

The most heard reason for using 'http' + domain name is because the http protocol is already defined to be globally unique. So, if you have to choose a namespace and you want to make sure that there are no name clashes, your best bet is to use the http protocol, which is widely known and conveniently fits the requirements. Not so with URNs. Which is why often companies internally choose URNs and for public namespaces choose http URLs (but, compare Microsoft, this is not a requirement and is a matter of taste, really).

Note that relative URLs are discouraged, but they are still allowed.

Much more can be said about pros/cons and naming. I personally, after getting used to it, have found it rather convenient to use http URLs and it saved me many headaches of having to think of yet another naming convention.

Many hints and best practices about namespaces are found here:

From my point fo view it is just a tag or label which could be named
No, it is not a tag or label. You may compare it with an instruction space, language name or scope (but all fail to cover namespaces, really). The namespace prefix can be compared to a tag or label, and can be chosen freely, regardless of the namespace itself.

-- Abel Braaksma

Ben Stover wrote:
Whenever I looked into XSLT stylesheets with namespace declarations I see
ALWAYS a scheme like


or more general


This is somehow confusing because the namespace has nothing to do with a WWW Hyperlinks/URLs.
>From my point fo view it is just a tag or label which could be named


as well
Or is there somewhere a specs which requires a "http...." declaration

What is the reason why all the coders use "http...." URL like namespace names ?


Current Thread