In general, a namespace uniquely identifies a set of names so that there is no ambiguity when objects having different origins but the same names are mixed together. Using the Extensible Markup Language (XML), an XML namespace is a collection of element type and attribute names. These element types and attribute names are uniquely identified by the name of the unique XML namespace of which they are a part. In an XML document, any element type or attribute name can thus have a two-part name consisting of the name of its namespace and then its local (functional) name.
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
For example, suppose the same XML document included the element type of OWNER for owners of motorcycles as well as for owners of automobiles. It might be necessary or desirable to know that an owner name was one of those who owned a motorcyle rather than an automobile. Having different motorcycle and automobile namespaces would make this possible. Effectively, it would make it possible to label motorcycle owners differently than automobile owners without having to create a different element type for each.
In XML, a namespace is commonly given the name of a Uniform Resource Identifier (URI) - such as a Web site's address - both because the namespace may be associated with the site or page of that URI (for example, a company name) and because a URI is conveniently likely to be a unique name. Note that the URI is not necessarily intended to be used other than as a name nor is there any namespace document or XML schema that must be accessed; the URI is simply used as a name (and part of the two-part name of any element type or attribute name so that the names are unique within the document).