<?xml version="1.0" encoding="UTF-8"?>
<!--
  <FILE>
    <NAME>$HeadURL: https://vistrpdgsvn1.vi.vector.int/svn/CANdela/_Products/CANdelaStudio/trunk/Design/Imports/CDI%20Import/cdi.dtd $
    <REV >$LastChangedRevision: 46534 $
    <DATE>$LastChangedDate: 2009-08-28 13:02:45 +0200 (Fr, 28 Aug 2009) $
    <DESC>
  
    DTD for the CANdelaStudio import format.
    CDI is the abbreviation for CANdela Data Import
  
    <COPYRIGHT>(c) 2004-2005 by Vector Informatik GmbH.  All rights reserved.
  </FILE> 
-->
<!-- ================================================== -->
<!-- Entities -->
<!-- ================================================== -->
<!-- === base entities === -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:complexType name="C.Qualified">
    <xs:sequence>
      <xs:element ref="QUALIFIER"/>
      <xs:element ref="NAME"/>
      <xs:element minOccurs="0" ref="DESCRIPTION"/>
    </xs:sequence>
  </xs:complexType>
  <!-- === Object attribute entities === -->
  <xs:attributeGroup name="A.Obj">
    <xs:attribute name="id" use="required" type="xs:ID"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.Encoding">
    <xs:attribute name="encoding" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="signed"/>
          <xs:enumeration value="unsigned"/>
          <xs:enumeration value="bcd"/>
          <xs:enumeration value="ascii"/>
          <xs:enumeration value="float"/>
          <xs:enumeration value="unicode"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.ByteOrder">
    <xs:attribute name="byteorder" default="motorola">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="motorola"/>
          <xs:enumeration value="intel"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.SizeInfo">
    <xs:attribute name="sizeinfo" default="none">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="leadingsizeinfo"/>
          <xs:enumeration value="leadingsizeinfo2bytes"/>
          <xs:enumeration value="leadingsizeinfo3bytes"/>
          <xs:enumeration value="leadingsizeinfo4bytes"/>
          <xs:enumeration value="leadingsizeinfo5bytes"/>
          <xs:enumeration value="zeroterminationnozeropadding"/>
          <xs:enumeration value="none"/>
          <xs:enumeration value="zeroterminationormaxlengthorEOS"/>
          <xs:enumeration value="zeroterminationwithzeropadding"/>
          <xs:enumeration value="zeroterminationwithzeropaddingormaxlengthorEOS"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.DisplayFormat">
    <xs:attribute name="displayformat" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="hex"/>
          <xs:enumeration value="dec"/>
          <xs:enumeration value="oct"/>
          <xs:enumeration value="bin"/>
          <xs:enumeration value="float"/>
          <xs:enumeration value="text"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.Invalidity">
    <xs:attribute name="invalidity" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="noSignal"/>
          <xs:enumeration value="invalidSignal"/>
          <xs:enumeration value="unexpectedResult"/>
          <xs:enumeration value="undefined"/>
          <xs:enumeration value="notImplemented"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.CodedAtomProperties">
    <xs:attributeGroup ref="A.Encoding"/>
    <xs:attribute name="bitlength" use="required" type="xs:NMTOKEN"/>
    <xs:attributeGroup ref="A.ByteOrder"/>
    <xs:attribute name="bitmask"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.PhysicalAtomProperties">
    <xs:attributeGroup ref="A.Encoding"/>
    <xs:attribute name="bitlength" use="required"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.FieldProperties">
    <xs:attribute name="minlength" use="required"/>
    <xs:attribute name="maxlength" use="required"/>
    <xs:attributeGroup ref="A.SizeInfo"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.Function">
    <xs:attribute name="syntax" use="required" type="xs:NMTOKEN"/>
    <xs:attribute name="version" type="xs:NMTOKEN"/>
    <xs:attribute name="entrypoint"/>
    <xs:attribute name="encryption"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.Range">
    <xs:attribute name="startrange"/>
    <xs:attribute name="endrange"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.DataObjectSemantics">
    <xs:attribute name="semantics" default="none">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="none"/>
          <xs:enumeration value="year"/>
          <xs:enumeration value="month"/>
          <xs:enumeration value="day"/>
          <xs:enumeration value="hour"/>
          <xs:enumeration value="minute"/>
          <xs:enumeration value="second"/>
          <xs:enumeration value="testerId"/>
          <xs:enumeration value="userId"/>
          <xs:enumeration value="ecuSpecVersion"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.SynchAttributeValue">
    <xs:attribute name="sync"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.DtcCollectionFormatIdentifier">
    <xs:attribute name="formatidentifier" default="ISO_15031_6">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="ISO_15031_6"/>
          <xs:enumeration value="ISO_14229_1"/>
          <xs:enumeration value="SAE_J1939_73"/>
          <xs:enumeration value="ISO_11992_4"/>
          <xs:enumeration value="ISO_27145"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="A.ContentOnly">
    <xs:attribute name="contentonly" default="no">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="yes"/>
          <xs:enumeration value="no"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <!-- === Element group entities === -->
  <xs:element name="G.CodedProperties" abstract="true"/>
  <xs:element name="G.PhysicalProperties" abstract="true"/>
  <xs:attributeGroup name="A.ItemMappingType">
    <xs:attribute name="type" default="RI">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="RI"/>
          <xs:enumeration value="A"/>
          <xs:enumeration value="VSG"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <!-- ================================================== -->
  <!-- Common elements -->
  <!-- ================================================== -->
  <xs:element name="QUALIFIER" type="xs:string"/>
  <xs:element name="NAME" type="xs:string"/>
  <xs:element name="DESCRIPTION" type="xs:string"/>
  <!--
    With the element VALUE an atomic or a field value can be
    specified. The meaning of the value is given by the attribute
    'role'. Field elements within a field value are separated by blanks. 
    Hexadecimal values are specified by adding the prefix 0x
    Generally, the element content or the attribute value
    can be used for specifying the value. If the attribute is
    specified its value will be used and the element content will
    be ignored. If the value is specified with the attribute, then
    consecutive blanks can be normalized to just one blank. You can
    avoid that by using the element content.
  -->
  <xs:element name="VALUE">
    <xs:complexType mixed="true">
      <xs:attribute name="value"/>
      <xs:attribute name="role" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="startrange"/>
            <xs:enumeration value="endrange"/>
            <xs:enumeration value="default"/>
            <xs:enumeration value="const"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <!-- ================================================== -->
  <!-- root element: CANDELAIMPORT -->
  <!-- ================================================== -->
  <xs:element name="CANDELAIMPORT">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="IMPORTDOC">
          <xs:attribute name="dtdfilevers" default="1.5.2">
            <xs:simpleType>
              <xs:restriction base="xs:NMTOKEN">
                <xs:enumeration value="1.5.2"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!-- IMPORTDOC: -->
  <xs:complexType name="IMPORTDOC">
    <xs:sequence>
      <xs:element ref="IMPORTDOC"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="IMPORTDOC">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="METADATA"/>
        <xs:element minOccurs="0" ref="DATATYPES"/>
        <xs:element minOccurs="0" ref="DATAOBJECTPOOL"/>
        <xs:element minOccurs="0" ref="DTCCOLLECTION"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--
    METADATA: The attribute 'language' indicates the language in which the import is performed.
    If this language is not uptodate in the CANdela document, import is rejected.
    If the document the import is performed into is not opened in the specified language, import is rejected.
    If the attribute 'language' misses, import is performed in the language in which the document is opened.
    The attribute 'ecuName' if present is used to ensure that the target ecu has this name. Otherwise 
    the import is rejected. If the attribute ecuname misses, import is performed in the opened document. 
  -->
  <xs:element name="METADATA">
    <xs:complexType>
      <xs:attribute name="language"/>
      <xs:attribute name="ecuname"/>
    </xs:complexType>
  </xs:element>
  <!-- ================================================== -->
  <!-- DATATYPES -->
  <!-- ================================================== -->
  <!-- common elements for DATATYPES -->
  <!--
    CODEDATOMPROPERTIES describes raw value properties of a CDI atomic data type: 
    'encoding', 'bitLength', 'byteOrder' and 'bitmask'
  -->
  <xs:element name="CODEDATOMPROPERTIES" substitutionGroup="G.CodedProperties">
    <xs:complexType>
      <xs:attributeGroup ref="A.CodedAtomProperties"/>
    </xs:complexType>
  </xs:element>
  <!--
     CODEDFIELDPROPERTIES describes raw value properties of a CDI field data type: 
    - minLength, maxLength of the field,
    - sizeInfo if minLength differs from maxLength
    - encoding, bit length, byte order and bit mask of a field element
  -->
  <xs:element name="CODEDFIELDPROPERTIES" substitutionGroup="G.CodedProperties">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="CODEDATOMPROPERTIES"/>
      </xs:sequence>
      <xs:attributeGroup ref="A.FieldProperties"/>
    </xs:complexType>
  </xs:element>
  <!--
    PHYSICALPROPERTIES describes physical value properties of a CDI atomic data type: 
    encoding, bit length, display format, precision, unit
  -->
  <xs:element name="PHYSICALATOMPROPERTIES" substitutionGroup="G.PhysicalProperties">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="PHYSICALDISPLAYPROPERTIES"/>
      </xs:sequence>
      <xs:attributeGroup ref="A.PhysicalAtomProperties"/>
    </xs:complexType>
  </xs:element>
  <!--
     PHYSICALFIELDPROPERTIES describes physcial value properties of a CDI field data type: 
    - minLength, maxLength of the field,
    - sizeInfo if minLength differs from maxLength
    - encoding, bit length, display format, precision, unit of a field element
  -->
  <xs:element name="PHYSICALFIELDPROPERTIES" substitutionGroup="G.PhysicalProperties">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="PHYSICALATOMPROPERTIES"/>
      </xs:sequence>
      <xs:attributeGroup ref="A.FieldProperties"/>
    </xs:complexType>
  </xs:element>
  <!--
     PHYSICALDISPLAYPROPERTIES describes how a physical value is presented: 
    display format, precision and unit
  -->
  <xs:element name="PHYSICALDISPLAYPROPERTIES">
    <xs:complexType>
      <xs:attributeGroup ref="A.DisplayFormat"/>
      <xs:attribute name="precision" type="xs:NMTOKEN"/>
      <xs:attribute name="unit"/>
    </xs:complexType>
  </xs:element>
  <!--
     INVALIDITY describes the prohibited ranges for a value. For each
    exclusion a reason must be specified
  -->
  <xs:element name="INVALIDITY">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="INVALIDRANGE"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="INVALIDRANGE">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="VALUE"/>
        <xs:element minOccurs="0" ref="VALUE"/>
        <xs:element ref="ASSIGNEDTEXT"/>
      </xs:sequence>
      <xs:attributeGroup ref="A.Invalidity"/>
    </xs:complexType>
  </xs:element>
  <!-- ASSIGNEDTEXT describes additional info for a range exclusion -->
  <xs:element name="ASSIGNEDTEXT" type="xs:string"/>
  <!--
     LINEARCONVERSION describes a linear function :
    physical value = (factorNumerator / factorDenominator) * raw value + offset
  -->
  <xs:element name="LINEARCONVERSION">
    <xs:complexType>
      <xs:attributeGroup ref="A.Range"/>
      <xs:attribute name="factornumerator" default="1" type="xs:NMTOKEN"/>
      <xs:attribute name="factordenominator" default="1" type="xs:NMTOKEN"/>
      <xs:attribute name="offset" default="0" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <!--
     CDI data types are of the set: 
    IDENTITY, LINEAR, PIECEWISELINEAR, TEXTTABLE, VALUETABLE, PROCEDURE, FORMULA, PACKET 
    The element name indicates the conversion between raw and physical values. Each
    of the CDI data types has 
    - the required attribute id 
    - the required child elements 'qualifier' and 'name' 
    - the optional child element 'description'
    - the optional child element INVALIDITY
  -->
  <xs:element name="DATATYPES">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="IDENTITY"/>
        <xs:element ref="LINEAR"/>
        <xs:element ref="PIECEWISELINEAR"/>
        <xs:element ref="TEXTTABLE"/>
        <xs:element ref="VALUETABLE"/>
        <xs:element ref="PROCEDURE"/>
        <xs:element ref="FORMULA"/>
        <xs:element ref="PACKET"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <!--
     A CDI data type IDENTITY can either be an atomic data type (by child element CODEDATOMPROPERTIES) 
    or a field data type (by child element CODEDFIELDPROPERTIES). The child element PHYSICALDISPLAYPROPERTIES
    describes the presentation of physical values.
  -->
  <xs:element name="IDENTITY">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:sequence>
            <xs:element ref="G.CodedProperties"/>
            <xs:element ref="PHYSICALDISPLAYPROPERTIES"/>
            <xs:element minOccurs="0" ref="INVALIDITY"/>
          </xs:sequence>
          <xs:attributeGroup ref="A.Obj"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!--
     A CDI data type TEXTTABLE can either be an atomic data type (by child element CODEDATOMPROPERTIES) 
    or a field data type (by child element CODEDFIELDPROPERTIES). The child elements TEXTTABLEROW describe
    for a raw value (only use attribute startValue) or for a raw value range (use attribute
    startValue and endValue) the mapped physical value by the child element MAPPEDVALUE.
    Optionally, for each mapping additional information can be specified by ADDINFO.
    The TEXTTABLE child element PHYSICALDISPLAYPROPERTIES describes the presentation of physical 
    values.
  -->
  <xs:element name="TEXTTABLE">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:sequence>
            <xs:element ref="G.CodedProperties"/>
            <xs:element minOccurs="0" maxOccurs="unbounded" ref="TEXTTABLEROW"/>
            <xs:element minOccurs="0" ref="INVALIDITY"/>
          </xs:sequence>
          <xs:attributeGroup ref="A.Obj"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="TEXTTABLEROW">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="VALUE"/>
        <xs:element minOccurs="0" ref="VALUE"/>
        <xs:element ref="MAPPEDTEXT"/>
        <xs:element minOccurs="0" ref="ADDITIONALINFO"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="MAPPEDTEXT" type="xs:string"/>
  <xs:element name="ADDITIONALINFO" type="xs:string"/>
  <!--
     A CDI data type LINEAR can only be an atomic data type (by child element CODEDATOMPROPERTIES).
    The child element LINEARCONVERSION describes the conversion between raw values and physical
    values. The child element PHYSICALDISPLAYPROPERTIES describes the presentation of physical 
    values.
  -->
  <xs:element name="LINEAR">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:sequence>
            <xs:element ref="CODEDATOMPROPERTIES"/>
            <xs:element ref="PHYSICALATOMPROPERTIES"/>
            <xs:element ref="LINEARCONVERSION"/>
            <xs:element minOccurs="0" ref="INVALIDITY"/>
          </xs:sequence>
          <xs:attributeGroup ref="A.Obj"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!--
     A CDI data type PIECEWISELINEAR can only be an atomic data type (by child element CODEDATOMPROPERTIES).
    The child elements LINEARCONVERSION describe the conversion between raw values and physical
    values for specified ranges. The child element PHYSICALDISPLAYPROPERTIES describes the presentation 
    of physical values.
  -->
  <xs:element name="PIECEWISELINEAR">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:sequence>
            <xs:element ref="CODEDATOMPROPERTIES"/>
            <xs:element ref="PHYSICALATOMPROPERTIES"/>
            <xs:element minOccurs="0" maxOccurs="unbounded" ref="LINEARCONVERSION"/>
            <xs:element minOccurs="0" ref="INVALIDITY"/>
          </xs:sequence>
          <xs:attributeGroup ref="A.Obj"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!--
     A CDI data type VALUETABLE (corresponds to the CANdela data type 'Characteristic curve') can 
    only be an atomic data type (by child element CODEDATOMPROPERTIES). The child elements 
    VALUETABLEROW describe the conversion between raw values (attribute codedValue)
    and physical values (child element MAPPEDVALUE). By the optional attribute 'isInterpolated'
    can be specified if the data type is interpolated or not. The child element PHYSICALDISPLAYPROPERTIES 
    describes the presentation of physical values.
  -->
  <xs:element name="VALUETABLE">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:sequence>
            <xs:element ref="CODEDATOMPROPERTIES"/>
            <xs:element ref="PHYSICALATOMPROPERTIES"/>
            <xs:element minOccurs="0" maxOccurs="unbounded" ref="VALUETABLEROW"/>
            <xs:element minOccurs="0" ref="INVALIDITY"/>
          </xs:sequence>
          <xs:attributeGroup ref="A.Obj"/>
          <xs:attribute name="isinterpolated" default="0" type="xs:NMTOKEN"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="VALUETABLEROW">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="MAPPEDVALUE">
          <xs:attribute name="codedvalue" use="required" type="xs:NMTOKEN"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="MAPPEDVALUE">
    <xs:sequence>
      <xs:element ref="MAPPEDVALUE"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="MAPPEDVALUE" type="xs:string"/>
  <!--
     A CDI data type FORMULA can only be an atomic data type (by child element CODEDATOMPROPERTIES).
    Independent on the raw value a bitLength and a suitable encoding must be specified
    for the physical value by the child element PHYSICAlATOM. This child element contains also 
    the PHYSICALDISPLAYPROPERTIES describing the presentation of physical values. The required 
    attribute 'codedToPhysFormula' contains the formula string describing the computation of 
    physical values from raw values. The optional attribute 'physToCodedFormula' contains the 
    formula string for the computation of raw values from physcial values.
  -->
  <xs:element name="FORMULA">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:sequence>
            <xs:element ref="CODEDATOMPROPERTIES"/>
            <xs:element ref="PHYSICALATOMPROPERTIES"/>
            <xs:element ref="CODEDTOPHYSFORMULA"/>
            <xs:element minOccurs="0" ref="PHYSTOCODEDFORMULA"/>
            <xs:element minOccurs="0" ref="INVALIDITY"/>
          </xs:sequence>
          <xs:attributeGroup ref="A.Obj"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="CODEDTOPHYSFORMULA" type="xs:string"/>
  <xs:element name="PHYSTOCODEDFORMULA" type="xs:string"/>
  <!--
     Related to raw values a CDI data type PROCEDURE can be an atomic data type 
    by the child element CODEDATOMPROPERTIES or a field data type by the child element 
    CODEDFIELDPROPERTIES. Related to physical values a CDI data type PROCEDURE can also be 
    an atomic data type by the child element PHYSICALATOMPROPERTIES or a field data type by 
    the child element PHYSCIALFIELDPROPERTIES. There is no restriction related to the
    combination.
    The required child element CODEDTOPHYSFUNCTION contains the PATH to the conversion
    function. The CANdela data type contains the conversion file literally. Therefore,
    the content of PATH must point to a file which will be taken by the import.
    The version must be specified by the required attribute 'version' and the entry point
    by the required attribute 'entryPoint'. Optionally, additional files can be specified 
    by the child elements ADDITIONALFILE.
    The other way round specifying a procedure for the computation of raw values
    by physical values is optional. The same details can be specified.
  -->
  <xs:element name="PROCEDURE">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:sequence>
            <xs:element ref="G.CodedProperties"/>
            <xs:element ref="G.PhysicalProperties"/>
            <xs:element ref="CODEDTOPHYSFUNCTIONS"/>
            <xs:element minOccurs="0" ref="PHYSTOCODEDFUNCTIONS"/>
            <xs:element minOccurs="0" ref="INVALIDITY"/>
          </xs:sequence>
          <xs:attributeGroup ref="A.Obj"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="CODEDTOPHYSFUNCTIONS">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="FUNCTION"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="PHYSTOCODEDFUNCTIONS">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="FUNCTION"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="FUNCTION">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="SOURCEFILE"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ADDITIONALFILE"/>
      </xs:sequence>
      <xs:attributeGroup ref="A.Function"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="SOURCEFILE" type="PATH"/>
  <xs:element name="ADDITIONALFILE" type="PATH"/>
  <xs:complexType name="PATH">
    <xs:sequence>
      <xs:element ref="PATH"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="PATH" type="xs:string"/>
  <!--
     A CDI data type PACKET is a wrapper containing data objects. PACKET-in-PACKET is allowed but only with backward references.
    The optional attribute 'did' specifies a DID number.
  -->
  <xs:element name="PACKET">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="DATAOBJECT"/>
            <xs:element ref="BITFIELD"/>
            <xs:element ref="GAPOBJECT"/>
            <xs:element ref="PACKET"/>
          </xs:choice>
          <xs:attributeGroup ref="A.Obj"/>
          <xs:attributeGroup ref="A.ContentOnly"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!-- ================================================== -->
  <!-- DATAOBJECTS -->
  <!-- ================================================== -->
  <!--
     A CDI DATAOBJECT references a CDI data type via its
    attribute 'idref'. With the optional attribute 'semantics'
    a semantics of the DATAOBJECT can be specified. And with
    the sub element VALUE, either a default value or a 
    const value for the DATOBJECT can be specified. The value
    'startrange' and 'endrange' are not allowed for the attribute
    'role' of a DATAOBJECT
  -->
  <xs:element name="DATAOBJECT">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:sequence>
            <xs:element minOccurs="0" ref="VALUE"/>
          </xs:sequence>
          <xs:attributeGroup ref="A.DataObjectSemantics"/>
          <xs:attributeGroup ref="A.SynchAttributeValue"/>
          <xs:attribute name="datatyperef" use="required" type="xs:IDREF"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!--
    A CDI BITFIELD is a collection of DATAOBJECTs and/or
    GAPOBJECTs. Note: Each BITFIELD references a data type via
    its attribute 'idref'. The optional attribute 'semantics'
    describes the semantics of the entire bit field
  -->
  <xs:element name="BITFIELD">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="DATAOBJECT"/>
            <xs:element ref="GAPOBJECT"/>
          </xs:choice>
          <xs:attributeGroup ref="A.DataObjectSemantics"/>
          <xs:attribute name="datatyperef" use="required" type="xs:IDREF"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!--
    A CDI GAPOBJECT can be used within BITFIELDs or within
    a PACKET data type. The size of the GAPOBJECT is specified
    by the required attribute 'bitlength'
  -->
  <xs:element name="GAPOBJECT">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="C.Qualified">
          <xs:attribute name="bitlength" use="required" type="xs:NMTOKEN"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <!-- ================================================== -->
  <!-- DATAOBJECTPOOL -->
  <!-- ================================================== -->
  <xs:element name="DATAOBJECTPOOL">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="DATAOBJECT"/>
        <xs:element ref="BITFIELD"/>
        <xs:element ref="GAPOBJECT"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <!-- ================================================== -->
  <!-- DTCCOLLECTION -->
  <!-- ================================================== -->
  <!--  DTCCOLLECTION contains dtc data to be imported. -->
  <xs:element name="DTCCOLLECTION">
    <xs:complexType>
      <xs:sequence>
        <xs:choice minOccurs="0">
          <xs:element ref="SERVICEMAPPING"/>
          <xs:element ref="DTCPOOL"/>
        </xs:choice>
        <xs:element minOccurs="0" ref="RECORDTEMPLATEMAPPING"/>
        <xs:element minOccurs="0" ref="DTCS"/>
      </xs:sequence>
      <xs:attributeGroup ref="A.DtcCollectionFormatIdentifier"/>
    </xs:complexType>
  </xs:element>
  <!--  SERVICEMAPPING contains the definition of the import target for dtc collections. -->
  <!-- Attribute formatidentifier describes format for DTCs -->
  <xs:element name="SERVICEMAPPING">
    <xs:complexType>
      <xs:attribute name="variant" type="xs:NMTOKEN"/>
      <xs:attribute name="diagclass" type="xs:NMTOKEN"/>
      <xs:attribute name="diaginstance" type="xs:NMTOKEN"/>
      <xs:attribute name="service" type="xs:NMTOKEN"/>
      <xs:attribute name="primitive" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <!--
    The values for the attributes 'variant', 'diagclass', 'diaginstance', 'service', 'primitive' and 'bitposition'
    are mapped with the CANdelaStudio qualifiers of the corresponding CANdela structure element.
    Therefore 'SERVICEMAPPING' is expected to be defined in terms of CANdelaStudio qualifiers.
     For 'DTCCOLLECTION' it is sufficient to specify the attributes 'variant' and 'diaginstance'.
    The attributes 'diagclass', 'service' and 'primitive' are not evaluated for the dtc import.
  -->
  <xs:element name="DTCPOOL">
    <xs:complexType>
      <xs:attribute name="type" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="normal"/>
            <xs:enumeration value="obd"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <!-- This value indicates that the according DTC-Pool is used for export-/import of DTCs. -->
  <xs:element name="DTCS">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="DTC"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--
    One single dtc defined by element 'DTC' consists of a dtc number (defined in the attribute 'number'),
    an error text (defined in the subelement 'ERRORTEXT') and a record (defined in the subelement 'RECORD').
     Each 'DTC' represents a row in the CANdelaStudio dtc table. 'RECORD' contains the columns that
    are not the dtc number and not the dtc error text.
  -->
  <xs:element name="DTC">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ERRORTEXT"/>
        <xs:element minOccurs="0" ref="RECORD"/>
      </xs:sequence>
      <xs:attribute name="number" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <!-- The value of the attribute 'number' is defined decimal (e.g. 255) or hex (e.g 0xff). -->
  <xs:element name="ERRORTEXT" type="xs:string"/>
  <!--
    One record consists of entries for each column in the CANdelaStudio dtc table.
    These entries are defined in the element 'RECORDITEM'
  -->
  <xs:element name="RECORD">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="RECORDITEM"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--
     Each 'RECORDITEM' references an 'ITEMMAPPING'. 'ITEMMAPPING' contains the column definition,
    which is mapped to the CANdelaStudio columns during import.
  -->
  <xs:element name="RECORDITEM">
    <xs:complexType mixed="true">
      <xs:attribute name="itemmappingref" use="required" type="xs:IDREF"/>
      <xs:attribute name="enumindex" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <!--
    'ITEMMAPPING' defines the columns of the dtc table in which one imports.
    'ITEMMAPPING' is referenced by 'RECORDITEM'. The content of 'ITEMMAPPING' is mapped
    against the CANdelaStudio column definition during import. It therefore must be sepcified 
    in terms of CANdelaStudio qualifiers.
  -->
  <xs:element name="RECORDTEMPLATEMAPPING">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ITEMMAPPING"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="ITEMMAPPING">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="A.Obj"/>
      <xs:attributeGroup ref="A.ItemMappingType"/>
    </xs:complexType>
  </xs:element>
</xs:schema>
