railML 2.2 Schema Documentation

Table of Contents

top

Schema Document Properties

Target Namespace http://www.railml.org/schemas/2013
Version 2.2
Element and Attribute Namespaces
  • Global element and attribute declarations belong to this schema's target namespace.
  • By default, local element declarations belong to this schema's target namespace.
  • By default, local attribute declarations have no namespace.
Schema Composition
  • This schema imports schema(s) from the following namespace(s):
    • http://purl.org/dc/elements/1.1/ (at http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd)
    • http://www.w3.org/XML/1998/namespace (at http://www.w3.org/2001/03/xml.xsd)
Documentation Copyright (c) railML.org; All Rights Reserved.

This work is licensed under a Creative Commons Attribution 2.0 License. http://www.railml.org/index.php/license.html

For further information see: http://www.railml.org/

Content of this file: XML Schema for railML(R) 2.2 Definition of generic simple types, used by all sub schemas

Declared Namespaces

Prefix Namespace
xml http://www.w3.org/XML/1998/namespace
dc http://purl.org/dc/elements/1.1/
xs http://www.w3.org/2001/XMLSchema
rail http://www.railml.org/schemas/2013
Schema Component Representation
<xs:schema targetNamespace="http://www.railml.org/schemas/2013" elementFormDefault="qualified" version="2.2">
<xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
...
</xs:schema>
top

Global Definitions

Attribute Group: anyAttribute

Name anyAttribute
XML Instance Representation
Allow any attributes from a namespace other than this schema's namespace (strict validation).
Schema Component Representation
<xs:attributeGroup name="anyAttribute">
<xs:anyAttribute namespace="##other"/>
</xs:attributeGroup>
top

Complex Type: tAdditionalName

Super-types: None
Sub-types:
Name tAdditionalName
Abstract no
XML Instance Representation
<...
name="rail:tGenericName [0..1] ?"
description="rail:tElementDescription [0..1] ?"
xml:lang="[0..1] ?"/>
Schema Component Representation
<xs:complexType name="tAdditionalName">
<xs:attribute name="name" type="rail:tGenericName"/>
<xs:attribute name="description" type="rail:tElementDescription"/>
<xs:attribute ref="xml:lang"/>
<xs:attributeGroup ref="rail:anyAttribute"/>
</xs:complexType>
top

Complex Type: tElementRefInGroup

Super-types: tElementWithReference < tElementRefInGroup (by extension)
Sub-types: None
Name tElementRefInGroup
Abstract no
Documentation generic type for inheritance in serialized reference elements
XML Instance Representation
<...
ref="rail:tGenericRef [1] ?"
sequence="rail:tPositiveCounter [0..1]"/>
Schema Component Representation
<xs:complexType name="tElementRefInGroup">
<xs:complexContent>
<xs:extension base="rail:tElementWithReference">
<xs:attribute name="sequence" type="rail:tPositiveCounter"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
top

Complex Type: tElementWithIDAndName

Super-types: None
Sub-types:
Name tElementWithIDAndName
Abstract no
Documentation generic base type, used for inheritance of many railML types
XML Instance Representation
<...
id="rail:tGenericID [1] ?"
code="rail:tGenericName [0..1] ?"
name="rail:tGenericName [0..1] ?"
description="rail:tElementDescription [0..1] ?"
xml:lang="[0..1] ?">
<rail:additionalName> rail:tAdditionalName </rail:additionalName> [0..*] ?
Allow any elements from a namespace other than this schema's namespace (strict validation). [0..*]
</...>
Schema Component Representation
<xs:complexType name="tElementWithIDAndName">
<xs:sequence>
<xs:element name="additionalName" type="rail:tAdditionalName" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="rail:tGenericID" use="required"/>
<xs:attribute name="code" type="rail:tGenericName"/>
<xs:attribute name="name" type="rail:tGenericName"/>
<xs:attribute name="description" type="rail:tElementDescription"/>
<xs:attribute ref="xml:lang"/>
<xs:attributeGroup ref="rail:anyAttribute"/>
</xs:complexType>
top

Complex Type: tElementWithIDAndNameWithoutAny

Super-types: tAdditionalName < tElementWithIDAndNameWithoutAny (by extension)
Sub-types: None
Name tElementWithIDAndNameWithoutAny
Abstract no
Documentation Special derived type without 'any' element sequence but 'anyAttribute' for inheritance with 'xs:all' model group.
XML Instance Representation
<...
name="rail:tGenericName [0..1] ?"
description="rail:tElementDescription [0..1] ?"
xml:lang="[0..1] ?"
id="rail:tGenericID [1] ?"
code="rail:tGenericName [0..1] ?"/>
Schema Component Representation
<xs:complexType name="tElementWithIDAndNameWithoutAny">
<xs:complexContent>
<xs:extension base="rail:tAdditionalName">
<xs:attribute name="id" type="rail:tGenericID" use="required"/>
<xs:attribute name="code" type="rail:tGenericName"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
top

Complex Type: tElementWithReference

Super-types: None
Sub-types:
Name tElementWithReference
Abstract no
Documentation generic base type, used for inheritance of railML types deploying references
XML Instance Representation
<...
ref="rail:tGenericRef [1] ?"/>
Schema Component Representation
<xs:complexType name="tElementWithReference">
<xs:attribute name="ref" type="rail:tGenericRef" use="required"/>
<xs:attributeGroup ref="rail:anyAttribute"/>
</xs:complexType>
top

Complex Type: tGlobalElementWithMetadata

Super-types: tElementWithIDAndName < tGlobalElementWithMetadata (by extension)
Sub-types: None
Name tGlobalElementWithMetadata
Abstract no
Documentation generic base type, used for inheritance of railML subschema elements
XML Instance Representation
<...
id="rail:tGenericID [1] ?"
code="rail:tGenericName [0..1] ?"
name="rail:tGenericName [0..1] ?"
description="rail:tElementDescription [0..1] ?"
xml:lang="[0..1] ?"
version="rail:tRailMLVersion [0..1] ?"
xml:base="[0..1] ?">
<rail:additionalName> rail:tAdditionalName </rail:additionalName> [0..*] ?
Allow any elements from a namespace other than this schema's namespace (strict validation). [0..*]
<rail:metadata> dc:elementContainer </rail:metadata> [0..1] ?
</...>
Schema Component Representation
<xs:complexType name="tGlobalElementWithMetadata">
<xs:complexContent>
<xs:extension base="rail:tElementWithIDAndName">
<xs:sequence>
<xs:element name="metadata" type="dc:elementContainer" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="version" type="rail:tRailMLVersion"/>
<xs:attribute ref="xml:base"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
top

Simple Type: tCoordinateList

Super-types: tDoubleList (by restriction) < tCoordinateList (by restriction)
Sub-types: None
Name tCoordinateList
Content
  • List of: xs:double
  • length >= 2
Documentation an coordinate list consisting of two or three coordinates
Schema Component Representation
<xs:simpleType name="tCoordinateList">
<xs:restriction base="rail:tDoubleList">
<xs:minLength value="2"/>
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tCounter

Super-types: xs:nonNegativeInteger < tCounter (by restriction)
Sub-types: None
Name tCounter
Content
  • Base XSD Type: nonNegativeInteger
Documentation generic type for counters (e.g. number of equipment), allowing zero
Schema Component Representation
<xs:simpleType name="tCounter">
<xs:restriction base="xs:nonNegativeInteger"/>
</xs:simpleType>
top

Simple Type: tDigitString

Super-types: xs:string < tDigitString (by restriction)
Sub-types:
Name tDigitString
Content
  • Base XSD Type: string
  • pattern = [0-9]*
Documentation an arbitrary string consisting of digits from 0 to 9; not allowing white space, letters; no length restriction
Schema Component Representation
<xs:simpleType name="tDigitString">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]*"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tDoubleList

Super-types: None
Sub-types:
Name tDoubleList
Content
  • List of: xs:double
Documentation an arbitrary list consisting of xs:double values separated by white space; no length restriction
Schema Component Representation
<xs:simpleType name="tDoubleList">
<xs:list itemType="xs:double"/>
</xs:simpleType>
top

Simple Type: tElementDescription

Super-types: xs:string < tElementDescription (by restriction)
Sub-types: None
Name tElementDescription
Content
  • Base XSD Type: string
Documentation an detailed description of an railway facility (e.g. station, timetable period or vehicle), allowing digits, letters and white space
Schema Component Representation
<xs:simpleType name="tElementDescription">
<xs:restriction base="xs:string"/>
</xs:simpleType>
top

Simple Type: tFiveDigits

Super-types: xs:string < tDigitString (by restriction) < tFiveDigits (by restriction)
Sub-types: None
Name tFiveDigits
Content
  • Base XSD Type: string
  • pattern = [0-9]*
  • length = 5
Documentation an identification string consisting of exactly five digits
Schema Component Representation
<xs:simpleType name="tFiveDigits">
<xs:restriction base="rail:tDigitString">
<xs:length value="5"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tFourDigits

Super-types: xs:string < tDigitString (by restriction) < tFourDigits (by restriction)
Sub-types: None
Name tFourDigits
Content
  • Base XSD Type: string
  • pattern = [0-9]*
  • length = 4
Documentation an identification string consisting of exactly four digits
Schema Component Representation
<xs:simpleType name="tFourDigits">
<xs:restriction base="rail:tDigitString">
<xs:length value="4"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tGenericID

Super-types: xs:ID < tGenericID (by restriction)
Sub-types: None
Name tGenericID
Content
  • Base XSD Type: ID
Documentation an XML-side constrained bi-unique identity; unique across an XML file including its outsourced components (xi:include mechanism); white spaces not allowed
Schema Component Representation
<xs:simpleType name="tGenericID">
<xs:restriction base="xs:ID"/>
</xs:simpleType>
top

Simple Type: tGenericName

Super-types: xs:string < tGenericName (by restriction)
Sub-types: None
Name tGenericName
Content
  • Base XSD Type: string
Documentation system-wide known name of an railway facility (e.g. station, timetable period or vehicle), allowing digits, letters and white space
Schema Component Representation
<xs:simpleType name="tGenericName">
<xs:restriction base="xs:string"/>
</xs:simpleType>
top

Simple Type: tGenericRef

Super-types: xs:IDREF < tGenericRef (by restriction)
Sub-types: None
Name tGenericRef
Content
  • Base XSD Type: IDREF
Documentation an XML-side constrained reference to one xs:ID value, acts across an XML file including its outsourced components (xi:include mechanism)
Schema Component Representation
<xs:simpleType name="tGenericRef">
<xs:restriction base="xs:IDREF"/>
</xs:simpleType>
top

Simple Type: tOneDigit

Super-types: xs:string < tDigitString (by restriction) < tOneDigit (by restriction)
Sub-types: None
Name tOneDigit
Content
  • Base XSD Type: string
  • pattern = [0-9]*
  • length = 1
Documentation an identification string consisting of exactly one digit
Schema Component Representation
<xs:simpleType name="tOneDigit">
<xs:restriction base="rail:tDigitString">
<xs:length value="1"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tOneToZero

Super-types: xs:decimal < tOneToZero (by restriction)
Sub-types: None
Name tOneToZero
Content
  • Base XSD Type: decimal
  • 0 <= value <= 1
  • no. of fraction digits = 6
Documentation generic type for values only between 0 and 1, as efficiency or cosine phi.
Schema Component Representation
<xs:simpleType name="tOneToZero">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="1"/>
<xs:fractionDigits value="6"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tOtherEnumerationValue

Super-types: xs:string < tOtherEnumerationValue (by restriction)
Sub-types: None
Name tOtherEnumerationValue
Content
  • Base XSD Type: string
  • pattern = other:\w{2,}
Documentation an arbitrary string starting with 'other:' followed by at minimum two characters, white space not allowed for extending railML enumeration lists
Schema Component Representation
<xs:simpleType name="tOtherEnumerationValue">
<xs:restriction base="xs:string">
<xs:pattern value="other:\w{2,}"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tPositiveCounter

Super-types: xs:positiveInteger < tPositiveCounter (by restriction)
Sub-types: None
Name tPositiveCounter
Content
  • Base XSD Type: positiveInteger
Documentation generic type for counters (e.g. order number of a vehicle in an formation), starting with '1'
Schema Component Representation
<xs:simpleType name="tPositiveCounter">
<xs:restriction base="xs:positiveInteger"/>
</xs:simpleType>
top

Simple Type: tRailMLVersion

Super-types: xs:string < tRailMLVersion (by restriction)
Sub-types: None
Name tRailMLVersion
Content
  • Base XSD Type: string
  • pattern = [1-9][0-9]?\.([0-9]|[1-9][0-9])(\.[1-9][0-9]?)?(r[1-9][0-9]?[0-9]?)?
Documentation Version Number is some official release number, rather than any internal numbering from an version control system

Allows two part or three part version numbers, 1.0 up to 99.99, or 1.0.1 up to 99.99.99

Allows additional SVN release numbers for testing unofficial releases: 1.1r4 or 2.0r271
Schema Component Representation
<xs:simpleType name="tRailMLVersion">
<xs:restriction base="xs:string">
<xs:pattern value="[1-9][0-9]?\.([0-9]|[1-9][0-9])(\.[1-9][0-9]?)?(r[1-9][0-9]?[0-9]?)?"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tThreeDigits

Super-types: xs:string < tDigitString (by restriction) < tThreeDigits (by restriction)
Sub-types: None
Name tThreeDigits
Content
  • Base XSD Type: string
  • pattern = [0-9]*
  • length = 3
Documentation an identification string consisting of exactly three digits
Schema Component Representation
<xs:simpleType name="tThreeDigits">
<xs:restriction base="rail:tDigitString">
<xs:length value="3"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tTwoDigits

Super-types: xs:string < tDigitString (by restriction) < tTwoDigits (by restriction)
Sub-types: None
Name tTwoDigits
Content
  • Base XSD Type: string
  • pattern = [0-9]*
  • length = 2
Documentation an identification string consisting of exactly two digits
Schema Component Representation
<xs:simpleType name="tTwoDigits">
<xs:restriction base="rail:tDigitString">
<xs:length value="2"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tVerbalCounter

Super-types: xs:string < tVerbalCounter (by restriction)
Sub-types: None
Name tVerbalCounter
Content
  • Base XSD Type: string
  • value comes from list: {'single'|'double'|'triple'}
Documentation generic enumeration, where digits are not common
Schema Component Representation
<xs:simpleType name="tVerbalCounter">
<xs:restriction base="xs:string">
<xs:enumeration value="single"/>
<xs:enumeration value="double"/>
<xs:enumeration value="triple"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: tVersionNumber

Super-types: xs:string < tVersionNumber (by restriction)
Sub-types: None
Name tVersionNumber
Content
  • Base XSD Type: string
Documentation an arbitrary version number for any system; allowing digits, letters and white space
Schema Component Representation
<xs:simpleType name="tVersionNumber">
<xs:restriction base="xs:string"/>
</xs:simpleType>
top