XML Schema - Dynamic maxOccurs?

Viewed 148

I'm wondering if it could be possible to refer the maxOccurs property value of an element to the value of another element. For example in this case:

<xs:complexType name="X">
  <xs:sequence>
    <xs:element name="maxNumberOfY" type="xs:nonNegativeInteger"/>
    <xs:element name="Y" maxOccurs="?" type="xs:string"/>
  </xs:sequence>
  <xs:attribute name="name" type="xs:string"/>
</xs:complexType>

the number of Y elements should not exceed the value of the element "maxNumberOfY". Is there any solution?

0 Answers
Related