Home » railML newsgroups » railml.common » @minOccurs, @maxOccurs and @use
@minOccurs, @maxOccurs and @use [message #1979] Tue, 02 October 2018 13:18 Go to previous message
christian.rahmig is currently offline  christian.rahmig
Messages: 436
Registered: January 2016
Senior Member
Dear Dirk, dear all,

let me answer on behalf of Jörg:

elements... are by default mandatory (minOccurs="1" and maxOccurs="1") [1]

attributes... are by default optional (use="optional") [2]

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"

[1] https://www.w3schools.com/xml/schema_complex_indicators.asp
[2] https://www.w3schools.com/xml/schema_simple_attributes.asp

Best regards
Christian

--
Christian Rahmig - Infrastructure scheme coordinator
railML.org (Registry of Associations: VR 5750)
Phone Coordinator: +49 173 2714509; railML.org: +49 351 47582911
Altplauen 19h; 01187 Dresden; Germany www.railml.org

Am 01.10.2018 um 11:46 schrieb Dirk Bräuer:
> Dear Joerg and all other's,
>
> at the last telephone conference, I was asked to check the new r2.4 <rollingstock> railML XSDs for more possible missing optionals.
>
> So, I compared rollingstock.xsd and rollingstockTypes.xsd
> rev. 814 (RC 2.4)
> with
> rev. 611 (Original railML 2.3)
> and searched for new <xs:element> definitions without "minOccurs='0'".
>
> I only found the one more: In rollingstock.xsd
> <xs:complexType name="eVehicleBrakes">
> <xs:element name="vehicleBrakeOperation" type="rail:tBasicBrakeOperation" maxOccurs="unbounded">
> no "minOccurs='0'" occurs...
>
> The "minOccurs='0'" is also missing at some new attributes but it seems to me that for attributes, it is not necessary (since older attributes also have none). (Sorry, I am not the best choice for this task since I lack some knowledge about XSDs.)
>
> Joerg, please check this and, in case I am not mistaken, correct it for r2.4.
>
> Please correct me in case I misunderstood or tell me what else should be done.
>
> Best regards,
> Dirk.
>


Christian Rahmig – Infrastructure scheme coordinator
railML.org (Registry of Associations: VR 5750)
Altplauen 19h; 01187 Dresden; Germany www.railML.org
 
Read Message
Read Message
Previous Topic: Change of Template:InheritIdName
Next Topic: Consolidated Use Cases List
Goto Forum:
  


Current Time: Sun Apr 28 21:50:17 CEST 2024