Can't validate with remote schema

I have two schemas (one local, another on server) they are exactly same
root element definition. Local schema validates xml file, but validating
same file against remote schema I am getting XMLSpy error as follows:

File C:\Documents and Settings\singhn\Desktop\Copy of r1CfgItm.xml is
not valid.
	Element <test> is not allowed under element <loadInstructions>.
		Reason: The following elements are expected at this
location (see below)
			<test> 
		Error location: loadInstructions / test
		Details
			cvc-model-group: Element <test> unexpected by
type '{anonymous}' of element <loadInstructions>.
			cvc-elt.5.2.1: The element <loadInstructions> is
not valid with respect to the actual type definition '{anonymous}'.

Following is the xml document
<?xml version="1.0" encoding="UTF-8"?>
<loadInstructions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:/apps/test.xsd">
	<test>test</test>
	<test1>3</test1>
</loadInstructions>

And local schema file

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="loadInstructions">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="test"
type="xs:string"/>
				<xs:element name="test1"
type="xs:integer"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

But when I change the <loadInstructions> to be validated by remote
schema as follows

<?xml version="1.0" encoding="UTF-8"?>
<loadInstructions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://a995760/pub/Resources/Validation"
xsi:schemaLocation="http://a995760/pub/Resources/Validation
http://a995760/pub/Resources/Validation/test.xsd">
	<test>test</test>
	<test1>3</test1>
</loadInstructions>

And remote schema file

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://a995760/pub/Resources/Validation">
	<xs:element name="loadInstructions">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="test"
type="xs:string"/>
				<xs:element name="test1"
type="xs:integer"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

XmlSpy throws error described above. Can anyone help me here.

Thanks and regards
Navpreet Singh

Disclaimer :
The contents of this e-mail including any attachments are intended only
for the person or entity to which this e-mail is addressed.  If you are not,
or believe you may not be, the intended recipient, please advise the sender
immediately by return e-mail, delete this e-mail and destroy any copies.
Tenix does not warrant nor guarantee that this email communication is free
from errors, virus, interception or interference.

Received on Friday, 14 September 2007 14:34:45 UTC