Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the significance of trailing slashes in a namespace URI?

I have been studying SOAP and WSDL in preparation for implementing a web service. One thing that I have encountered that puzzles me is that some of the URIs that I have seen use a trailing slash such as:

http://www.w3.org/some-namespace/

while other examples that I have studied omit this trailing slash. I really have several questions regarding this:

  • What is the significance of the trailing slash?
  • Is the URI, http://www.w3.org/some-namespace the same as http://www.w3.org/some-namespace/?
  • If they are not the same, how do I decide when one form is warranted versus another?
  • I have read the guidelines given by w3c regarding URI's and these appear to indicate that that URI should be considered equal only if the case-sensitive comparison of the URI strings are considered equal. Is this interpretation correct?
like image 279
Jon Trauntvein Avatar asked Jan 10 '09 14:01

Jon Trauntvein


1 Answers

Yes, the w3c guidelines regarding URI's you have read are correct.

The two namespaces having not equal-strings-uri's are different namespaces. Even capitalization and white-space matters.

A namespace-uri does not mean that issuing a request for it should produce a web-response. Therefore, any reasoning whether it should or shouldn't end with "/" is not too meaningful.

In fact, a namespace-uri may even not satisfy the syntax rules for an URI and it will still serve its purpose for defining a namespace. It is perfectly useful to use a namespace such as, let's say:

"\/^%$#sdhfgds"

as long as it is unique (do note that in no way I am recommending such use :) ). Existing XML processors (such as parsers, XPath or XSLT processors) do not raise any errors when they encounter such namespace.

like image 170
Dimitre Novatchev Avatar answered Oct 12 '22 10:10

Dimitre Novatchev