Closed markrendle closed 2 years ago
Cardinality requirements for the same elements can vary across different messages, so it's usually defined as 0-unbounded in releases for better flexibility and reuse.
You can tighten up cardinality in IEPDs as needed. For example, if nc:PersonMiddleName
has cardinality 0-unbounded under nc:PersonNameType
in the release, you can change it to 0-1, 1-1, 1-unbounded, 1-2, etc., in a subset for an IEPD. These more limited IEPD cardinality ranges are still valid against the broader release cardinality range (0-unbounded) so this doesn't cause any conflicts or validation problems.
However, you cannot expand cardinality from the release in a subset. If the release defines the usage of an element with cardinality 1-1, that element will always be required any time that type is used, and can only occur once, in all IEPDs. We don't know all possible use cases for the elements in the data model, so we don't want to limit user options unnecessarily.
If you are building a subset with the SSGT, there is an option that lets you customize the cardinality of the elements you pick. It will generate your subset schemas with your custom cardinality options. There is a section in the SSGT page on niem.github.io that shows how to change default cardinality options.
Hope this helps!
Why is every single element on every single type declared as
minOccurs="0" maxOccurs="unbounded"
?