In XML we have an open opportunity to define our own tags. As it is a
great thing for use at the same time it would be tough task for us to explain
some common tags on the application or display end that how to treat the similar
or equal tags. Equality mean, as we have an idea, that we mostly use of XML
is web
based then, web based applications follows the
HTML conventions mean
they recognize
HTML tags and know how to operate or treat them and suppose some
where else we use the same tag in XML that is defined in
HTML then our
application will fail to operate it as XML tag.
The major example of this
hurdle is that suppose we try to store some information of a patient in a
medical clinic about his body and suppose we use <body> as for his information
and the <body> tag is not allowed we can say, in XML so to avoid this kind of
confliction we will use a technique that is called XML Namespaces to avoid
confliction.
When we create new elements, there is the chance that the element's name already
exists.
XML was designed to be a very weak markup language that could be
used in many different applications. However, with XML being able to
communicate between so many different platforms, there is one problem
that tends to arise. Look at the below example of XML tag names confliction.
On the
above example as we saw that there are two very different elements that want to
use the same naming convention <body>. So the conflictions will occur when any
application will compile or operate the above code. Now the solution to this
problem is to create XML Namespaces, which will differentiate between these two
similarly named elements.
On the above
XML Namespaces of
clinic and
html we have separated the both
bodies, medical clinic and html. By placing a namespace prefix before our own
and
html elements we have re-solved the confliction now.