[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

From: Swayam Vemuri -X \(swvemuri - WIPRO at Cisco\) <swvemuri@cisco.com>
Date: Wed, 21 Mar 2007 10:58:20 +0530
Message-ID: <CD0ED6DCA2BDE145942ACA8F57E42298024FFAC1@xmb-blr-414.apac.cisco.com>
To: <xmlschema-dev@w3.org>
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 05:28:39 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.