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

<!-- Schema for JMRI decoder definitions       -->

<!-- $Id: decoder.xsd 18547 2011-09-18 20:19:55Z jacobsen $ -->

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


    <!-- need variable -->
    
    <!-- not yet in proper Venetian blind form -->
    <!-- needs to share the pane type with programmer definition -->
    
    <!-- need documentation, etc -->

    <!-- need attribute restrictions -->
    <!-- need attribute defaults -->
    
<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/types/general.xsd"/>
    <xs:import namespace='http://docbook.org/ns/docbook' schemaLocation='http://jmri.org/xml/schema/docbook/DocBook.xsd'/>

<xs:annotation>
    <xs:documentation>
      Defines the JMRI decoder definition files.
    </xs:documentation>
    <xs:appinfo>
        <jmri:usingclass configurexml="false">jmri.jmrit.decoderdefn.DecoderFile</jmri:usingclass>
        <jmri:usingclass configurexml="false">jmri.jmrit.symbolicprog.VariableTableModel</jmri:usingclass>
    </xs:appinfo>
</xs:annotation>

  <xs:complexType name="VersionType">
      <xs:attribute name="author" type="xs:string" />
      <xs:attribute name="version" type="xs:string" />
      <xs:attribute name="lastUpdated" type="xs:string" />
  </xs:complexType>

  <xs:complexType name="DecoderType">
    <xs:sequence>

      <xs:element name="family" type="FamilyType" minOccurs="1" maxOccurs="1" />

      <xs:element name="programming" minOccurs="1" maxOccurs="1" >
        <xs:complexType>
          <xs:attribute name="direct" default="no" >
            <xs:simpleType>
              <xs:restriction base="xs:token">
                <xs:enumeration value="yes"/>
                <xs:enumeration value="no"/>
                <xs:enumeration value="bitOnly"/>
                <xs:enumeration value="byteOnly"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="paged" type="yesNoType" default="no" />
          <xs:attribute name="register" type="yesNoType" default="no" />
          <xs:attribute name="ops" type="yesNoType" default="no" />
          <xs:attribute name="transpRead" type="yesNoType" default="no" />
          <xs:attribute name="bidirRead" type="yesNoType" default="no" />
        </xs:complexType>
      </xs:element>

      <xs:element name="variables" type="VariablesType" minOccurs="1" maxOccurs="1" />

      <xs:element name="resets" type="ResetsType" minOccurs="0" maxOccurs="1"/>

    </xs:sequence>
  </xs:complexType>

  <xs:element name="decoder-config">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="version" type="VersionType" minOccurs="0" maxOccurs="unbounded" />
        <xs:element name="decoder" type="DecoderType" minOccurs="1" maxOccurs="1"/>
        <xs:element name="pane"    type="PaneType" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="showEmptyPanes" type="yesNoType"/>
    </xs:complexType>
  </xs:element>


  <xs:complexType name="FamilyType">
    <xs:sequence>

      <xs:element name="model" minOccurs="0" maxOccurs="unbounded" >
        <xs:complexType>
          <xs:sequence>
            <xs:element name="versionCV" minOccurs="0" maxOccurs="unbounded" >
              <xs:complexType>
                <xs:attribute name="lowVersionID" type="xs:int" />
                <xs:attribute name="highVersionID" type="xs:int" />
                <xs:attribute name="comment" type="xs:string" />
              </xs:complexType>
            </xs:element>
            <xs:element name="output" minOccurs="0" maxOccurs="unbounded" >
              <xs:complexType>
                <xs:attribute name="name" type="xs:string" use="required"/>
                <xs:attribute name="label" type="xs:string" />
                <xs:attribute name="comment" type="xs:string" />
                <xs:attribute name="maxcurrent" type="xs:string" />
                <xs:attribute name="connection" default="unspecified" >
                  <xs:simpleType>
                    <xs:restriction base="xs:token" >
                      <xs:enumeration value="unspecified"/>
                      <xs:enumeration value="plug"/>
                      <xs:enumeration value="wire"/>
                      <xs:enumeration value="solder"/>
                      <xs:enumeration value="LED"/>
                      <xs:enumeration value="bulb"/>
                      <xs:enumeration value="other"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
              </xs:complexType>
            </xs:element>
            <xs:element name="size" minOccurs="0" maxOccurs="1" >
              <xs:complexType>
                <xs:attribute name="length" type="xs:string" />
                <xs:attribute name="width" type="xs:string" />
                <xs:attribute name="height" type="xs:string" />
                <xs:attribute name="units" use="required" >
                  <xs:simpleType>
                    <xs:restriction base="xs:token" >
                      <xs:enumeration value="inches"/>
                      <xs:enumeration value="mm"/>
                      <xs:enumeration value="cm"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
                <xs:attribute name="comment" type="xs:string" />
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="model" type="xs:string" use="required"/>
          <xs:attribute name="options" type="xs:string" />
          <xs:attribute name="comment" type="xs:string" />
          <xs:attribute name="numFns" type="xs:int" />
          <xs:attribute name="numOuts" type="xs:int" />
          <xs:attribute name="lowVersionID" type="xs:int" />
          <xs:attribute name="highVersionID" type="xs:int" />
          <xs:attribute name="productID" type="xs:string" />
          <xs:attribute name="maxInputVolts" type="xs:string" />
          <xs:attribute name="maxMotorCurrent" type="xs:string" />
          <xs:attribute name="maxTotalCurrent" type="xs:string" />
          <xs:attribute name="formFactor" type="xs:string" />
          <xs:attribute name="nmraWarrant" type="yesNoType" default="no" />
          <xs:attribute name="nmraWarrantStart" type="xs:string" />
          <xs:attribute name="nmraWarrantEnd" type="xs:string" />
          <xs:attribute name="connector" default="unspecified" >
            <xs:simpleType>
              <xs:restriction base="xs:token"  >
                <xs:enumeration value="unspecified"/>
                <xs:enumeration value="NMRAsmall"/>
                <xs:enumeration value="NMRAmedium"/>
                <xs:enumeration value="NMRAlarge"/>
                <xs:enumeration value="9pin"/>
                <xs:enumeration value="21MTC"/>
                <xs:enumeration value="PluX8"/>
                <xs:enumeration value="PluX16"/>
                <xs:enumeration value="PluX22"/>
                <xs:enumeration value="other"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="extFnsNmraF13" type="yesNoType" />
          <xs:attribute name="extFnsNmraBSC" type="yesNoType" />
          <xs:attribute name="extFnsMRC" type="yesNoType" />
        </xs:complexType>
      </xs:element>
      
      <xs:element name="functionlabels" minOccurs="0" maxOccurs="1">
        <xs:complexType><xs:sequence>
          <xs:element name="functionlabel" minOccurs="0" maxOccurs="unbounded">
            <xs:complexType>
              <xs:simpleContent>
                <xs:extension base="xs:string">
                  <xs:attribute name="num" type="xs:string"/>
                  <xs:attribute name="lockable" type="xs:string"/>
                </xs:extension>
              </xs:simpleContent>
            </xs:complexType>
          </xs:element>
        </xs:sequence></xs:complexType>
      </xs:element>

    </xs:sequence>
    <xs:attribute name="name" type="xs:string" />
    <xs:attribute name="mfg" type="xs:string" />
    <xs:attribute name="lowVersionID" type="xs:int" />
    <xs:attribute name="highVersionID" type="xs:int" />
    <xs:attribute name="type" type="xs:string" />
    <xs:attribute name="comment" type="xs:string" />
  </xs:complexType>

  <xs:complexType name="VariablesType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element name="variables" type="VariablesType" minOccurs="0" maxOccurs="unbounded" >
        <xs:annotation><xs:documentation>Can be nested to make it possible to include groups</xs:documentation></xs:annotation>
      </xs:element>

      <xs:element ref="docbook:copyright" minOccurs="0" maxOccurs="1" >
          <xs:annotation><xs:documentation>
          DocBook element(s) providing copyright information in standard form.
          For use in subfiles.
          </xs:documentation></xs:annotation>
      </xs:element>
        
      <xs:element ref="docbook:authorgroup" minOccurs="0" maxOccurs="unbounded" >
          <xs:annotation><xs:documentation>
          DocBook element(s) describing the authors in standard form.
          For use in subfiles.
          </xs:documentation></xs:annotation>
      </xs:element>
        
      <xs:element ref="docbook:revhistory" minOccurs="0" maxOccurs="unbounded" >
          <xs:annotation><xs:documentation>
          DocBook element(s) describing the revision history in standard form.
          For use in subfiles.
          </xs:documentation></xs:annotation>
      </xs:element>

      <xs:element name="constant" minOccurs="0" maxOccurs="unbounded" >
        <xs:complexType>
          <xs:attribute name="label" type="xs:string" use="required"/>
          <xs:attribute name="default" type="xs:int"/>
          <xs:attribute name="comment" type="xs:string"/>
          <xs:attribute name="item" type="xs:string"/>
          <xs:attribute name="minFn" type="xs:int"/>
          <xs:attribute name="minOut" type="xs:int"/>
          <xs:attribute name="inOptions" type="xs:string"/>
        </xs:complexType>
      </xs:element>
      
      <xs:element name="iconstant" minOccurs="0" maxOccurs="unbounded" >
        <xs:complexType>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:annotation><xs:documentation>Provide an internationalized label text</xs:documentation></xs:annotation>
            <xs:element name="label" minOccurs="0" maxOccurs="unbounded" />
          </xs:sequence>
          <xs:attribute name="label" type="xs:string" use="required"/>
          <xs:attribute name="default" type="xs:int"/>
          <xs:attribute name="comment" type="xs:string"/>
          <xs:attribute name="item" type="xs:string"/>
          <xs:attribute name="minFn" type="xs:int"/>
          <xs:attribute name="minOut" type="xs:int"/>
          <xs:attribute name="inOptions" type="xs:string"/>
        </xs:complexType>
      </xs:element>
      
      <xs:element name="variable" minOccurs="0" maxOccurs="unbounded" >
        <xs:complexType>
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:choice>
              <xs:element name="enumVal" >
                <xs:annotation><xs:documentation>
                A fixed set of choices is defined, each corresponding to a specific value
                </xs:documentation></xs:annotation>
                <xs:complexType>
                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element ref="docbook:copyright" minOccurs="0" maxOccurs="1" />
                    <xs:element ref="docbook:authorgroup" minOccurs="0" maxOccurs="unbounded" />
                    <xs:element ref="docbook:revhistory" minOccurs="0" maxOccurs="unbounded" />
                    <xs:element name="enumChoice" >
                      <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                          <xs:annotation><xs:documentation>Provide an internationalized choice text</xs:documentation></xs:annotation>
                          <xs:element name="choice" minOccurs="0" maxOccurs="unbounded" />
                        </xs:sequence>
                        <xs:attribute name="choice" type="xs:string" use="required"/>
                        <xs:attribute name="value" type="xs:int" />
                        <xs:attribute name="comment" type="xs:string"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="comment" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="decVal" >
                <xs:annotation><xs:documentation>
                A decimal value is used, subject to mask and limit requirements
                </xs:documentation></xs:annotation>
                <xs:complexType>
                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:annotation><xs:documentation>Provide an internationalized label text</xs:documentation></xs:annotation>
                    <xs:element name="label" minOccurs="0" maxOccurs="unbounded" />
                  </xs:sequence>
                  <xs:attribute name="min" type="xs:int" default="0"/>
                  <xs:attribute name="max" type="xs:int" default="255"/>
                  <xs:attribute name="comment" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="hexVal" >
                <xs:annotation><xs:documentation>
                A hexadecimal value is used, subject to mask and limit requirements
                </xs:documentation></xs:annotation>
                <xs:complexType>
                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:annotation><xs:documentation>Provide an internationalized label text</xs:documentation></xs:annotation>
                    <xs:element name="label" minOccurs="0" maxOccurs="unbounded" />
                  </xs:sequence>
                  <xs:attribute name="min" type="xs:string" default="0"/>
                  <xs:attribute name="max" type="xs:string" default="ff"/>
                  <xs:attribute name="comment" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="speedTableVal" >
                <xs:annotation><xs:documentation>
                NMRA speed table
                </xs:documentation></xs:annotation>
                <xs:complexType>
                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="speedTableEntry" >
                      <xs:complexType>
                        <xs:attribute name="step" type="xs:int" use="required" />
                        <xs:attribute name="value" type="xs:int" use="required"  />
                        <xs:attribute name="comment" type="xs:string"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="entries" type="xs:int" default="28" />
                  <xs:attribute name="min" type="xs:int" default="0"/>
                  <xs:attribute name="max" type="xs:int" default="255"/>
                  <xs:attribute name="comment" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="longAddressVal" >
                <xs:annotation><xs:documentation>
                NMRA long address, including its unique behaviors
                </xs:documentation></xs:annotation>
                <xs:complexType>
                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:annotation><xs:documentation>Provide an internationalized label text</xs:documentation></xs:annotation>
                    <xs:element name="label" minOccurs="0" maxOccurs="unbounded" />
                  </xs:sequence>
                  <xs:attribute name="comment" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="shortAddressVal" >
                <xs:annotation><xs:documentation>
                NMRA short address, including its unique behaviors
                </xs:documentation></xs:annotation>
                <xs:complexType>
                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="shortAddressChanges" >
                      <xs:complexType>
                        <xs:attribute name="cv" type="xs:int" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="comment" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="splitVal" >
                <xs:annotation><xs:documentation>
                A decimal value, but stored across two CVs using some simple calculations
                </xs:documentation></xs:annotation>
                <xs:complexType>
                  <xs:attribute name="highCV" type="xs:int"/>
                  <xs:attribute name="min" type="xs:int" default="0"/>
                  <xs:attribute name="max" type="xs:int" default="255"/>
                  <xs:attribute name="default" type="xs:int"/>
                  <xs:attribute name="factor" type="xs:int" default="1"/>
                  <xs:attribute name="offset" type="xs:int" default="0"/>
                  <xs:attribute name="comment" type="xs:string"/>
                  <xs:attribute name="upperMask" type="xs:string" default="VVVVVVVV" />
                </xs:complexType>
              </xs:element>
              <xs:element name="compositeVal" >
                <xs:annotation><xs:documentation>
                A value made up of references to others
                </xs:documentation></xs:annotation>
                <xs:complexType>
                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="compositeChoice" >
                      <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                          <xs:element name="compositeSetting" >
                            <xs:complexType>
                              <xs:attribute name="label" type="xs:string" use="required"/>
                              <xs:attribute name="value" type="xs:int" use="required" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="choice" type="xs:string" use="required"/>
                        <xs:attribute name="comment" type="xs:string"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="comment" type="xs:string"/>
                </xs:complexType>
              </xs:element>
            </xs:choice>
            <xs:element name="label" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation><xs:documentation>Provide an internationalized label text</xs:documentation></xs:annotation>
            </xs:element>
            <xs:element name="comment" minOccurs="0" maxOccurs="unbounded">
              <xs:annotation><xs:documentation>Provide internationalized comment text</xs:documentation></xs:annotation>
            </xs:element>
            <xs:element name="qualifier" type="QualifierType" minOccurs="0" maxOccurs="unbounded" >
              <xs:annotation><xs:documentation>
              Qualifies whether this variable will appear in the interface, depending
              on the value in other variables.
              </xs:documentation></xs:annotation>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="label" type="xs:string"/>
          <xs:attribute name="CV" type="xs:int"/>
          <xs:attribute name="mask" type="xs:string" default="VVVVVVVV" />
          <xs:attribute name="readOnly" type="yesNoType" default="no" />
          <xs:attribute name="infoOnly" type="yesNoType" default="no" />
          <xs:attribute name="opsOnly" type="yesNoType" default="no" />
          <xs:attribute name="writeOnly" type="yesNoType" default="no" />
          <xs:attribute name="default" type="xs:string"/>
          <xs:attribute name="comment" type="xs:string"/>
          <xs:attribute name="item" type="xs:string"/>
          <xs:attribute name="minFn" type="xs:int"/>
          <xs:attribute name="minOut" type="xs:int"/>
          <xs:attribute name="inOptions" type="xs:string"/>
          <xs:attribute name="tooltip" type="xs:string"/>
          <xs:attribute name="include" type="xs:string"/>
          <xs:attribute name="exclude" type="xs:string"/>
        </xs:complexType>
      </xs:element>
      
      <xs:element name="ivariable" minOccurs="0" maxOccurs="unbounded" >
        <xs:complexType>
          <xs:sequence minOccurs="0" maxOccurs="1">
              <xs:choice>
                <xs:element name="ienumVal" >
                  <xs:complexType>
                    <xs:sequence minOccurs="0" maxOccurs="unbounded">
                      <xs:element name="ienumChoice" minOccurs="0" maxOccurs="unbounded" >
                        <xs:complexType>
                          <xs:sequence>
                            <xs:element name="choice" minOccurs="0" maxOccurs="unbounded"/>
                          </xs:sequence>
                          <xs:attribute name="choice" type="xs:string"/>
                          <xs:attribute name="value" type="xs:int"/>
                          <xs:attribute name="include" type="xs:string"/>
                        </xs:complexType>
                      </xs:element>
                    </xs:sequence>
                    <xs:attribute name="comment" type="xs:string"/>
                  </xs:complexType>
                </xs:element>
                <xs:element name="indexedVal" >
                  <xs:complexType>
                    <xs:attribute name="min" type="xs:string"/>
                    <xs:attribute name="max" type="xs:string"/>
                    <xs:attribute name="comment" type="xs:string"/>
                  </xs:complexType>
                </xs:element>
                <xs:element name="indexedPairVal" >
                <xs:complexType>
                    <xs:attribute name="highCVname" type="xs:string"/>
                    <xs:attribute name="min" type="xs:string"/>
                    <xs:attribute name="max" type="xs:string"/>
                    <xs:attribute name="default" type="xs:string"/>
                    <xs:attribute name="factor" type="xs:string"/>
                    <xs:attribute name="offset" type="xs:string"/>
                    <xs:attribute name="comment" type="xs:string"/>
                    <xs:attribute name="upperMask" type="xs:string"/>
                  </xs:complexType>
                </xs:element>
              </xs:choice>
              <xs:element name="qualifier" type="QualifierType" minOccurs="0" maxOccurs="unbounded" >
                <xs:annotation><xs:documentation>
                Qualifies whether this variable will appear in the interface, depending
                on the value in other variables.
                </xs:documentation></xs:annotation>
              </xs:element>
          </xs:sequence>
          <xs:attribute name="label" type="xs:string"/>
          <xs:attribute name="CVname" type="xs:string"/>
          <xs:attribute name="CV" type="xs:int"/>
          <xs:attribute name="PI" type="xs:int"/>
          <xs:attribute name="SI" type="xs:int"/>
          <xs:attribute name="mask" type="xs:string"/>
          <xs:attribute name="readOnly" type="yesNoType"/>
          <xs:attribute name="infoOnly" type="yesNoType"/>
          <xs:attribute name="opsOnly" type="yesNoType"/>
          <xs:attribute name="writeOnly" type="yesNoType"/>
          <xs:attribute name="default" type="xs:int"/>
          <xs:attribute name="comment" type="xs:string"/>
          <xs:attribute name="item" type="xs:string"/>
          <xs:attribute name="minFn" type="xs:int"/>
          <xs:attribute name="minOut" type="xs:int"/>
          <xs:attribute name="inOptions" type="xs:string"/>
          <xs:attribute name="tooltip" type="xs:string"/>
          <xs:attribute name="include" type="xs:string"/>
          <xs:attribute name="exclude" type="xs:string"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="ResetsType">
    <xs:sequence>
      <xs:element name="factReset" minOccurs="0" maxOccurs="unbounded" >
        <xs:complexType>
          <xs:attribute name="label" type="xs:string"/>
          <xs:attribute name="CV" type="xs:string"/>
          <xs:attribute name="default" type="xs:string"/>
          <xs:attribute name="comment" type="xs:string"/>
          <xs:attribute name="item" type="xs:string"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="ifactReset" minOccurs="0" maxOccurs="unbounded" >
        <xs:complexType>
          <xs:attribute name="label" type="xs:string"/>
          <xs:attribute name="CVname" type="xs:string"/>
          <xs:attribute name="CV" type="xs:string"/>
          <xs:attribute name="PI" type="xs:string"/>
          <xs:attribute name="SI" type="xs:string"/>
          <xs:attribute name="default" type="xs:string"/>
          <xs:attribute name="comment" type="xs:string"/>
          <xs:attribute name="item" type="xs:string"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="PaneType">
    <xs:sequence>
      <xs:choice>
        <xs:element name="row" type="PaneRowType" minOccurs="0" maxOccurs="unbounded" />
        <xs:element name="column" type="PaneColumnType" minOccurs="0" maxOccurs="unbounded"/>
      </xs:choice>
      <xs:element name="name" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="nameFmt" type="xs:string"/>
  </xs:complexType>
  <xs:complexType name="PaneRowType">
    <xs:sequence minOccurs="1" maxOccurs="unbounded">
      <xs:element name="column" type="PaneColumnType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="label" type="LabelType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="display" type="DisplayType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="separator" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="dccaddress" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="cvtable" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="indxcvtable" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PaneColumnType">
    <xs:sequence minOccurs="1" maxOccurs="unbounded">
      <xs:element name="row" type="PaneRowType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="label" type="LabelType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="display" type="DisplayType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="separator" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="dccaddress" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="cvtable" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="indxcvtable" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="LabelType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element name="label" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation><xs:documentation>Provide internationalized label text</xs:documentation></xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="label" type="xs:string"/>
  </xs:complexType>
  <xs:complexType name="DisplayType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element name="label" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation><xs:documentation>Provide internationalized label text</xs:documentation></xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="item" type="xs:string"/>
    <xs:attribute name="label" type="xs:string"/>
    <xs:attribute name="format" type="xs:string"/>
    <xs:attribute name="layout" type="xs:string"/>
    <xs:attribute name="tooltip" type="xs:string"/>
  </xs:complexType>

  <xs:complexType name="QualifierType">
    <xs:sequence minOccurs="1" maxOccurs="1">
      <xs:element name="variableref" />
      <xs:element name="relation">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="ge"/>
            <xs:enumeration value="gt"/>
            <xs:enumeration value="lt"/>
            <xs:enumeration value="le"/>
            <xs:enumeration value="eq"/>
            <xs:enumeration value="ne"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="value">
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:int" />
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

</xs:schema>

