Re: Determining cardinality of a simple type

Hi Paul,

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

No, I'm afraid not. The only way that you could make sure this was the
case would be to generate the element's content model through some
kind of transformation based on the definition of the simple type.

BTW, I wouldn't call this the "cardinality", rather "the number of
enumerated values" or something similar. When I hear "cardinality" I
think of the number of values allowed by a list type -- for example,
the following list type has a cardinality of four:

<xs:simpleType name="fourDates">
  <xs:restriction>
    <xs:simpleType>
      <xs:list itemType="xs:date" />
    </xs:simpleType>
    <xs:length value="4" />
  </xs:restriction>
</xs:simpleType>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Wednesday, 24 July 2002 15:43:23 UTC