Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Schema Help - importing schema

From: "Kevin L. Cobb" <kevin.cobb@--------.--->
To: <xmlschema-dev@--.--->
Date: 8/29/2005 7:31:00 AM
I am new to the list and pretty new to schema definitions, although I
work with XML and XSLT a lot.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~

I am trying to define multiple schema's that reference each other and am
running into some problems. When I try and validate my Source XML with
the Source Schema (books.xsd), I get the error: "Cannot find the
declaration of element 'book'." Based on what I know, the schema
definitions and the import is correct but, obviously, there is a
problem. Can someone provide some direction. 

Source XML:

	<book xmlns="http://books/ <http://books/> "
xmlns:money="http://money/ <http://money/> ">
	   <author>Charles Dickens</author>
	   <title>Oliver Twist</title>
	   <money:gbp>20</money:gbp>
	   <money:dollar>40</money:dollar>
	</book>

Source XSD (books.xsd):

	<xs:schema
	   targetNamespace="http://books/"
	   xmlns="http://books/"
	   xmlns:xs="http://www.w3.org/2001/XMLSchema"
	   xmlns:money="http://money/"
	   elementFormDefault="qualified"
	   attributeFormDefault="unqualified">

	   <xs:import namespace="http://money/"
schemaLocation="Money.xsd"/>

	   <xs:element name="book">
	      <xs:complexType>
	         <xs:sequence>
	            <xs:element name="author" type="xs:string"/>
	            <xs:element name="title" type="xs:string"/>
	            <xs:element ref="money:gbp"/>
	            <xs:element ref="money:dollar"/>
	         </xs:sequence>
	      </xs:complexType>
	   </xs:element>
	</xs:schema>

 

Imported Schema Number 2 (money.xsd):

	<xs:schema
	   xmlns="http://money/"
	   targetNamespace="http://money/"
	   xmlns:xs="http://www.w3.org/2001/XMLSchema">
	   
	   <xs:element name="gbp" type="xs:integer" />
	   <xs:element name="dollar" type="xs:integer" />
	</xs:schema>

	 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin L Cobb, MT(ASCP), SCJP2
Senior Software Engineer
Emergint, Inc.
2724 River Green Circle
Louisville, KY 40206
Kevin.Cobb@e... <mailto:Kevin.Cobb@e...> 
502.896.6210 ext 255
502.896.6170 fax

 

The preceding e-mail message and attachments, if any, contains
information that is confidential and qualifies as such under the
Definition of Confidential Information in the Non-Disclosure Agreement,
and may constitute non-public information and trade secrets. It is
intended to be conveyed only to the designated recipient(s). If you are
not an intended recipient of this message, please notify the sender at
502.896.6210. 

 


transparent
Print
Mail
Digg
delicious
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