Error:
=================
"The tags and attributes that don't contain a prefix are part of the default name space, which is declared by simply xmlns:"namespace"."
Explanation:
=================
XML attributes do not automatically inherit the namespace of the element that bears them, whether that element is in the default namespace or an explicitly set namespace. The attribute is said to have no namespace. If an application is parsing for attributes in the namespace 'foo', that application will only find attributes that have the explicit prefix of 'foo'.
Proof:
=================
Using SAX parser with the namespace and namespace-prefix features enabled, analysis of URI, LocalName, and the Qname will demonstrate that an unprefixed attribute is not automatically in the namespace of the element that contains it.
Example:
=================
<peachpit:publisher xmlns:peachpit="http://www.peachpit.com/">
- Element "publisher" has child element "book" which inherits the namespace.
<book title="ADCFMX" author="Forta"/>
</peachpit:publisher>
- Namespace analysis for element "book":
URI: http://www.peachpit.com/
LocalName: book
Qname: peachpit:book
- Namespace analysis for attribute "author":
URI: [empty string]
LocalName: author
Qname: [empty string]:author
Solution:
=================
To bring an attribute into a namespace, the attribute name must be prefixed with the alias for the namespace URI.
Solution example:
=================
<peachpit:publisher xmlns:peachpit="http://www.peachpit.com/">
- Element "publisher" has child element "book" which inherits the namespace.
<book title="ADCFMX" peachpit:author="Forta"/>
</peachpit:publisher>
- Namespace analysis for element "book":
URI: http://www.peachpit.com/
LocalName: book
Qname: peachpit:book
- Namespace analysis for attribute "author":
URI: http://www.peachpit.com/
LocalName: author