<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://xml.proemion.com/ProemionDataConfiguration/2012/07"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
  attributeFormDefault="unqualified" version="0.0.1"
  xmlns:pdc="http://xml.proemion.com/ProemionDataConfiguration/2012/07"
  xmlns:j1939="http://xml.proemion.com/ProemionDataConfiguration/2017/10">

  <xs:include schemaLocation="ProemionDataConfigurationCore.xsd"/>
  <xs:include schemaLocation="ProemionDataConfigurationParsing.xsd"/>
  <xs:include schemaLocation="ProemionDataConfigurationView.xsd"/>
  <xs:include schemaLocation="OrgPermissions.xsd"/>
  <xs:include schemaLocation="Actions.xsd"/>
  <xs:include schemaLocation="J1939SpnSpec.xsd"/>
  <xs:include schemaLocation="PredefinedUnits.xsd"/>
  <xs:element name="DataConfig">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        <![CDATA[Defines the root tag for the dod file to parse values for the proemion web portal.]]>
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Name" type="pdc:Message">
          <xs:annotation>
            <xs:documentation>A short naming for the configuration. Something like: "Simple config for Series 52xx".
Only the first 254 characters are used to display.</xs:documentation>
          </xs:annotation>
            <xs:unique name="UniqueNameLabelLang">
                <xs:selector xpath="pdc:Label"/>
                <xs:field xpath="@lang"/>
            </xs:unique>
        </xs:element>
        <xs:element minOccurs="0" name="Description" type="pdc:Message">
          <xs:annotation>
            <xs:documentation>Here you can input information as you need for clarifying this configuration. Or for example a changelog to previous versions of this configuration.</xs:documentation>
          </xs:annotation>
            <xs:unique name="UniqueDescLabelLang">
                <xs:selector xpath="pdc:Label"/>
                <xs:field xpath="@lang"/>
            </xs:unique>
        </xs:element>
        <xs:element ref="pdc:GlobalDictionary" minOccurs="0"/>
        <xs:element ref="pdc:Transformers" minOccurs="0"/>
        <xs:element minOccurs="0" ref="pdc:PredefinedUnits"/>
        <xs:element minOccurs="0" ref="pdc:J1939"/>
        <xs:element ref="pdc:Units" minOccurs="0"/>
        <xs:element ref="pdc:ValueDefinitions"/>
        <xs:element ref="pdc:ParsingDefinition"/>
        <xs:element ref="pdc:ViewDefinitions" minOccurs="0"/>
        <xs:element name="AccessPermission" maxOccurs="1" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="4" name="AccessLevel">
                <xs:complexType>
                  <xs:sequence>
                    <xs:choice maxOccurs="unbounded">
                      <xs:element name="valueDefinitionRef" type="xs:IDREF"/>
                    </xs:choice>
                  </xs:sequence>
                  <xs:attribute name="level" type="xs:integer"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element ref="pdc:Actions" minOccurs="0"/>
        <xs:element ref="pdc:Permissions" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="uuid" use="required" type="pdc:uuid">
        <xs:annotation>
          <xs:documentation xml:lang="en">
            <![CDATA[
             This unique identifier is used to keep track of a parameter
             description configuration. It allows the change of the configuration.             
             E.g. authors could edit a transformer and the implementation could adapt this
             change without causing any issues for the rest of the configuration.
             ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="customerVersion" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="en">
            <![CDATA[
            A version number managed by the customer, in the form of "integer.integer.integer", which means "{major}.{minor}.{patch}".
            For example: 1.0.0 
            ]]>
          </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:pattern value="[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="keyPrefix" use="optional" type="xs:string">
        <xs:annotation>
          <xs:documentation xml:lang="en">
            <![CDATA[keyPrefix]]>
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>
