Ensures that the number of elements is not greater than 'maxOccurs'.