<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="../schema2xhtml.xsl" type="text/xsl"?>

<!-- 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:complexType name="WarrantManagerType">
      <xs:annotation>
        <xs:documentation>
          Define the XML structure for storing the contents of a WarrantManager implementation.
        </xs:documentation>
        <xs:appinfo>
            <jmri:usingclass configurexml="true">mri.jmrit.logix.configurexml.WarrantManagerXml</jmri:usingclass>
        </xs:appinfo>
      </xs:annotation>
      <xs:sequence>
        <xs:element name="nxparams" minOccurs="0" maxOccurs="1">
         	<xs:complexType>
         	  <xs:sequence>
        		<xs:element name="scale" minOccurs="0" maxOccurs="1" type="xs:decimal">
        		</xs:element>
        		<xs:element name="maxspeed" minOccurs="0" maxOccurs="1" type="xs:decimal">
        		</xs:element>
        		<xs:element name="minspeed" minOccurs="0" maxOccurs="1" type="xs:decimal">
        		</xs:element>
        		<xs:element name="timeinterval" minOccurs="0" maxOccurs="1" type="xs:decimal">
        		</xs:element>
        		<xs:element name="numsteps" minOccurs="0" maxOccurs="1" type="xs:nonNegativeInteger">
        		</xs:element>
        		<xs:element name="haltstart" minOccurs="0" maxOccurs="1" type="yesNoType" >
        		</xs:element>
        	  </xs:sequence>	
          	</xs:complexType>
        </xs:element>       
        <xs:element name="warrant" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="blockOrder" minOccurs="0" maxOccurs="1" >
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="block" minOccurs="0" maxOccurs="1" >
                      <xs:complexType>  <!-- DTD had full block type here, but we start with min required -->
                        <xs:attribute name="systemName" type="systemNameType" use="required"/>
                        <xs:attribute name="userName" type="userNameType"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="pathName" type="xs:string" use="required"/>
                  <xs:attribute name="entryName" type="xs:string"/>
                  <xs:attribute name="exitName" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="viaOrder" minOccurs="0" maxOccurs="1" >
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="block" minOccurs="0" maxOccurs="1" >
                      <xs:complexType>  <!-- DTD had full block type here, but we start with min required -->
                        <xs:attribute name="systemName" type="systemNameType" use="required"/>
                        <xs:attribute name="userName" type="userNameType"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="pathName" type="xs:string" use="required"/>
                  <xs:attribute name="entryName" type="xs:string"/>
                  <xs:attribute name="exitName" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="throttleCommand" minOccurs="0" maxOccurs="1" >
                <xs:complexType>
                  <xs:attribute name="time" type="xs:string" use="required"/>
                  <xs:attribute name="command" type="xs:string" use="required"/>
                  <xs:attribute name="value" type="xs:string" use="required"/>
                  <xs:attribute name="block" type="xs:string" use="required"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="train" minOccurs="0" maxOccurs="1" >
                <xs:complexType>
                  <xs:attribute name="trainId" type="xs:string"/>
                  <xs:attribute name="dccAddress" type="xs:string"/>
                  <xs:attribute name="dccType" type="xs:string"/>
                  <xs:attribute name="runBlind" type="xs:string"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="systemName" type="systemNameType" use="required"/>
            <xs:attribute name="userName" type="userNameType" />
            <xs:attribute name="wtype" type="xs:string"/>
            <xs:attribute name="speedFactor" type="xs:string"/>
            <xs:attribute name="timeToPlatform" type="xs:string"/>
          </xs:complexType>
        </xs:element>
            
      </xs:sequence>
      <xs:attribute name="class" type="classType" use="required"/>
    </xs:complexType>

</xs:schema>
