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

Re: XML Schemas and the Enumeration Facet

From: Johannes Schmidt <js99@pacbell.net>
Date: Fri, 10 Mar 2000 20:12:54 -0800
To: www-xml-schema-comments@w3.org
Message-id: <NCBBIPEOKAOFFDIJAJIDMEJHCAAA.js99@pacbell.net>
my interpretation is that all facets are constraints, and all constraints
must be satisfied.  for example, if you have a pattern like [A-Z]+ and a
maxLength of 5, it means the string must both be an upper-case letter AND
have a length of at least one (the + in the pattern) AND have a length of at
most 5.

derived definitions add additional restrictions.  thus if you have a base
with a maxLength of 5 and a derived type with a maxLength of 2, the derived
type has a maximum length of 2.  similarly, if the base maxLength is 2 and
the derived maxLength is 5, this still means the derived type has a maximum
length of 2.  basically, the derived definition is "by restriction" which
means a derived type can not include any values not allowed by the base

enumerations are only slightly different because if you have no
enumerations, it means you are not limiting values by list.  if you have one
or more enumerations, you are limiting the values by the list.  if you have
no enumerations, you are not limiting them by a list.  here is an example:

<simpleType name="a" base="integer">
	<enumeration value="1"/>
	<enumeration value="2"/>
	<enumeration value="3"/>
<simpleType name="b" base="a">
	<enumeration value="2"/>
	<enumeration value="3"/>
	<enumeration value="4"/>
<simpleType name="c" base="a">

i think all of these should be legal, and a and c both have values 1,2,3
while b has values 2,3 only.
Received on Friday, 10 March 2000 23:13:50 UTC

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