aspose file tools*
The moose likes XML and Related Technologies and the fly likes XML namespace - what is purpose? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML namespace - what is purpose?" Watch "XML namespace - what is purpose?" New topic
Author

XML namespace - what is purpose?

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1531
What are xml namespaces? and why is that we often use URLs in them?

I created



and opened it in IE. I did not get any complaint from the browser that http://something.com is invalid namespace or anything such.

I was expecting that I get some error stating either I have some wrong URL or my xml is not properly formed as per the URL, as I have not placed any DTD/XSD or anything on that URL.

If there is no link between the URL and the XML then what is the purpose of having XML namespace?

Also my other question is that do I need to be connected to internet for non-local URLs in namespaces?


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
A namespace identifier is not an URL, it is a URI - a very important distinction! As such it does not need to be related to an actually existing domain (although that may sometimes make sense), nor can it be verified in any way by making a network call. A namespace serves to uniquely identify element names, so that it's possible to have XML documents like this:

and it's always clear which "foo" element is meant - the two may be very different in meaning!


Ping & DNS - my free Android networking tools app
 
wood burning stoves
 
subject: XML namespace - what is purpose?