<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="http://edavki.durs.si/Documents/Schemas/DejUpoZem_1.xsd"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:edp="http://edavki.durs.si/Documents/Schemas/EDP-Common-1.xsd"
  targetNamespace="http://edavki.durs.si/Documents/Schemas/DejUpoZem_1.xsd"
  elementFormDefault="qualified">
  <xs:import namespace="http://edavki.durs.si/Documents/Schemas/EDP-Common-1.xsd" schemaLocation="EDP-Common-1.xsd"/>

  <!--document structure-->
  <xs:element name="Envelope">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="edp:Header"/>
        <xs:element ref="edp:AttachmentList" minOccurs="0" />
        <xs:element ref="edp:Signatures"/>
        <xs:element name="body">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="DejUpoZem"/>
              <xs:element ref="LandOwner" minOccurs="0" maxOccurs="unbounded" />
              <xs:element ref="LandData" minOccurs="0" maxOccurs="unbounded" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="DejUpoZem">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="EmailAddress" type="xs:string" minOccurs="0" />
        <xs:element name="PhoneNumber" type="xs:string" minOccurs="0" />
        <xs:element name="PeriodYear" type="xs:int" minOccurs="0"/>
        <xs:element name="Statement" type="xs:boolean" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="LandOwner">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="TaxId" type="xs:string" minOccurs="0" />
        <xs:element name="Name" type="xs:string" minOccurs="0" />
        <xs:element name="DateOfContract" type="xs:date" minOccurs="0" />
        <xs:element name="Note" type="xs:string" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="LandData">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="TaxId" type="xs:string" minOccurs="0" />
        <xs:element name="CadastralMncp" type="xs:string" minOccurs="0" />
        <xs:element name="CadastralMncpN" type="xs:string" minOccurs="0" />
        <xs:element name="ParcelNumber" type="xs:string" minOccurs="0" />
        <xs:element name="LandArea" type="Amount_Type" minOccurs="0" />
        <xs:element name="LandPart" type="xs:decimal" minOccurs="0" />
        <xs:element name="LeaseYearFrom" type="xs:int" minOccurs="0" />
        <xs:element name="LeaseYearTo" type="xs:int" minOccurs="0" />
        <xs:element name="TerminationYear" type="xs:int" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  
  <!--type definitions-->
  <xs:simpleType name="Amount_Type">
    <xs:restriction base="xs:decimal">
      <xs:fractionDigits value="0"/>
    </xs:restriction>
  </xs:simpleType>
  

</xs:schema>
