Related to xml
Why we write xmlns in xml file
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Priya LingePosted Sep 20, 2011, 1:11 AM
Hi
xmlns is short for XML namespace and this specifies
a unique url to represent the namespace for any custom tags used in the document.
1.It defines an XML Namespace.
2.Basically, every element (or attribute) in xml belongs to a namespace,
•If you exclude any namespace declarations, things are considered to be in the null (or default) namespace.
•If you declare a namespace without the the identifier, i.e. xmlns="http://somenamespace, rather than xmlns:rob="somenamespace", it specifies the default namespace for the document
•The actual namespace itself, often a url, is of no real consequence. It should be unique, so people tend to chose a url that they own, but it has no greater meaning than that. Sometimes people will place the schema (definition) for the xml at the url specified, but that is a convention of some people only.
•The prefix is of no consequence either. The only thing that matters is what namespace the prefix is defined as. Severakl tags beginning with different prefixes, all of which map to the same namespace are considered to be the same.
•Attributes can be namespaced but are generally not. They also do not inherit their namespace from the element they are on, as opposed to elements (see below) a way of "qualifying" the name of the element.
For more information please check.
http://stackoverflow.com/questions/1181888/what-does-xmlns-in-xml-mean
Hope this will help you.
Thanks.
Prabhu RajaPosted Sep 20, 2011, 12:54 AM
we use xmlns attribute to define our Namespace. ns means namespace.
Thank You