W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2002

What are complexContent restrictions made for ?

From: zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN <michael.marchegay@rd.francetelecom.com>
Date: Fri, 17 May 2002 16:56:17 +0200
Message-ID: <0489A7888F080B4BA73B53F7E145F29A1B0ABC@LANMHS20.rd.francetelecom.fr>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:02 UTC