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

RE: Easier way to define enumerations

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Thu, 25 May 2000 15:32:56 -0700
Message-Id: <376E771642C1D2118DC300805FEAAF4386DBBD@pars-exch-1.ca.kp.org>
To: "'petsa@US.IBM.com'" <petsa@US.IBM.com>, "Martin J. Duerst" <duerst@w3.org>
Cc: www-xml-schema-comments@w3.org
> -----Original Message-----
> From:	petsa@US.IBM.com [SMTP:petsa@US.IBM.com]
> Sent:	Wednesday, May 24, 2000 9:29 AM
> To:	Martin J. Duerst
> Cc:	www-xml-schema-comments@w3.org
> Subject:	Re: Easier way to define enumerations
> Yes, now that we have lists this seems reasonable.  We'll put it to the
> WG.
> "Martin J. Duerst" <duerst@w3.org>@w3.org on 05/21/2000 05:10:53 AM
> To:   www-xml-schema-comments@w3.org
> Subject:  Easier way to define enumerations
> This is a last call comment to XML Schema Structures.
> It should be possible to write
> <xsd:enumeration value='AK AL AR...' />
> instead of
> <xsd:enumeration value='AK' />
> <xsd:enumeration value='AL' />
> <xsd:enumeration value='AR' />
> ...
> to get a more reasonable and compat notation, in particular
> for cases where the number of enumerated items is large.
While I'm sympathetic to this suggestion, I do not think it works in the
general case.  The reason is that the lexical space of a list datatype is a
whitespace separated sequence of tokens (which, by definition, cannot
contain whitespace).  Therefore, with the proposed syntax, there would be no
way to create a subtype of a list type by enumeration.  For example,

<xsd:simpleType name='list-of-string' base='xsd:string' derivedBy='list'/>
<xsd:simpleType name='enum-of-list-of-string' base='list-of-string'>
   <xsd:enumeration value='this is a test'/>
   <xsd:enumeration value='of the emergency'/>
   <xsd:enumeration value='broadcast system'/>

The *intension* of enum-of-list-of-string is to create a datatype whose
value space is the set of 3 strings "this is a test", "of the emergency" and
"broadcast system"; however, what we have defined is the set of 9 strings
"this", "is", "a", "test", "of", "the", "emergency", "broadcast", "system".

Received on Thursday, 25 May 2000 19:08:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:47 UTC