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

Paper submission due!! please help!! Restriction with substitution???

From: Joey Coyle <joey@xcoyle.com>
Date: Wed, 13 Mar 2002 02:00:43 -0500 (EST)
Message-Id: <5.1.0.14.2.20020312234108.00ab2fa8@mail.xcoyle.com>
To: xmlschema-dev@w3.org
I read in this list that this first example is OK, but is there a way to do 
this with a type other than "any".    Instead of any, I would like my own 
type, then I would like to substitute derived types as is done here.   My 
example is after the $$$$$$$$$$$$$$$$$$$$$$$$$, and I hope it is 
valid.  Please help

<complexType name="basetype">
	<sequence>
		<any maxOccurs="unbounded"/>
	</sequence>
</complexType>

<complexType name="newtype">
	<complexContent>
		 <restriction base="my:basetype">
			<sequence>
				 <element name="e1" type="string"/>
				 <element name="e2" type="integer" minOccurs="0"/>
				 <element name="e3" type="date" minOccurs="0"/>
			</sequence>
		</restriction>
	</complexContent>
</complexType>

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

<complexType name="basetype">
	<sequence>
		<element name="item" type="myType" maxOccurs="unbounded"/>
	</sequence>
</complexType>

<complexType name="newtype">
	<complexContent>
		 <restriction base="my:basetype">
			<sequence>
				 <element name="e1" type="myTypeRestriction"/>
				 <element name="e2" type="myTypeRestriction2" minOccurs="0"/>
				 <element name="e3" type="myTypeRestriction3" minOccurs="0"/>
			</sequence>
		</restriction>
	</complexContent>
</complexType>
Received on Wednesday, 13 March 2002 05:32:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:29 GMT