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: Wed, 31 May 2000 14:34:48 -0700
Message-Id: <376E771642C1D2118DC300805FEAAF4386DBCA@pars-exch-1.ca.kp.org>
To: "'Martin J. Duerst'" <duerst@w3.org>
Cc: www-xml-schema-comments@w3.org
> -----Original Message-----
> From:	Martin J. Duerst [SMTP:duerst@w3.org]
> Sent:	Thursday, May 25, 2000 11:20 PM
> To:	Biron,Paul V; 'petsa@US.IBM.com'
> Cc:	www-xml-schema-comments@w3.org
> Subject:	RE: Easier way to define enumerations
> 
> I was aware of the whitespace problem as explained below,
> but was not careful enough to think it through. Still,
> I think it's easy to provide shortness while avoiding
> the problem, e.g. by defining that xsd:enumeration
> can have either a 'value' attribute (containing a single
> value) or a 'valuelist' attribute (containing a list
> of values, whitespace-separated). This would allow
> to address values with and without whitespace.
> 
Unfortunately, I think that adding the "valuelist" attribute would do little
more than engender more comments that the schema spec is too complex and
disconnected.

As we are all aware, there are always tradeoffs in design of this sort,
e.g., ease of authoring a schema vs. the complexity of the language itself.
So some things (the case at hand being a good example) which might reduce
the complexity of authoring an individual schema would cause the spec to
bloat to the point where the average schema author would be able to tell how
to create the schema that they intend.

Thus, I still contend that we should simply leave the method of defining
simple types via enumeration as it is currently designed.

pvb

p.s. see note below on typos...

> Regards,   Martin.
> 
> At 00/05/25 15:32 -0700, Biron,Paul V wrote:
> > > -----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'/>
> ></xsd:simpleType>
> >
> >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".
> 
Opps, that's a typo in my reply to martin, it was supposed to be
*intention*.  We have received several comments that there is a typo in
Section 2.2, to the effect that, "...defined axiomatically from fundamental
notions (intensional definition) [see primitive]" should read "......defined
axiomatically from fundamental notions (intentional definition) [see
primitive]".  And there I go making the opposite typo.

For those who don't know the difference, see:

http://www.m-w.com/cgi-bin/dictionary?intension
http://www.m-w.com/cgi-bin/dictionary?intention

[BTW, has anyone else noticed how frequently we are citing the MW dictionary
lately?  I wonder what the technical anthropologists will think of this in
the years to come when they look back on schema development?]
Received on Wednesday, 31 May 2000 18:16:29 UTC

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