W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2000

RE: creating list types from multiple atomic string types???

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Tue, 26 Sep 2000 13:01:41 -0700
Message-Id: <376E771642C1D2118DC300805FEAAF4386DE6E@pars-exch-1.ca.kp.org>
To: "'Morten M. Christensen'" <mmc@mortench.net>
Cc: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
> -----Original Message-----
> From:	ht@cogsci.ed.ac.uk [SMTP:ht@cogsci.ed.ac.uk]
> Sent:	Tuesday, September 26, 2000 8:32 AM
> To:	Morten M. Christensen
> Cc:	www-xml-schema-comments@w3.org
> Subject:	Re: creating list types from multiple atomic string types???
> 
> See new [1], [2], [3] design, has unions.
> 
> ht
> 
> [1] http://www.w3.org/TR/xmlschema-0/
> [2] http://www.w3.org/TR/xmlschema-1/
> [3] http://www.w3.org/TR/xmlschema-2/
> 
To be more concrete, we have your original 2 types (using the new syntax
from [3]):

<xsd:simpleType name="Name1">
	<xsd:restriction base='xsd:string'>
		<xsd:enumeration value="RED"/>
		<xsd:enumeration value="BLUE"/>
	 	<xsd:enumeration value="GREEN"/>
	</xsd:restriction>
 </xsd:simpleType>

<xsd:simpleType name="Name2">
	<xsd:restriction base='xsd:string'>
		<xsd:enumeration value="BIG"/>
		<xsd:enumeration value="SMALL"/>
	</xsd:restriction>
</xsd:simpleType>

Then, we can create a list type whose "itemType" is given as an anonymous
simpleType that is the union of the 2 Name types, as in:

<xsd:simpleType name='NameList'>
	<xsd:list>
		<xsd:simpleType>
			<xsd:union memberTypes='Name1 Name2'/>
		</xsd:simpleType>
	</xsd:list>
</xsd:simpleType>

Hope this helps,

pvb
Received on Tuesday, 26 September 2000 16:16:11 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:53 UTC