Number of occurrences in FSD
The sequence, choice and record elements in the FSD allow the number of expected occurrences to be specified. The FSD processor uses this information to navigate through the data and to validate the data.
The max-occurs attribute is by default set to 1, meaning that only one occurrence of the given record, sequence or choice is expected to occur. For some types of flat data this may be some other fixed number, but in many cases any number of occurrences are valid. This can be specified using the value 0, in which case the FSD processes the records until a non-matching record is found.
The min-occurs attribute is used purely for validation purposes (and for help in pattern matching using the choice element). Before moving onto the next record, the FSD processor checks the number of occurrences against the minimum number specified by min-occurs and generates an error if too few occurrences are found.