att.repeatable

att.repeatable supplies attributes for the elements which define component parts of a content model.
Moduletagdocs — Documentation Elements
Membersalternate anyElement classRef elementRef sequence
AttributesAttributes
contextsupplies an XPath identifying a context within which this component of a content model must be found
Status Optional
Datatype
minOccurs(minimum number of occurences) indicates the smallest number of times this component may occur.
Status Optional
Datatype teidata.count
Default 1
Note

minOccurs cannot be greater than maxOccurs. If a minOccurs greater than 1 is specified, a maxOccurs with an equal or greater value must also be specified.

maxOccurs(maximum number of occurences) indicates the largest number of times this component may occur.
Status Optional
Datatype teidata.unboundedInt
Default 1
Note

maxOccurs cannot be less than minOccurs. Since the default value of minOccurs is 1, if maxOccurs is set to 0, minOccurs must also be 0.

SchematronThe value of minOccurs should be less than or equal to that of maxOccurs. Since the default value of maxOccurs is 1, if it is not specifed minOccurs should be less than or equal to 1, i.e. 0 or 1.

<sch:rule context="*[@minOccurs and @maxOccurs]">

<!-- we know that @minOccurs is castable as an integer, and we know that -->

<!-- @maxOccurs is either "unbounded" or castable as an integer, because -->

<!-- they have passed standard grammar-based validation. -->
<sch:let name="min"
 value="@minOccurs cast as xs:integer"/>

<sch:let name="max"
 value="if ( normalize-space(@maxOccurs) eq 'unbounded' ) then -1 else @maxOccurs cast as xs:integer"/>

<sch:assert test="$max eq -1 or $max ge $min">@maxOccurs should be greater than or equal to @minOccurs</sch:assert>
</sch:rule>
<sch:rule context="*[@minOccurs and not(@maxOccurs)]">
<sch:assert test="@minOccurs cast as xs:integer lt 2">When @maxOccurs is not specified, @minOccurs must be 0 or 1</sch:assert>
</sch:rule>
<sch:rule context="*[@maxOccurs and not(@minOccurs)]">
<sch:assert test="@maxOccurs cast as xs:integer = 0">@maxOccurs should be greater than or equal to @minOccurs, which has a default value of 1</sch:assert>
</sch:rule>