Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: Abel Braaksma <abel.online@--------->
To:
Date: 2/1/2007 12:43:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent