Check all schemes for unnecessary @minOccurs, @maxOccurs and @usage
Description
In railML schemes there are elements that occur exactly one time. Thus, @minOccurs="1" and @maxOccurs="1". Since these are default values, they don't have to be given explicitly. The same applies for @use="optional" for attributes.
Background
elements... are by default mandatory (minOccurs="1" and maxOccurs="1")
attributes... are by default optional (use="optional")
Therefore, mandatory elements and optional attributes don't have to have mentioned properties.
For the following cases, properties have to be provided in the schema:
- optional elements occuring once: minOccurs="0"
- optional elements occuring up to n times: minOccurs="0" and maxOccurs="n" (with n being a positive number)
- mandatory elements occurinng up to n times: maxOccurs="n" (with n being a positive number)
- mandatory attributes: use="required"
Links
- Forum discussion:
- Christian Rahmig, 02.10.2018: [https://www.railml.org/forum/index.php?t=msg&th=609&start=0&]
- Web links:
- XSD Indicators: [https://www.w3schools.com/xml/schema_complex_indicators.asp]
- XSD Attributes: [https://www.w3schools.com/xml/schema_simple_attributes.asp]
Proposed solution
Remove in all schema files:
- minOccurs="1"
- maxOccurs="1"
- use="optional"