You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2001/06/19 10:01:18 UTC

[Bug 2229] New: - duplicate element decl in the same scope when using include schemaLocation

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2229

*** shadow/2229	Tue Jun 19 01:01:18 2001
--- shadow/2229.tmp.22702	Tue Jun 19 01:01:18 2001
***************
*** 0 ****
--- 1,92 ----
+ +============================================================================+
+ | duplicate element decl in the same scope when using include schemaLocation |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2229                        Product: Xerces-J                |
+ |       Status: NEW                         Version: 1.4                     |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Normal                   OS/Version: All                     |
+ |     Priority: Other                     Component: Schema-Structures       |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xerces-j-dev@xml.apache.org                                  |
+ |  Reported By: raul.fiedler@ecb.int                                         |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ When using include statement in schema it seams to loose track of complex type 
+ elements in nested scopes.
+ 
+ Schema defines elements with the same name shortterm_rating, but in different 
+ scopes. And includes another schema: <include schemaLocation="codelists.xsd"/>.
+ Error:Schema error: duplicate element decl in the same scope : shortterm_rating.
+ 
+ The error disappears when include statement is removed.
+ The error also disappears when element shortterm_rating is defined to a build-in 
+ type, examples "string".
+ 
+ Xml file test.xml
+ ----------------------------------------------------------------
+ <?xml version="1.0" standalone="no"?>
+ 
+ <mfitest xmlns = "http://www.test.int/MfiTest"
+          xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation = "http://www.test.int/MfiTest mfitest.xsd"
+ 	 >
+     <issuer>
+         <issuer_name>Elvis</issuer_name>
+ 	<shortterm_rating><id>111</id></shortterm_rating>
+     </issuer>
+     <shortterm_rating>222</shortterm_rating>
+ </mfitest>
+ ----------------------------------------------------------------
+ 
+ schema file: mfitest.xsd
+ ----------------------------------------------------------------
+ <?xml version="1.0"?>
+ 
+ <schema xmlns = "http://www.w3.org/2001/XMLSchema"
+         xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
+         targetNamespace = "http://www.test.int/MfiTest"
+         xmlns:mfiea = "http://www.test.int/MfiTest"
+         elementFormDefault = "qualified"
+         attributeFormDefault = "qualified"
+         >
+ 
+     <include schemaLocation="codelists.xsd"/>
+ 
+     <element name="n13" type="mfiea:tier1"/>
+ 
+     <complexType name="tier1">
+         <sequence>		
+ 	    <element name = "issuer" type="mfiea:issuer"/>
+             <element name = "shortterm_rating" type="integer"  minOccurs="0"/>
+         </sequence>
+     </complexType>
+ 
+     <complexType name="issuer">
+         <sequence>
+             <element name="issuer_name" type="string" minOccurs="0"/>
+             <element name="shortterm_rating" type="mfiea:rating" minOccurs="0"/>
+         </sequence>
+     </complexType>
+ 
+     <complexType name="rating">
+         <sequence>
+             <element name="id" type="integer"/>
+         </sequence>
+     </complexType>
+ </schema>
+ ----------------------------------------------------------------
+ 
+ include schema file: codelist.xsd
+ ----------------------------------------------------------------
+ <?xml version="1.0"?>
+ <schema xmlns ="http://www.w3.org/2001/XMLSchema"
+         xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
+         targetNamespace = "http://www.test.int/MfiTest"
+         xmlns:mfiea =	"http://www.test.int/MfiTest"
+         elementFormDefault = "qualified"
+         attributeFormDefault = "qualified"
+         >
+      <element name = "codeId" type="string"/>	
+ </schema>
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org