Re: XML Schemas and the Enumeration Facet

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
type.

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>
<simpleType name="b" base="a">
	<enumeration value="2"/>
	<enumeration value="3"/>
	<enumeration value="4"/>
</simpleType>
<simpleType name="c" base="a">
</simpleType>

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