Altova Mailing List Archives


Re: Multiple imports of the same namespace

From: Anli Shundi <ashundi@-----.--->
To: JGLACE@---.---
Date: 8/23/2004 6:53:00 AM
On 8/23/2004 10:16 AM, JGLACE@l... wrote:
> I am receiving an error when I validate a Schema that has multiple
> imports of the same namespace when I use XerceJ 2.6.2. I've recreated my
> problem using some simplified Schemas below.
> 
> I'm hoping this group can verify that my Schema are correct. The main
> question being is importing multiple files of the same namespace legal
> and am I using the correct syntax. 

Yes, they are legal but the spec gives leeway to schema processors in 
locating schemas. As Michael Kay laid it out in the previous post, Turbo 
2.4.1, Xerces 2.6.2 (and XSV 2.7-1) opt for the easy way and skip the 
second import.

And, No: none of the tools is based on any of the others.  Other Tibco 
tools do handle multiple imports of the same namespace from different 
locations as more and more applications are making use of such constructs.

-Anli

> Thank you in advance for taking the time to read and respond.
> 
> Diamonds2.xsd
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="www.gemsRUS.com"
> elementFormDefault="qualified" attributeFormDefault="unqualified"
> xmlns:gems="www.gemsRUS.com"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> 	<xs:complexType name="DiamondType">
> 		<xs:sequence>
> 			<xs:element ref="gems:Color"/>
> 			<xs:element ref="gems:Cut"/>
> 			<xs:element ref="gems:Clarity"/>
> 			<xs:element ref="gems:Karat"/>
> 		</xs:sequence>
> 	</xs:complexType>
> 	<xs:element name="Color" type="xs:string"/>
> 	<xs:element name="Cut" type="xs:string"/>
> 	<xs:element name="Clarity" type="xs:string"/>
> 	<xs:element name="Karat" type="xs:integer"/>
> </xs:schema>
> 
> Pearls2.xsd
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="www.gemsRUS.com"
> elementFormDefault="qualified" attributeFormDefault="unqualified"
> xmlns:gems="www.gemsRUS.com"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> 	<xs:complexType name="PearlType">
> 		<xs:sequence>
> 			<xs:element ref="gems:size"/>
> 			<xs:element ref="gems:shape"/>
> 			<xs:element ref="gems:color"/>
> 			<xs:element ref="gems:luster"/>
> 			<xs:element ref="gems:surfaceCleanliness"/>
> 		</xs:sequence>
> 	</xs:complexType>
> 	<xs:element name="size" type="xs:integer"/>
> 	<xs:element name="shape" type="xs:string"/>
> 	<xs:element name="color" type="xs:string"/>
> 	<xs:element name="luster" type="xs:string"/>
> 	<xs:element name="surfaceCleanliness" type="xs:string"/>
> </xs:schema>
> 
> 
> Jewlery2.xsd
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="www.jewleryRUS.com"
> elementFormDefault="qualified" attributeFormDefault="unqualified"
> xmlns:jewels="www.jewleryRUS.com"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:gems="www.gemsRUS.com">
> 	<xs:import namespace="www.gemsRUS.com"
> schemaLocation="Pearls2.xsd"/>
> 	<xs:import namespace="www.gemsRUS.com"
> schemaLocation="Diamonds2.xsd"/>
> 	<xs:element name="Diamonds" type="gems:DiamondType"/>
> 	<xs:element name="Pearls" type="gems:PearlType"/>
> </xs:schema>
> 
> Xerce's error message:
> 
> Line 5, Column 55: src-resolve: Cannot resolve the name
> 'gems:DiamondType' to a(n) 'type definition' component. 
> 
> As a side note, Turbo 2.4.1 is not resolving this either (could it be
> built on Xerces?).
> 
> Kind regards,
> Jessica Glace
> LMI http://www.lmi.org/
> 2000 Corporate Ridge
> McLean, VA 22102-7805
> Jglace at lmi.org
> 
> 
> 


-- 
Anli Shundi					ashundi@t...
TIBCO Software Inc.				office: (919) 969-6518
www.tibco.com

From cmiltonperl@y... Mon Aug 23 15:16:39 2004
Received: from bart.w3.org ([128.30.52.40])
	by frink.w3.org with esmtp (Exim 4.34)
	id 1Bz

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.