- From: Biron,Paul V <Paul.V.Biron@kp.org>
- Date: Tue, 26 Sep 2000 13:01:41 -0700
- 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