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

<!-- This schema is part of JMRI. Copyright 2018.                           -->
<!--                                                                        -->
<!-- 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.                                                      -->

<!-- This file contains definitions for LogixNG DigitalExpressions.         -->

<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:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/and-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/antecedent-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/connection-name-5.1.3.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/digital-call-module-4.23.4.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-audio-5.5.4.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-block-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-clock-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-conditional-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-dispatcher-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-entryexit-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-light-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-linux-line-power-5.3.4.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-local-variable-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-loconet-slot-usage-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-memory-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-oblock-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-power-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-reference-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-reporter-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-script-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-section-5.3.5.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-sensor-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-sensor-edge-5.1.7.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-signalhead-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-signalmast-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-transit-5.3.5.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-turnout-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/expression-warrant-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/false-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/file-as-flag.5.5.2.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/formula-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/hold-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/last-result-of-digital-expression-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/log-data-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/not-4.23.3.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/or-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/reset-on-true-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/timer-5.5.6.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/trigger-once-4.23.1.xsd"/>
  <xs:include schemaLocation="http://jmri.org/xml/schema/logixng/digital-expressions/true-4.23.1.xsd"/>

    <xs:complexType name="LogixNG_DigitalExpressionManagerType">
      <xs:annotation>
        <xs:documentation>
          Define the XML stucture for storing the contents of a DigitalExpressionManager implementation.
        </xs:documentation>
        <xs:appinfo>
            <jmri:usingclass configurexml="true">jmri.jmrit.logixng.digital.implementation.configurexml.DefaultDigitalExpressionManagerXml</jmri:usingclass>
        </xs:appinfo>
      </xs:annotation>
      <xs:sequence>

        <!-- Permit any of these tags in any order in any number -->
        <xs:choice minOccurs="0" maxOccurs="unbounded">

            <xs:element name="And"                type="LogixNG_DigitalExpression_AndType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="Antecedent"         type="LogixNG_DigitalExpression_AntecedentType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="CallDigitalExpressionModule"  type="LogixNG_DigitalExpression_CallModuleType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ConnectionName"     type="LogixNG_DigitalExpression_ConnectionNameType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionAudio"    type="LogixNG_DigitalExpression_ExpressionAudioType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionBlock"    type="LogixNG_DigitalExpression_ExpressionBlockType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionClock"    type="LogixNG_DigitalExpression_ExpressionClockType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionConditional"  type="LogixNG_DigitalExpression_ExpressionConditionalType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionDispatcher"  type="LogixNG_DigitalExpression_ExpressionDispatcherType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionEntryExit"    type="LogixNG_DigitalExpression_ExpressionEntryExit" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionLight"    type="LogixNG_DigitalExpression_ExpressionLightType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionLinuxLinePower"  type="LogixNG_DigitalExpression_ExpressionLinuxLinePowerType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionLocalVariable"  type="LogixNG_DigitalExpression_ExpressionLocalVariableType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionLoconetSlotUsage" type="LogixNG_DigitalExpression_ExpressionLocoNetSlotUsageType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionMemory"   type="LogixNG_DigitalExpression_ExpressionMemoryType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionOBlock"   type="LogixNG_DigitalExpression_ExpressionOBlockType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionPower"    type="LogixNG_DigitalExpression_ExpressionPowerType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionReference"  type="LogixNG_DigitalExpression_ExpressionReferenceType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionReporter" type="LogixNG_DigitalExpression_ExpressionReporterType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionScript"   type="LogixNG_DigitalExpression_ExpressionScriptType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionSection"  type="LogixNG_DigitalExpression_ExpressionSectionType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionSensor"   type="LogixNG_DigitalExpression_ExpressionSensorType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionSensorEdge"  type="LogixNG_DigitalExpression_ExpressionSensorEdgeType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionSignalHead"  type="LogixNG_DigitalExpression_ExpressionSignalHeadType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionSignalMast"  type="LogixNG_DigitalExpression_ExpressionSignalMastType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionSimpleScript"  type="LogixNG_DigitalExpression_ExpressionScriptType" minOccurs="0" maxOccurs="unbounded" /> <!-- Kept temporary. Remove for 4.26 -->
            <xs:element name="ExpressionTransit"  type="LogixNG_DigitalExpression_ExpressionTransitType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionTurnout"  type="LogixNG_DigitalExpression_ExpressionTurnoutType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ExpressionWarrant"  type="LogixNG_DigitalExpression_ExpressionWarrantType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="False"              type="LogixNG_DigitalExpression_FalseType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="FileAsFlag"         type="LogixNG_DigitalExpression_FileAsFlagType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="DigitalFormula"     type="LogixNG_DigitalExpression_FormulaType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="Hold"               type="LogixNG_DigitalExpression_HoldType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="LastResultOfDigitalExpression"  type="LogixNG_DigitalExpression_LastResultOfDigitalExpressionType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="LogData"            type="LogixNG_DigitalExpression_LogDataType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="Not"                type="LogixNG_DigitalExpression_NotType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="Or"                 type="LogixNG_DigitalExpression_OrType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="ResetOnTrue"        type="LogixNG_DigitalExpression_ResetOnTrueType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="Timer"              type="LogixNG_DigitalExpression_TimerType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="TriggerOnce"        type="LogixNG_DigitalExpression_TriggerOnceType" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="True"               type="LogixNG_DigitalExpression_TrueType" minOccurs="0" maxOccurs="unbounded" />

          </xs:choice>
      </xs:sequence>
      <xs:attribute name="class" type="classType" use="required"/>
    </xs:complexType>

</xs:schema>
