Open gtback opened 10 years ago
Generally, I think the rule should be IF and ONLY IF a ListType contains a single element, then its minOccurs should be set to 1. This makes sense if we assume that all uses of such a ListType (i.e. in an element) would be optional.
+1 (would be safer against potential "use-after-free" and more clear/clean for building UI while explicitly specifying potential needs of at runtime creation/management)
In a related vein to #297...
Some list types have multiplicities 0..inf. Others are 1..inf. We should make this consistent throughout. In many (if not all) cases, the use of the list type is optional, so it's probably safe to use 1..inf ("If you're going to use this list element at all, there should be at least one element within it"); though this may break existing content, the empty list element was not adding information anyway.
On the other hand, there are some list types that contain additional attributes; in that case it might not be a good idea to make the minOccurs=1.
In any event, the multiplicities should be consistent and follow a rule that we document somewhere.