-
Notifications
You must be signed in to change notification settings - Fork 24
Description
In EBMLSchema.xsd the default value for maxOccurs is defined as 1.
The specification says the following about maxOccurs:
[...] If the
maxOccursattribute is not present, then there is no upper bound for the permitted number of occurrences of this EBML Element within its Parent Element or within the EBML Document, depending on whether or not the EBMLParentPath of the EBML Element is empty.The semantic meaning of maxOccurs within an EBML Schema is analogous to the meaning of maxOccurs within an XML Schema; when it is not present, it's similar to xml:maxOccurs="unbounded" in an XML Schema.
In my opinion the XSD definition could be misleading. I propose to define maxOccurs as a union type or define 0 as a special value.
In case maxOccurs is defined as a union type:
- Schema change
<xs:attribute name="maxOccurs" default="unbounded"> <xs:simpleType> <xs:union> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:minInclusive value="0"/> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="unbounded"/> </xs:restriction> </xs:simpleType> </xs:union> </xs:simpleType> </xs:attribute> - This change would let
maxOccursbehave almost the same as the attribute with the same name in XML Schema.
In case 0 is defined as a special value:
- Schema change
<xs:attribute name="maxOccurs" default="0"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:minInclusive value="0"/> </xs:restriction> </xs:simpleType> </xs:attribute> - The zero value has to be defined as a special value in the specification. From a logical perspective this could make sense because limiting the maximal occurrence to 0 is an invalid constraint.