I'm learning XML and web services, but I don't know how I can get an XML namespace when my app is not connecting to the internet?
And I'm using a library that corresponds with an XML namespace, but I don't understand how they are related.
I'm learning XML and web services, but I don't know how I can get an XML namespace when my app is not connecting to the internet?
And I'm using a library that corresponds with an XML namespace, but I don't understand how they are related.
Namespaces in XML 1.0 Recommendation does not require that a namespace URI be able to be used to retrieve anything. So, a connection to the Internet is not required. A namespace can even be named something other than a URL, but the authority and uniqueness aspects of the domain names within a URL are very convenient.
It is also often convenient to place an XSD at the endpoint of the URL given by a namespace. Your concerns about being connected to the Internet probably arise due to this practice, but there is no intrinsic problem here either, at least not with regards to namespaces themselves. If you require access to an XSD for, say, validation purposes, you can keep a local copy and only change the hints provided to the XML processor when you wish for it to retrieve the local rather than remote copy.
For ways to indicate how an XML processor should find an XSD, especially with regards to a namespace, see XML Catalogs or xsi:schemaLocation and xsi:noNamespaceSchemaLocation.
An XML namespace is just used to keep your elements unique if your XML document ever has to interact with other systems, who might have similarly-named elements. The reason why they have URLs attached to them is because domain names are a globally-enforced namespacing mechanism, and as long as everyone follows the convention of using a url, there should be no collisions. in other words, if someone owns the domain spoon.com, then they can be reasonably sure that no one else will use that namespace since it's regulated by ICANN and the like. However, within the spoon.com organization, the members will have to make sure they don't have collisions amongst themselves.
This might be useful to you: Why are URLs in XML namespaces?