For a short answer, see Michael Kay's answer to a similar question. For a long version read on...
The XML Namespaces specification itself does not mandate the use of such long URLs:
The namespace name, to serve its intended purpose, SHOULD have the characteristics of uniqueness and persistence. It is not a goal that it be directly usable for retrieval of a schema (if any exists). Uniform Resource Names [RFC2141] is an example of a syntax that is designed with these goals in mind. However, it should be noted that ordinary URLs can be managed in such a way as to achieve these same goals.
...so the W3C specs, including SVG, could have used a shorter name, like urn:w3c:svg
.
However, as noted in Architecture of the World Wide Web, using a URL as the namespace name allows (while still guaranteeing uniqueness) publishing a "namespace document" with information about the namespace. The shortest name that doubles as a URL would be http://w3.org/svg
(The value of a namespace URL pointing to a "namespace document" seems low in today's world where no-one can imagine life without a search engine like Google, but you can try to understand people in 90s not relying on a search engine for the architecture of the web.)
There are many working groups at W3C (most working on relatively obscure topics), so they came up with a policy for allocating namespace URLs of form http://www.w3.org/YYYY/MM/ssss
. The policy includes a rationale:
- for keeping "www.": "to duplicate the site at both addresses [with and without the www. prefix] would trash the efficiency of caches, indexes and archives all over the world." - heh
- for YYYY and MM (digits corresponding to the year and month of URI allocation): "This syntax enables the W3C support staff to ensure very high level of persistence for namespace URIs ... Group participants should bear in mind that the W3C Team will be maintaining this Web space long after the groups have become more interested in other topics or have been closed."
Later the policy was amended to allow year-less URLs (http://www.w3.org/ns/ssss
), but it was too late for SVG.
As an interesting historical aside, the "Origin and Goals" of the XML specification states, "Terseness in XML markup is of minimal importance" - which is said to be a result of "the complexity and difficulty of SGML [...] greatly increased by its use of minimization." But in the end, the attempt to switch the web to XML failed and as of today, the standards allow using SVG inside HTML without specifying namespaces.