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 Friday, 17 May 2002 10:57:00 UTC