RE: Validation of XML instance failing as reference to supported schema is not found.

Thanks Gerben this solved the problem

Regards
Swayam

-----Original Message-----
From: xmlBlueprint [mailto:support@xmlblueprint.com] 
Sent: Wednesday, March 21, 2007 4:03 PM
To: Swayam Vemuri -X (swvemuri - WIPRO at Cisco)
Subject: RE: Validation of XML instance failing as reference to
supported schema is not found.

The error message ""Unable to locate a reference to a supported schema
type(DTD, W3C Schema) within this document instance" suggests your file
"Ei2d.xml" is missing a reference to the actual XMLSchema. Use
"xsi:schemaLocation" like this:

<?xml version="1.0" encoding="UTF-8"?>
<ei2d:Ei2dLibType
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
		http://www.cisco.com/gmi/ei2d
		Base.xsd"
	xmlns:ei2d="http://www.cisco.com/gmi/ei2d">
	<ei2d:managedResourceDef>
	...
	...

- Gerben Abbink
  xmlBlueprint XML Editor
  www.xmlblueprint.com




-----Original Message-----
From: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]On
Behalf Of Swayam Vemuri -X (swvemuri - WIPRO at Cisco)
Sent: woensdag 21 maart 2007 6:28
To: xmlschema-dev@w3.org
Subject: Validation of XML instance failing as reference to supported
schema
is not found.


Hi All,

I have three schemas(xsds) Java.xsd, database.xsd, base.xsd.
Iam importing java.xsd and database.xsd into base.xsd.

I created an XML instance using base.xsd, which looks like below

Ei2d.xml (XML instance)
==========
<?xml version="1.0" encoding="UTF-8"?>
<ei2d:Ei2dLibType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ei2d="http://www.cisco.com/gmi/ei2d">
<ei2d:managedResourceDef>
<ei2d:managedResource xmlns:ei2d="http://www.cisco.com/gmi/ei2d"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:database="http://www.cisco.com/gmi/ei2d/database"
name="ThinkPositive">
      <ei2d:reference database:checking="Swayam"/>
      <ei2d:configData>
        <ei2d:attribute xsi:type="ei2d:ConfigAttributeType"
javaAccessType="public" name="itWorks" />
      </ei2d:configData>
    </ei2d:managedResource>
</ei2d:managedResourceDef>
</ei2d:Ei2dLibType>

Now when I try to validate it using XMLSpy, Iam seeing below error

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

It will be of great help if anyone can please help me out regarding how
to
solve this problem.
The base.xsd, Java.xsd and database.xsd are as given at the end of this
email

Thanks,
Swayam

Base.xsd(a snippet)
===============
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by
Prakash
Bettadapur (private) -->
<xs:schema xmlns="http://www.cisco.com/gmi/ei2d"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:java="http://www.cisco.com/gmi/ei2d/java"
xmlns:database="http://www.cisco.com/gmi/ei2d/database"
targetNamespace="http://www.cisco.com/gmi/ei2d"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.cisco.com/gmi/ei2d/java"
schemaLocation="Java_.xsd"/>
<xs:import namespace="http://www.cisco.com/gmi/ei2d/database"
schemaLocation="database.xsd"/>

............
            <xs:complexType name="referenceType">
                        <xs:attribute ref="database:checking" />
                        <xs:attribute name="javaAccessType"
type="java:JavaAccessType"/>
                        <xs:attribute name="name" type="xs:string"
use="required"/>
                        <xs:anyAttribute namespace="##other"
processContents="lax" />
            </xs:complexType>

............
</xs:schema>

Java.xsd(a snippet)
==============
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by
Prakash
Bettadapur (private) -->
<java:schema xmlns="http://www.cisco.com/gmi/ei2d/java"
xmlns:java="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.cisco.com/gmi/ei2d/java"
elementFormDefault="qualified" attributeFormDefault="unqualified">
            <java:simpleType name="JavaAccessType">
                        <java:restriction base="java:string">
                                    <java:enumeration value=""/>
                                    <java:enumeration value="public"/>
                                    <java:enumeration
value="protected"/>
                                    <java:enumeration value="private"/>
                        </java:restriction>
            </java:simpleType>
</java:schema>

Database.xsd( a snippet)
==================
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by
Prakash
Bettadapur (private) -->
<database:schema xmlns="http://www.cisco.com/gmi/ei2d/database"
xmlns:database="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.cisco.com/gmi/ei2d/database"
elementFormDefault="qualified" attributeFormDefault="unqualified">
.....
            <database:attribute name="checking" type="database:string"
/>
......
</database:schema>

Received on Wednesday, 21 March 2007 10:41:58 UTC