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

RE: What are complexContent restrictions made for ?

From: Dare Obasanjo <dareo@microsoft.com>
Date: Fri, 17 May 2002 08:22:03 -0700
Message-ID: <8BD7226E07DDFF49AF5EF4030ACE0B7E06621C1B@red-msg-06.redmond.corp.microsoft.com>
To: "zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN" <michael.marchegay@rd.francetelecom.com>, <xmlschema-dev@w3.org>
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

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