Namespace Declaration
An XML namespace is declared using the reserved XML pseudo-attribute xmlns
or xmlns:prefix
, the value of which must be a valid namespace name.
For example, the following declaration maps the "xhtml:" prefix to the XHTML namespace:
xmlns:xhtml="http://www.w3.org/1999/xhtml"Any element or attribute whose name starts with the prefix "xhtml:" is considered to be in the XHTML namespace, if it or an ancestor has the above namespace declaration.
It is also possible to declare a default namespace. For example:
xmlns="http://www.w3.org/1999/xhtml"In this case, any element without a namespace prefix is considered to be in the XHTML namespace, if it or an ancestor has the above default namespace declaration.
Attributes are never subject to the default namespace. An attribute without an explicit namespace prefix is considered not to be in any namespace.
Read more about this topic: XML Namespace
Famous quotes containing the word declaration:
“The principle of all sovereignty resides essentially in the nation.”
—French National Assembly. Declaration of the Rights of Man (Sept. 1791)