228 lines
11 KiB
XML
228 lines
11 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<?xml-stylesheet href="schema2xhtml.xsl" type="text/xsl"?>
|
|
|
|
<!-- XML Schema for JMRI aspect-signaling support -->
|
|
|
|
<!-- This schema is part of JMRI. Copyright 2009. -->
|
|
<!-- -->
|
|
<!-- JMRI is free software; you can redistribute it and/or modify it under -->
|
|
<!-- the terms of version 2 of the GNU General Public License as published -->
|
|
<!-- by the Free Software Foundation. See the "COPYING" file for a copy -->
|
|
<!-- of this license. -->
|
|
<!-- -->
|
|
<!-- JMRI is distributed in the hope that it will be useful, but WITHOUT -->
|
|
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -->
|
|
<!-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -->
|
|
<!-- for more details. -->
|
|
|
|
<xs:schema xmlns:xs ="http://www.w3.org/2001/XMLSchema"
|
|
xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns:docbook="http://docbook.org/ns/docbook"
|
|
xmlns:jmri="http://jmri.org/xml/schema/JMRIschema"
|
|
xsi:schemaLocation="
|
|
http://jmri.org/xml/schema/JMRIschema http://jmri.org/xml/schema/JMRIschema.xsd
|
|
http://docbook.org/ns/docbook http://jmri.org/xml/schema/docbook/docbook.xsd
|
|
"
|
|
>
|
|
|
|
<xs:import namespace='http://docbook.org/ns/docbook' schemaLocation='http://jmri.org/xml/schema/docbook/docbook.xsd'/>
|
|
|
|
<xs:element name="aspecttable">
|
|
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
Top level elements without child elements become properties of the Signal System name bean.
|
|
We therefore allow unlimited extension of those at the end of the aspecttable element.
|
|
Only the first of multiple occurrances is kept as a property.
|
|
</xs:documentation>
|
|
<xs:appinfo>
|
|
<jmri:usingclass configurexml="false">jmri.managers.DefaultSignalSystemManager</jmri:usingclass>
|
|
</xs:appinfo>
|
|
</xs:annotation>
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
|
|
<xs:element name="name" minOccurs="1" maxOccurs="1"></xs:element>
|
|
|
|
<xs:element name="date" minOccurs="0" maxOccurs="1"></xs:element>
|
|
<xs:element name="reference" minOccurs="0" maxOccurs="unbounded"></xs:element>
|
|
|
|
<xs:element ref="docbook:copyright" minOccurs="1" maxOccurs="1" >
|
|
<xs:annotation><xs:documentation>
|
|
DocBook element(s) providing copyright information in standard form.
|
|
Must be present.
|
|
</xs:documentation></xs:annotation>
|
|
</xs:element>
|
|
|
|
<xs:element ref="docbook:authorgroup" minOccurs="1" maxOccurs="unbounded" >
|
|
<xs:annotation><xs:documentation>
|
|
DocBook element(s) describing the authors in standard form
|
|
</xs:documentation></xs:annotation>
|
|
</xs:element>
|
|
|
|
<xs:element ref="docbook:revhistory" minOccurs="1" maxOccurs="unbounded" >
|
|
<xs:annotation><xs:documentation>
|
|
DocBook element(s) describing the revision history in standard form
|
|
</xs:documentation></xs:annotation>
|
|
</xs:element>
|
|
|
|
<xs:element name="aspects" minOccurs="1" maxOccurs="1">
|
|
<xs:annotation><xs:documentation>
|
|
******** Required Aspect Table **********
|
|
</xs:documentation></xs:annotation>
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
|
|
<xs:element name="aspect" minOccurs="1" maxOccurs="unbounded">
|
|
<xs:complexType>
|
|
<xs:annotation><xs:documentation>
|
|
Top level elements without child elements become properties of the aspect.
|
|
We therefore allow unlimited extension of those at the end of the aspect element.
|
|
Only the first of multiple occurrances is kept as a property.
|
|
</xs:documentation></xs:annotation>
|
|
|
|
<xs:sequence>
|
|
|
|
<xs:element name="name" minOccurs="1" maxOccurs="1">
|
|
<xs:annotation><xs:documentation>
|
|
This must match zero or one "aspectname" element
|
|
in each appearance definition file.
|
|
</xs:documentation></xs:annotation>
|
|
<xs:complexType>
|
|
<xs:simpleContent>
|
|
<xs:extension base="xs:string">
|
|
<xs:attribute name="comment" type="xs:string"/>
|
|
</xs:extension>
|
|
</xs:simpleContent>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
|
|
<xs:element name="rule" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
|
|
<xs:element name="indication" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
|
|
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="unbounded"></xs:element>
|
|
<xs:element name="reference" type="xs:string" minOccurs="0" maxOccurs="unbounded"></xs:element>
|
|
<xs:element name="comment" type="xs:string" minOccurs="0" maxOccurs="unbounded"></xs:element>
|
|
<xs:element name="imagelink" type="xs:string" minOccurs="0" maxOccurs="unbounded"></xs:element>
|
|
<xs:element name="speed" minOccurs="1" maxOccurs="1">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:string">
|
|
<xs:annotation><xs:documentation>
|
|
These come from xml/signals/signalSpeeds.xml and must be kept consistent
|
|
</xs:documentation></xs:annotation>
|
|
<xs:enumeration value="Cab"/>
|
|
<xs:enumeration value="Maximum"/>
|
|
<xs:enumeration value="Normal"/>
|
|
<xs:enumeration value="Sixty"/>
|
|
<xs:enumeration value="Fifty"/>
|
|
<xs:enumeration value="Limited"/>
|
|
<xs:enumeration value="Medium"/>
|
|
<xs:enumeration value="Slow"/>
|
|
<xs:enumeration value="Restricted"/>
|
|
<xs:enumeration value="RestrictedSlow"/>
|
|
<xs:enumeration value="Stop"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:element>
|
|
<xs:element name="speed2" minOccurs="1" maxOccurs="1">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:string">
|
|
<xs:annotation><xs:documentation>
|
|
These come from xml/signals/signalSpeeds.xml and must be kept consistent
|
|
</xs:documentation></xs:annotation>
|
|
<xs:enumeration value="Cab"/>
|
|
<xs:enumeration value="Maximum"/>
|
|
<xs:enumeration value="Normal"/>
|
|
<xs:enumeration value="Sixty"/>
|
|
<xs:enumeration value="Fifty"/>
|
|
<xs:enumeration value="Limited"/>
|
|
<xs:enumeration value="Medium"/>
|
|
<xs:enumeration value="Slow"/>
|
|
<xs:enumeration value="Restricted"/>
|
|
<xs:enumeration value="RestrictedSlow"/>
|
|
<xs:enumeration value="Stop"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:element>
|
|
<xs:element name="route" minOccurs="0" maxOccurs="1">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:string">
|
|
<xs:enumeration value="Diverging"/>
|
|
<xs:enumeration value="Normal"/>
|
|
<xs:enumeration value="Either"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:element>
|
|
<xs:element name="comment" type="xs:string" minOccurs="0" maxOccurs="unbounded"></xs:element>
|
|
<xs:element name="dccAspect" minOccurs="0" maxOccurs="1">
|
|
<xs:simpleType>
|
|
<xs:restriction base="xs:integer">
|
|
<xs:minInclusive value="0"/>
|
|
<xs:maxInclusive value="32"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
</xs:element>
|
|
|
|
<!-- next line causes a "Unique Particle Attribution" error -->
|
|
<!-- <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/> -->
|
|
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
|
|
|
<xs:element name="imagetypes" minOccurs="0" maxOccurs="1">
|
|
<xs:annotation><xs:documentation>
|
|
******** Table of imagelink types **********
|
|
</xs:documentation></xs:annotation>
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="imagetype" minOccurs="0" maxOccurs="unbounded" >
|
|
<xs:complexType><!-- ensures no character content to element -->
|
|
<xs:attribute name="type" type="xs:string"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="appearancefiles" minOccurs="1" maxOccurs="1">
|
|
<xs:annotation><xs:documentation>
|
|
******** Table of appearance XML filename **********
|
|
</xs:documentation></xs:annotation>
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="appearancefile" minOccurs="0" maxOccurs="unbounded">
|
|
<xs:complexType><!-- ensures no character content to element -->
|
|
<xs:attribute name="href" type="xs:string"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
|
|
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<!-- aspect names must be unique -->
|
|
<xs:key name="uniqueAspectName">
|
|
<xs:annotation><xs:documentation>The uniqueAspectName check constrains each aspect name value to be unique. </xs:documentation></xs:annotation>
|
|
<xs:selector xpath="./aspects/aspect/name"/>
|
|
<xs:field xpath="."/>
|
|
</xs:key>
|
|
|
|
<!-- appearance files must be unique -->
|
|
<xs:key name="uniqueAppearanceFile">
|
|
<xs:annotation><xs:documentation>The uniqueAppearanceFile check constrains each appearance file reference to be unique. </xs:documentation></xs:annotation>
|
|
<xs:selector xpath="./appearancefiles/appearancefile"/>
|
|
<xs:field xpath="@href"/>
|
|
</xs:key>
|
|
|
|
</xs:element>
|
|
</xs:schema>
|