Use of tOtherEnumerationValue

From railML 3 Wiki
Jump to navigation Jump to search


This page explains the definition of new enumeration values using the railML® type tOtherEnumerationValue. It is considered a subtopic of Dev:Extending railML.

  • In some places railML® offers the possibility to extend the enumeration list by self-defined values following some constraints. The railML® type "tOtherEnumerationValue" is included in the pre-defined enumeration list for these cases.
  • Good news first: For this technique no XML schema defintion is needed.
  • The "new enumeration value" should start with the string other:. It shall be followed by at least two "word characters"[1]. A "word character" is any unicode letter, number or symbol, excluding any punctuation, separators or whitespace. Notably, hyphen (-) and underscore (_) are not allowed. Best practice is to use only the letters A–Z/a–z and the digits 0–9, with camelCase for compound words that normally include spaces or hyphens.

example: <places count="10" category="other:blueSeat"/>

definition of tOtherEnumerationValue
<xs:simpleType name="tOtherEnumerationValue">
  <xs:annotation>
    <xs:documentation>an arbitrary string starting with 'other:' followed by at least two letters and/or digits, for extending railML enumeration lists</xs:documentation>
  </xs:annotation>
  <xs:restriction base="xs:string">
    <xs:pattern value="other:\w{2,}"/>
  </xs:restriction>
</xs:simpleType>

References