Forum Moderators: open

Message Too Old, No Replies

Xml namespaces-Concept

some basics

         

kadnan

12:52 pm on Jun 7, 2006 (gmt 0)

10+ Year Member


I understand the concept of namespace but in XML i often see things like:

xmlns:foo="http://www.foo.org/" xmlns="http://www.bar.org/">

and sometimes they refer to some external Uri.Why do we need an external Uri and how does it work even if we are not online?

Thanks

dmorison

1:06 pm on Jun 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Kadnan,

The value of an xmlns (name space) just has to be unique. There is no requirement for it to be a URI, and even when it is, anything processing the XML doesn't have any need to contact that URI.

They are most often URI's however because the easiest way for your organisation to create a unique string without any kind of globally coordinating standards body is to use something based upon an Internet domain name that your organisation has control over. That way, nobody else is likely to duplicate your namespace.

This is most often done where an extension to an existing XML vocabulary is created, and therefore a unique namespace is required to avoid conflict with other extensions that may be applied to the same base format. Where a namespace value is a URL, it is quite common for the documentation of that namespace to be published at that URL.

kadnan

5:37 am on Jun 8, 2006 (gmt 0)

10+ Year Member


Thankyou for clarifying,however I still have few stupid question in mind.

1)is there any relation of Namespace with Scheme?

Forinstance i make a language have following entities

<at:Personal>
<Name>Adnan</Name>
</at:Personal>

this is the pattern available in my language here my language implementer forgot using "at" then how do I make him sure that he has to use in "at:Name" format.Does namespace will take care of it itself?

2)is there any relation b/w Schema and Namespace?

Thanks