Altova Mailing List Archives


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

From: "Swayam Vemuri -X \(swvemuri - WIPRO at Cisco\)" <swvemuri@-----.--->
To: <xmlschema-dev@--.--->
Date: 3/21/2007 9:30:00 PM
Thanks Gerben this solved the problem

Regards
Swayam

-----Original Message-----
From: xmlBlueprint [mailto:support@x...] 
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.---.com




-----Original Message-----
From: xmlschema-dev-request@w...
[mailto:xmlschema-dev-request@w...]On
Behalf Of Swayam Vemuri -X (swvemuri - WIPRO at Cisco)
Sent: woensdag 21 maart 2007 6:28
To: xmlschema-dev@w...
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>

From noah

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.