Home » railML newsgroups » railml.common » Use of lists in RailML to be commented
Use of lists in RailML to be commented [message #1081] Thu, 12 February 2009 06:18
Joerg von Lingen is currently offline  Joerg von Lingen
Messages: 148
Registered: May 2011
Senior Member

there is a question to user and XML experts about using lists within a attribute.

At the description of brake systems available we have the need to have a set, i.e. none or any out
of a given list, additional brakes. Thus I tried to translate this into XML in oder to have the
information in one attribute but limit the allowable values in the list.

This is the enumeration for the possible values:
<xs:simpleType name="tBrkPos" final="restriction">
<xs:restriction base="xs:string">
<xs:enumeration value="H" />
<xs:enumeration value="E" />
<xs:enumeration value="Mg" />
<xs:enumeration value="Wb" />

This is the attribute using the list:
<xs:simpleType name="tAuxBrakes">
<xs:documentation>none, one or any of "H", "E", "Mg", "Wb"</xs:documentation>
<xs:list itemType="tBrkPos" />

The alternative would be a child element
<xsd:element name="auxiliaryBrakes" type="eAuxiliaryBrakes"
minOccurs="0" />

with a group of single attributes one for each value
<xsd:complexType name="eAuxiliaryBrakes">
<xsd:attributeGroup ref="aAuxiliaryBrakes" />

<xsd:attributeGroup name="aAuxiliaryBrakes">
<xsd:attribute name="H" type="xsd:boolean" use="optional" default="false" />
<xsd:attribute name="E" type="xsd:boolean" use="optional" default="false" />
<xsd:attribute name="Mg" type="xsd:boolean" use="optional" default="false" />
<xsd:attribute name="Wb" type="xsd:boolean" use="optional" default="false" />
<xsd:attribute name="ep" type="xsd:boolean" use="optional" default="false" />

Could anyone please comment on the use of lists or the alternative in general but also with respect
to the best formulation in XML.

P.S.: Attribute and type names are not final.
Mit freundlichen Grüßen/Best regards,
Jörg von Lingen
Previous Topic: Vorstellung trafIT solutions
Next Topic: Thesis about a our sistem inegrated with RailML
Goto Forum:

Current Time: Tue Jul 16 06:03:07 CEST 2024