RE: What are complexContent restrictions made for ?

At least one difference is that simpleName1 can be substitutable for personName if personName was the head of its substitution group[0] while simpleName2 cannot. 
 
[0] http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#Declarations_Summary - section 2.2.2.2 

 -----Original Message----- 
 From: zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN [mailto:michael.marchegay@rd.francetelecom.com] 
 Sent: Fri 5/17/2002 7:56 AM 
 To: 'xmlschema-dev@w3.org' 
 Cc: 
 Subject: What are complexContent restrictions made for ?
 
 

 Hello, 

 I'm trying to understand the interest of complexContent restrictions, but I 
 don't find in which kind of examples it is usefull. 

 If I look at the following example: 

   <xs:complexType name="personName"> 
    <xs:sequence> 
     <xs:element name="title" minOccurs="0"/> 
     <xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/> 
     <xs:element name="surname"/> 
    </xs:sequence> 
   </xs:complexType> 

   <xs:complexType name="simpleName1"> 
    <xs:complexContent> 
     <xs:restriction base="personName"> 
      <xs:sequence> 
       <xs:element name="forename" minOccurs="1" maxOccurs="1"/> 
       <xs:element name="surname"/> 
      </xs:sequence> 
     </xs:restriction> 
    </xs:complexContent> 
   </xs:complexType 

   <xs:complexType name="simpleName2"> 
    <xs:sequence> 
     <xs:element name="forename" minOccurs="1" maxOccurs="1"/> 
     <xs:element name="surname"/> 
     </xs:sequence> 
   </xs:complexType 

 I can't figure out what is the difference between an element which has type 
 simpleName1 and another which has type simpleName2. 

 So are complexContents just syntaxic sugar, used by XML Schema processing tools 
 or do they have another function? 

 Thanks. 

 -- 
 Michaël Marchegay, Stagiaire France Telecom R&D du 11/02/2002 au 26/07/2002 
 Sous la responsabilité d'Olivier Dubuisson 
 DTL/TAL - 22307 Lannion Cedex - France 

Received on Wednesday, 22 May 2002 14:20:47 UTC