Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Can't validate xml against remote schema

From: "SINGH Navpreet" <Navpreet.SINGH@-----.--->
To: <xmlschema-dev@--.--->
Date: 9/14/2007 10:38:00 PM
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.



From Navpreet.SINGH@T... Fri Sep 14 14:34:45 2007
Received: from wiggum.w3.org ([128.30.52.23])
	by frink.w3.org with esmtp (


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent