[ACCEPTED]-Why are URLs in XML namespaces?-xml-namespaces

Accepted answer
Score: 21

When you ask why a standard is the way it 27 is, there are two possible interpretations 26 of your question: (a) what are the perceived 25 benefits of the design choice that was made, and 24 (b) what was the historical sequence of 23 events that led to this design being adopted 22 over other designs.

Clearly, using HTTP-like 21 URIs gives uniqueness. But that could also 20 have been achieved in other ways, for example 19 by inventing a new URI scheme. I think that 18 if you trace the arguments that were made 17 at the time, you will find that many of 16 the people advocating the use of HTTP-style 15 URIs were also advocating that namespace 14 URIs should be dereferencable, perhaps to 13 a schema or to some other kind of document. Indeed, it's 12 W3C policy for its own namespaces that there 11 is always a document that can be retrieved 10 when you type the namespace URI into a browser, and 9 that it should tell you something useful 8 about the namespace.

So I suspect the fact 7 that we use URIs that look deferenceable 6 but don't define any semantics for what 5 happens when they are dereferenced is in 4 fact the result a committee compromise between 3 two or more opposing camps. But you'd have 2 to do some proper historical research to 1 confirm that.

Score: 13

It's just a convention. URIs (which is what 6 they are, not really URLs) are a convenient 5 and globally-familiar way of identifying 4 resources. On the other hand, .NET-style 3 identifiers are familiar and recognisable 2 to, well, .NET developers - there's rather 1 more to XML than .NET.

Score: 5

W3 explanation Here

Just like namespaces in .NET, namespaces 9 in XML documents are designed to help prevent 8 and resolve name collisions, especially 7 if XML documents are from different organizations 6 and/or domains of knowledge.

XML document 5 format has been stylized by the same people 4 responsible for HTML, so you may find syntactical 3 similarities in elements of the format. Semantically, the 2 dotNET and XML namespaces serve the same 1 goal.

Score: 2

The core of the problem is that namespaces 10 have to be URIs. There is no good reason 9 for such a thing since all it needs to be 8 is a unique identifier to give context for 7 the defined elements.

Since they have to 6 be URIs, all possibilities are senseless, because 5 a scheme is needed (e.g. http) even though 4 a namespace has nothing to do with such 3 a thing.

So to answer the question of why: like 2 all bad ideas, someone thought it was a 1 good idea at the time.

More Related questions