title: Failure validating Xml: The namespace 'X' provided differs from the schema's targetNamespace 'Y'
body: <p>I'm getting the following error while validating an xml document while using IXMLDOMDocument2 (C++):</p>
  
  <blockquote>
    <p>The namespace '<a href="http://www.somesite.com/schema/2.0" rel="nofollow noreferrer">http://www.somesite.com/schema/2.0</a>' provided differs from the schema's targetNamespace '<a href="http://www.somesite.com/schema/2.0/SomeObject" rel="nofollow noreferrer">http://www.somesite.com/schema/2.0/SomeObject</a>' .</p>
  </blockquote>
  
  <p>The Xml I'm trying to validate is:</p>
  
  <pre><code>&lt;id:envelope xmlns:id="http://www.somesite.com/schema/2.0/SomeObject" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xsi:schemaLocation="http://www.somesite.com/schema/2.0 SomeObject.xsd"&gt;
      &lt;!-- content --&gt;
  &lt;/id:envelope&gt;
  </code></pre>
  
  <p>Now I can see that it looks like the xsi:schemaLocation tag has been mangled a bit by the space ("<a href="http://www.somesite.com/schema/2.0" rel="nofollow noreferrer">http://www.somesite.com/schema/2.0</a> SomeObject.xsd" seems to be getting interpreted as "<a href="http://www.somesite.com/schema/2.0" rel="nofollow noreferrer">http://www.somesite.com/schema/2.0</a>"), but I still cant quite understand whats going on as this appears to indicate that the schemaLoaction needs to exactly match the xmlns specified...</p>
  
  <ul>
  <li>Are spaces not allowed in schema names?</li>
  <li>Does the schemaLoaction need to match the targetNamespace?</li>
  <li>If so, why!?</li>
  </ul>