W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2002

Re: Determining cardinality of a simple type

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 24 Jul 2002 20:43:17 +0100
Message-ID: <1521583921598.20020724204317@jenitennison.com>
To: xmlschema-dev@w3.org, Paul Erion <p_erion@yahoo.com>
CC: erion@acm.org

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:04 UTC