Determining cardinality of a simple type

Is it possible to derive the cardinality of a "simpleType" that I can
then apply to an element's minOccurs/maxOccurs attributes?

For example, the following simple type has a cardinality of 4 (I'm new
to schemas, so please feel free to correct me if I use any
schema-specific terms incorrectly)

  <xsd:simpleType  name="nameType">
    <xsd:restriction  base="xsd:string">
      <xsd:enumeration  value="bob" />
      <xsd:enumeration  value="carol" />
      <xsd:enumeration  value="ted" />
      <xsd:enumeration  value="alice" />
    </xsd:restriction>
  </xsd:simpleType>

and I would like to specify that the "swingers" element will have
exactly 4 "person" elements as children.

  <xsd:element  name="swingers">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="person" minOccurs="4" maxOccurs="4" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

but I'd like to somehow state that minOccurs/maxOccurs is equal to the
cardinality of "nameType" -- that is, without explicitly using '4'. 
This isn't a critical thing, but it would be nice if when I add another
value to "nameType", I don't have to remember to modify the
minOccurs/maxOccurs values.

Thanks,

:Paul

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

Received on Wednesday, 24 July 2002 15:04:05 UTC