Re: Multiple imports of the same namespace

On 8/23/2004 10:16 AM, JGLACE@lmi.org 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@tibco.com
TIBCO Software Inc.				office: (919) 969-6518
www.tibco.com

Received on Monday, 23 August 2004 14:53:33 UTC