Home » railML newsgroups » railml.rollingstock » missing minOccurs="0" for <trainBrakeOperation>
missing minOccurs="0" for <trainBrakeOperation> [message #1850] Wed, 20 June 2018 14:42 Go to next message
Dirk Bräuer is currently offline  Dirk Bräuer
Messages: 311
Registered: August 2008
Senior Member
Dear Joerg,

when using the current railML schemes, I noticed that the new (since rev. #721) element <trainBrakeOperation> is compulsory. I presume this is possibly a mistake. In rollingstock.xsd, line 861 there is a
minOccurs="0"
missing.

May I ask you to add this or do you really intend <trainBrakeOperation> to be compulsory?

Thank you,
with best regards,
Dirk.
Re: missing minOccurs="0" for <trainBrakeOperation> [message #1886 is a reply to message #1850] Fri, 03 August 2018 05:29 Go to previous messageGo to next message
Joerg von Lingen is currently offline  Joerg von Lingen
Messages: 148
Registered: May 2011
Senior Member
Indeed it was mistake - see [808] (https://trac.railml.org/changeset/808/railML)

Dirk Bräuer wrote on 20.06.2018 14:42:
> Dear Joerg,
>
> when using the current railML schemes, I noticed that the new (since rev. #721) element <trainBrakeOperation> is compulsory. I presume this is possibly a mistake. In rollingstock.xsd, line 861 there is a
> minOccurs="0"
> missing.
>
> May I ask you to add this or do you really intend <trainBrakeOperation> to be compulsory?
>
> Thank you,
> with best regards,
> Dirk.
>
Re: missing minOccurs="0" for <trainBrakeOperation> [message #1976 is a reply to message #1886] Mon, 01 October 2018 11:46 Go to previous messageGo to next message
Dirk Bräuer is currently offline  Dirk Bräuer
Messages: 311
Registered: August 2008
Senior Member
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.
@minOccurs, @maxOccurs and @use [message #1980 is a reply to message #1976] Tue, 02 October 2018 13:18 Go to previous messageGo to next 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
Re: missing minOccurs="0" for <trainBrakeOperation> [message #1981 is a reply to message #1976] Tue, 02 October 2018 13:25 Go to previous message
christian.rahmig is currently offline  christian.rahmig
Messages: 436
Registered: January 2016
Senior Member
Dear Dirk, dear all,

Am 01.10.2018 um 11:46 schrieb Dirk Bräuer:
> [...] In rollingstock.xsd
> <xs:complexType name="eVehicleBrakes">
> <xs:element name="vehicleBrakeOperation" type="rail:tBasicBrakeOperation" maxOccurs="unbounded">
> no "minOccurs='0'" occurs...

has been corrected. Thank you!

> 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.)

For attributes, please use the property use="required" or use="optional"
(default).

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


Christian Rahmig – Infrastructure scheme coordinator
railML.org (Registry of Associations: VR 5750)
Altplauen 19h; 01187 Dresden; Germany www.railML.org
Previous Topic: need for new element stopingActivity time
Next Topic: Rollingstock - modelling patterns
Goto Forum:
  


Current Time: Thu Mar 28 20:20:37 CET 2024