Default Namespaces Declaration

  • Usage:

    A default namespace is considered to apply to the element where it is declared (if that element has no namespace prefix), and to all elements with no prefix within the content of that element.

  • Notation:

    <test xmlns="http://www.test.com/" att="whatever">
  • Default Namespace Scoping Example:

    <test xmlns="http://www.test.com/" att="whatever">
      <child att2="value">
        <anotherchild xmlns="" att2="value"/>
      </child>
    </test>
    					
  • Default Namespaces do not apply directly to attributes.

  • If the URI reference in a default Namespace declaration is empty (xmlns=""), then unprefixed elements in the scope of the declaration are not considered to be in any namespace.