I'm getting the following error while validating an xml document while using IXMLDOMDocument2 (C++):
The namespace 'http://www.somesite.com/schema/2.0' provided differs from the schema's targetNamespace 'http://www.somesite.com/schema/2.0/SomeObject' .
The Xml I'm trying to validate is:
<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">
<!-- content -->
</id:envelope>
Now I can see that it looks like the xsi:schemaLocation tag has been mangled a bit by the space ("http://www.somesite.com/schema/2.0 SomeObject.xsd" seems to be getting interpreted as "http://www.somesite.com/schema/2.0"), but I still cant quite understand whats going on as this appears to indicate that the schemaLoaction needs to exactly match the xmlns specified...
- Are spaces not allowed in schema names?
- Does the schemaLoaction need to match the targetNamespace?
- If so, why!?