[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Namespaces conventions: Why ALWAYS "http:..." tags

Subject: Re: Namespaces conventions: Why ALWAYS "http:..." tags ?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 01 Feb 2007 13:41:53 +0100
Re:  Namespaces conventions: Why ALWAYS "http:..." tags
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: http://www.xfront.com/BestPracticesHomepage.html

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.

Cheers,
-- Abel Braaksma
  http://www.nuntia.nl




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

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

or more general

xmlns:foo="http://www.somedomain.com/foobarlabel"

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


xmlns:foo="aabbccdd"

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 ?

Ben

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.