title: XML namespaces conflicts
body: <p>I was wondering why do we have to define our namespaces with an URI that is unique for our organization (just like packages in Java). That would obviously make sense and let us avoid name conflicts. However, <a href="http://www.sitepoint.com/xml-namespaces-explained/" rel="nofollow">this page</a> says:</p>
  
  <blockquote>
    <p>It is also possible (though not recommended) for the same prefix refer
    to different namespaces, depending on their context</p>
  </blockquote>
  
  <p>So basically if I have my own XML document with my own namespace prefix <code>myNamespace</code> defined as <code>http://hisdomain.com/test</code>, somebody could redefine the 'myNamespace' prefix to point to his own namespace <code>http://hisdomain.com/test</code>, <strong>even by mistake</strong> (I think there is no alert if I define a namespace prefix that has been already defined in the document).</p>
  
  <p>Even with URIs, other people need to make sure they don't use my prefix!</p>
  
  <p>Then using URIs and having to provide definitions to namespaces becomes useless, the namespace system would work equally well if we simply used the prefixes only without having to provide definitions using <code>xlns</code> attribute.</p>
  
  <hr>
  
  <p>If I understand correctly, this is not allowed:</p>
  
  <pre><code>&lt;root xmlns:abc="mydomain.com/test" xmlns:abc="yourdomain.com/test"&gt;
  ...
  &lt;/root&gt;
  </code></pre>
  
  <p>but this one is okay - you could redefine the <code>abc</code> prefix with your domain.</p>
  
  <pre><code>&lt;root xmlns:abc="mydomain.com/test"&gt;
      &lt;body xmlns:abc="yourdomain.com/test"&gt;
      ...//to use my namespace here, I'd need to redefine it again to mydomain.com/test
  
      &lt;/body&gt;
  &lt;/root&gt;
  </code></pre>