Home » railML newsgroups » railml.common » Child elements with one value vs. attributes
Child elements with one value vs. attributes [message #1760] Thu, 12 April 2018 05:39 Go to next message
Joerg von Lingen is currently offline  Joerg von Lingen
Messages: 148
Registered: May 2011
Senior Member
Dear all,

in the existing railML schema we have placed the information mainly into attributes. In the current development of IL
part it appears that there are several child elements containing only one value but no attribute at all (variant 1). I
would suggest to transfer such values into an attribute of the parent element whenever this is suitable (variant 2).

1) variant
<rail3:overlapReleaseTimer code="ovt01" id="ovt01">
<rail3:timer>PT60S</rail3:timer>
<rail3:overlapReleaseCondition>startTimerAfterVacating</rail3:overlapReleaseCondition >
</rail3:overlapReleaseTimer>

2) variant
<rail3:overlapReleaseTimer code="ovt01" id="ovt01" timer="PT60S" overlapReleaseCondition="startTimerAfterVacating">
</rail3:overlapReleaseTimer>

Best Jörg.
Interlocking coordinator
Re: Child elements with one value vs. attributes [message #1839 is a reply to message #1760] Wed, 13 June 2018 13:08 Go to previous message
Christian Rößiger is currently offline  Christian Rößiger
Messages: 59
Registered: March 2015
Member
Hello Joerg,

this question was discussed in the railML-TT-Telco on 13.06.2018. There
was agreement that variant 2 should be used in the future. Variant 1 has
not yet been used within railML-TT-2.x.
In special cases, modeling with its own sub-element, but with an
attribute, should also be possible:

<rail3:overlapReleaseTimer code="ovt01" id="ovt01">
<rail3:timer duration="PT60S"/>
<rail3:overlapReleaseCondition condition="startTimerAfterVacating"/>
</rail3:overlapReleaseTimer>

This may be the case if existing XSD types are to be used or if this
modeling improves comprehensibility.

Many Greetings
Christian Rößiger


Am 12.04.2018 um 05:39 schrieb Joerg von Lingen:
> Dear all,
>
> in the existing railML schema we have placed the information mainly into attributes. In the current development of IL
> part it appears that there are several child elements containing only one value but no attribute at all (variant 1). I
> would suggest to transfer such values into an attribute of the parent element whenever this is suitable (variant 2).
>
> 1) variant
> <rail3:overlapReleaseTimer code="ovt01" id="ovt01">
> <rail3:timer>PT60S</rail3:timer>
> <rail3:overlapReleaseCondition>startTimerAfterVacating</rail3:overlapReleaseCondition >
> </rail3:overlapReleaseTimer>
>
> 2) variant
> <rail3:overlapReleaseTimer code="ovt01" id="ovt01" timer="PT60S" overlapReleaseCondition="startTimerAfterVacating">
> </rail3:overlapReleaseTimer>
>
> Best Jörg.
> Interlocking coordinator
>


--
iRFP e. K. · Institut für Regional- und Fernverkehrsplanung
Hochschulstr. 45, 01069 Dresden
Tel. +49 351 4706819 · Fax. +49 351 4768190 · www.irfp.de
Registergericht: Amtsgericht Dresden, HRA 9347
Previous Topic: [railML3] Strategy of documentation at wiki.railML.org
Next Topic: Change of Template:InheritIdName
Goto Forum:
  


Current Time: Thu Mar 28 18:38:23 CET 2024