The XML namespaces are briefly described in the article XML namespace depth resolution--Introduction to namespaces, and this article describes the differences between namespaces in XML1.0 and XML1.1. Let's start with a small example of the journey of the namespace.
example 1:xml1.0 namespace definition is empty
<xml version= "1.0" >
<root xmlns:pre= "" >
</root>
In this example, when the namespace is bound by xmlns, the URL of the namespace is empty, that is, "", if an attempt is made to parse the file, an error is reported:
The value of the attribute "prefix=" "xmlns", localpart= "pre", rawname= "Xmlns:pre" "is invalid. Prefixed namespace
Bindings May is not being empty.
The reason for the error is that the XML1.0 specification does not allow prefix to be bound to an empty URL, so error. What will happen in the XML1.1?
example 2:xml1.1 namespace definition is empty
<xml version= "1.1" >
<root xmlns:pre= "" >
</root> parsing can be found without an error, because in XML1.1 it is allowed to unbind the namespace and prefix by setting the URL to null.
example 2:xml1.1 namespaces and prefix unbound
<xml version= "1.1" >
<pre:root xmlns:pre= "url" >
<IBM xmlns:pre= ""/>
</pre:root>
In this example, the root element binds the namespace Rul to the pre, that is, the pre is in effect throughout the root, but to the root sub-element IBM, using xmlns:pre= "" To remove the binding, That is, within the scope of the IBM element, the pre will not take effect. This is why the XML file parsing fails in example 3.
Example 3:xml1.1 namespaces and prefix Unbound
<xml version= "1.1" >
<pre:root xmlns:pre= "url" >
<PRE:IBM xmlns:pre= ""/>
</pre:root> parsing of the XML file will be reported to the pre is unbound.
After 3 examples, I believe we all know the difference between the namespaces in XML1.0 and XML1.1, then the problem is that if it is for the default namespace.
Example 4:xml1.0 the default namespace is defined as empty
<xml version= "1.0" >
<root xmlns= "" >
</root> parsing of the XML file succeeds, and XML1.0 and XML1.1 support unbinding with an empty URL for the default namespace.
Example 5:xml1.0 the default namespace binding
<xml version= "1.0" >
<root xmlns= "url" >
<IBM xmlns= ""/>
</root> parsing of the XML file will succeed and IBM will not belong to any namespaces.