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

*** shadow/2685 Wed Jul 18 21:34:24 2001
--- shadow/2685.tmp.18956       Wed Jul 18 21:34:24 2001
***************
*** 0 ****
--- 1,86 ----
+ +============================================================================+
+ | Substitution group type test halts at first base type, not at ultimate bas |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2685                        Product: Xerces-J                |
+ |       Status: NEW                         Version: 1.4.1                   |
+ |   Resolution:                            Platform: Other                   |
+ |     Severity: Normal                   OS/Version: Other                   |
+ |     Priority: Other                     Component: Schema-Structures       |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                  |
+ |  Reported By: [EMAIL PROTECTED]                                    |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ When using substitution groups Xerces fails to move up the type hierarchy when 
+ testing for type compatibility, proceeding only as far as the first type derived 
+ from.
+ 
+ For the sample XSD and related XML listed below, Xerces validates the XML 
+ correctly in the case where the substituted item's type is directly derived from 
+ the type of the substitution group (DerivedItem's type = DerivedItem1). If the 
+ substitution item's type is not immediately derived from the substitution 
+ group's type (DerviedItem's type = DerivedItem2/3) validation fails with the 
+ error:
+ 
+ Schema error: Element DerivedItem has a type whose base is 
+ http://bug.test/,DerivedItem1; this basetype does not derive from the type  of 
+ the element at the head of the substitution group.
+ 
+ ------------------------------------------
+ Example files: BUGTEST.XSD and BUGTEST.XML
+ ------------------------------------------
+ BUGTEST.XSD
+ ===========
+ <?xml version="1.0" encoding="utf-8"?>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"; xmlns:bt="http://bug.test/";  
+ targetNamespace="http://bug.test/"; elementFormDefault="qualified" 
+ version="2.05">
+ 
+   <element name="bugtest" type="bt:BugTestType"/>
+   <element name="SubItem" type="bt:SubItemType"/>
+   <element name="DerivedItem" type="bt:DerivedItem1" 
+ substitutionGroup="bt:SubItem"/>
+ 
+   <complexType name="SubItemType">
+   </complexType>
+ 
+   <complexType name="DerivedItem1">
+     <complexContent>
+       <restriction base="bt:SubItemType">
+       </restriction>
+     </complexContent>
+   </complexType>
+ 
+   <complexType name="DerivedItem2">
+     <complexContent>
+       <restriction base="bt:DerivedItem1">
+       </restriction>
+     </complexContent>
+   </complexType>
+ 
+   <complexType name="DerivedItem3">
+     <complexContent>
+       <restriction base="bt:DerivedItem2">
+       </restriction>
+     </complexContent>
+   </complexType>
+ 
+   <complexType name="BugTestType">
+     <sequence>
+       <element ref="bt:SubItem"/>
+     </sequence>
+   </complexType>
+ 
+ </schema>
+ 
+ BUGTEST.XML
+ ===========
+ <?xml version="1.0" encoding="utf-8"?>
+ <bugtest xmlns="http://bug.test/"; 
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
+ xsi:schemaLocation="http://bug.test/ BUGTEST.xsd">
+   <DerivedItem/>
+ </bugtest>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to