IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Schema location error Options · View
xmlaltovauser12
Posted: Thursday, April 7, 2011 6:22:00 PM
Rank: Newbie

Joined: 4/7/2011
Posts: 3
Hello Altova users

I am using xml spy enterprise edition 2011 software to validate xml file agaist xsd file. But both the files are well formed. But when i put a refrence of schema file in xml file then it gives me an error as

Unable to locate a reference to a supported schema type (DTD, W3C Schema) within this document instance.

Both the files (xml and xsd) are in the same directory(location).

Xml file

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://abc.org/sample/cgi/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://abc.org/sample/cgi/1.0/abc.xsd">
<configuration-metadata>
<configuration-name>Configuration with all the datastores</configuration-name>
</configuration-metadata>
</configuration>


xsd file

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://abc.org/sample/cgi/1.0"
xmlns:ab="http://abc.org/sample/cgi/1.0"
elementFormDefault="qualified">
<element name="configuration">
<complexType>
</complexType>
</element>

</schema>
vlad
Posted: Thursday, April 7, 2011 7:06:55 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
schemaLocation attribute must contain two values - first is the target namespace of your schema and second is the file path.

Instead of typing by hand, simply use built-in XMLSpy menu command Assign Schema which will ensure that the reference to your schema is properly added to your XML instance file.
xmlaltovauser12
Posted: Thursday, April 7, 2011 8:26:35 PM
Rank: Newbie

Joined: 4/7/2011
Posts: 3
I got an error resolved..

This is what i changed in my xml file.


<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://eobjects.org/analyzerbeans/configuration/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://eobjects.org/analyzerbeans/configuration/1.0 abc.xsd">
</configuration>
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.