Posted By: Bas | Aug 31st @ 4:22 AM
page 1 of 1
Comments: 6 | Views: 737
Bas
Bas
It finds lightbulbs.
XML namespaces are usually in the form of a URI, like for instance http://schemas.microsoft.com/winfx/2006/xaml or http://www.w3.org/1999/XSL/Transform. Why is that? They don't necessarily point to any definitions or pages, they're just arbitrary strings. So why the http prefix? Or the www subdomain? Wouldn't it have made more sense to define an organisation/technology/year-like format for these things, like "W3/XSL/1999/Transform" or "Microsoft/Winfx/2006/xaml"?

I don't know, I find it unnecessarily confusing to refer to http, for instance, when it has nothing to do with that protocol. Even if you figure that domains uniquely identify organisations, wouldn't have made more sense to just use the domain name as the organisation-identifier? So "w3.org/1999/XSL/Transform" and "microsoft.com/winfx/2006/xaml", removing references to the world wide web (which it isn't on) and the http protocol (which isn't being used)?
stevo_
stevo_
Casablanca != Manchester
Dunno, as far as I'm aware it was because if someone wanted to get more information about the namespace, they could visit the URL and you could provide information about it there.

Don't think anyone actually does that though..
Sven Groot
Sven Groot
You can't have everything; after all, where would you put it?
You can of course put the schema or something at such a url. As it is, using your own domain in the namespace name is at least a good way to ensure they are unique.

Note that namespaces are URIs, so they can be URNs as well as URLs. If you don't like using URLs, why not use "urn:whatever" instead? Microsoft does this as well sometimes; for instance the namespace for manifest files is "urn:schemas-microsoft-com:asm.v1" (or v2 and v3 respectively, depending on what features you want to use).

EDIT: In the end they are nothing more than strings to an XML parser, even though they have to be the format of a URI. As long as it matches the string in the schema, the parser doesn't care what it is.
littleguru
littleguru
allein, allein,... allein, allein!
AFAIK it only needs to be unique - as was pointed out. URIs are a handy way to somehow guarantee uniqueness... even more if you OWN the domain you are referring to. But you could also go with GUIDs and would be completely fine.

They probably use URIs in XML because XML was intended to be a standard to interchange data over the network and in general... and someone might have thought: yeah URIs (or URLs) sound cool to me.
TommyCarlier
TommyCarlier
Trust me, I'm from the Internets
The "Uniform Resource Identifier" article on Wikipedia has a paragraph that explains the relation between URIs and XML namespaces.
Yep I agree with you Bas I find the http prefix confusing as it implies a relationship that is not there.
page 1 of 1
Comments: 6 | Views: 737