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:
“I foresee the time when the painter will paint that scene, no longer going to Rome for a subject; the poet will sing it; the historian record it; and, with the Landing of the Pilgrims and the Declaration of Independence, it will be the ornament of some future national gallery, when at least the present form of slavery shall be no more here. We shall then be at liberty to weep for Captain Brown. Then, and not till then, we will take our revenge.”
—Henry David Thoreau (18171862)