Hello,


     I don't believe that it is a valid schema.  My reading of 3.4.2 of the Schema recommendation [1], is that the type rrr is a restriction of the ur-type, and according to "Complex Type Definition with complex content" in the table in 3.4.2, the {content type} of rrr is empty.  My understanding is that it was intended that anything that is valid according to a type derived by restriction (sss, in this case) must also be valid according to the base type (rrr); clearly that's not the case for sss here, as it doesn't have empty content.

     However, it doesn't appear that any of the cases in the "Schema Component Constraint: Derivation Valid (Restriction, Complex)" [2] prohibits your example.  The implementation of the derivation constraints in Xerces-J is extremely faithful to the description in the recommendation, and so the internal error you saw results.

     I'll send a request to the Schema Working Group to look at this apparent hole in the recommendation.  In the meanwhile, Lisa Martin said she will look into fixing the problem in Xerces-J.

Thanks,

Henry


[1] http://www.w3.org/TR/xmlschema-1/#declare-type
[2] http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction
------------------------------------------------------------------------
Henry Zongaro      XML Parsers development
IBM SWS Toronto Lab   Tie Line 778-6044;  Phone (416) 448-6044
mailto:[EMAIL PROTECTED]

Please respond to [EMAIL PROTECTED]

To:        [EMAIL PROTECTED]
cc:        
Subject:        Schema bug?



The following schema causes "internal Xerces error".

---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
 <xs:element name="dummy"/>
 
 <xs:complexType name="rrr" />
 <xs:complexType name="sss">
   <xs:complexContent>
     <xs:restriction base="rrr">
       <xs:sequence>
         <xs:element name="dummy"/>
       </xs:sequence>
     </xs:restriction>
   </xs:complexContent>
 </xs:complexType>
</xs:schema>
---------------------------------------------

Here is the error message:

[Error] subst2.xml:3:67: Schema error: ComplexType ',sss': internal
Xerces error.



If my understanding is correct, the above schema should be a valid
schema.  ... Or it isn't?


regards,
--
Kohsuke KAWAGUCHI                          +1 650 786 0721
Sun Microsystems                   [EMAIL PROTECTED]

Reply via email to