<?xml version="1.0" encoding="UTF-8"?>
<!-- Daňové priznanie daň z poistenia podľa zákona č. 213/2018 Z.z o dani z poistenia a o zmene a doplnení niektorých zákonov - DPDPv18 -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:annotation>
		<xs:documentation>DPDPv18</xs:documentation>
	</xs:annotation>
	<!--  prazdny retazec  -->
	<xs:simpleType name="emptyStrType">
		<xs:restriction base="xs:string">
			<xs:enumeration value=""/>
		</xs:restriction>
	</xs:simpleType>
	<!-- povinna boolovska hodnota 0 alebo 1 -->
	<xs:simpleType name="only_0_1">
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="1"/>
			<xs:pattern value="[0-1]"/>
		</xs:restriction>
	</xs:simpleType>
	<!--  povinny datum v tvare: (d)d.(m)m.rrrr  -->
	<xs:simpleType name="oneFieldDateType">
		<xs:restriction base="xs:string">
			<xs:pattern value="\d?\d\.\d?\d\.\d\d\d\d"/>
		</xs:restriction>
	</xs:simpleType>
	<!--  nepovinny datum v tvare: (d)d.(m)m.rrrr  -->
	<xs:simpleType name="optOneFieldDateType">
		<xs:union memberTypes="oneFieldDateType emptyStrType"/>
	</xs:simpleType>
	<!--  nepovinny datum rozdeleny v troch elementoch -->
	<xs:complexType name="optDateType">
		<xs:sequence>
			<xs:element name="stvrtrok" type="optQuarterType"/>
			<xs:element name="rok" type="optYearType"/>
		</xs:sequence>
	</xs:complexType>
	<!-- povinny datum v jednom poli (v celku) -->
	<xs:simpleType name="oneFieldDate">
		<xs:restriction base="xs:string">
			<xs:pattern value="\d\d?\.\d\d?\.\d\d\d\d"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- nepovinny datum v jednom poli (v celku) -->
	<xs:simpleType name="optOneFieldDate">
		<xs:union memberTypes="oneFieldDate emptyStrType"/>
	</xs:simpleType>
	<!--  povinny den/mesiac v tvare: (d)d/(m)m  -->
	<xs:simpleType name="dayMonthType">
		<xs:restriction base="xs:decimal">
			<xs:pattern value="\d?\d"/>
		</xs:restriction>
	</xs:simpleType>
	<!--  nepovinny den/mesiac v tvare: (d)d/(m)m  -->
	<xs:simpleType name="optDayMonthType">
		<xs:union memberTypes="dayMonthType emptyStrType"/>
	</xs:simpleType>
	<!--  povinny rok  -->
	<xs:simpleType name="yearType">
		<xs:restriction base="xs:decimal">
			<xs:pattern value="\d\d\d\d"/>
		</xs:restriction>
	</xs:simpleType>
	<!--  povinny stvrtrok  -->
	<xs:simpleType name="quarterType">
		<xs:restriction base="xs:decimal">
			<xs:pattern value="\d"/>
		</xs:restriction>
	</xs:simpleType>
	<!--  nepovinny stvrtrok  -->
	<xs:simpleType name="optQuarterType">
		<xs:union memberTypes="quarterType emptyStrType"/>
	</xs:simpleType>
	<!--  nepovinny rok  -->
	<xs:simpleType name="optYearType">
		<xs:union memberTypes="yearType emptyStrType"/>
	</xs:simpleType>
	<!-- nepovinne desatinne cislo -->
	<xs:simpleType name="optDec">
		<xs:union memberTypes="decimalWithTwoDec emptyStrType"/>
	</xs:simpleType>
	<!-- cislo tvaru N (12.2) -->
	<xs:simpleType name="decimalWithTwoDec">
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="12"/>
			<xs:fractionDigits value="2"/>
		</xs:restriction>
	</xs:simpleType>
	<!--  korenovy element  -->
	<xs:element name="dokument">              
		<xs:complexType>
			<xs:sequence>
				<xs:element name="hlavicka" type="hlavickaType"/>
				<xs:element name="telo" type="teloType"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!--  hlavicka  -->
	<xs:complexType name="hlavickaType">
		<xs:sequence>
			<xs:element name="dic" type="optDicType"/>
			<xs:element name="typDP" type="typDPType"/>
			<xs:element name="datumPodaniaDDP" type="datumPodaniaDDPType"/>
			<xs:element name="zdanovanieObdobie" type="zdanovanieObdobieType"/>
			<xs:element name="osobaPovinnaPlatitDan" type="osobaPovinnaPlatitDanType"/>
			<xs:element name="udajeOsoba" type="udajeOsobaType"/>
			<xs:element name="sidlo" type="sidloType"/>
			<xs:element name="adresaPobocky" type="sidloType"/>
			<xs:element name="opravnenaOsoba" type="opravnenaOsobaType"/>
			<xs:element name="poznamky" type="xs:string"/>
			<xs:element name="vyhlasujem" type="oneFieldDate"/>
		</xs:sequence>
	</xs:complexType>
	<!--  povinne dic  -->
	<xs:simpleType name="dicType">
		<xs:restriction base="xs:decimal">
			<xs:pattern value="\d{10}"/>
		</xs:restriction>
	</xs:simpleType>
	<!--  nepovinne dic  -->
	<xs:simpleType name="optDicType">
		<xs:union memberTypes="dicType emptyStrType"/>
	</xs:simpleType>

	<xs:complexType name="datumPodaniaDDPType">
		<xs:sequence>
			<xs:element name="datumZistenia" type="optOneFieldDate"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="typDPType">
		<xs:sequence>
			<xs:element name="rdp" type="only_0_1"/>
			<xs:element name="odp" type="only_0_1"/>
			<xs:element name="ddp" type="only_0_1"/>
		</xs:sequence>
	</xs:complexType>
	<!--  nepovinne decimal cislo  -->
	<xs:simpleType name="optDecimal">
		<xs:union memberTypes="xs:decimal emptyStrType"/>
	</xs:simpleType>
	<!-- nepovinne patciferne cislo -->
	<xs:simpleType name="optInt5">
		<xs:union memberTypes="cislo5 emptyStrType"/>
	</xs:simpleType>
	<!-- cele patciferne cislo -->
	<xs:simpleType name="cislo5">
		<xs:restriction base="xs:integer">
			<xs:totalDigits value="5"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- nepovinne dvojciferne cislo -->
	<xs:simpleType name="optInt2">
		<xs:union memberTypes="cislo2 emptyStrType"/>
	</xs:simpleType>
	<!-- cele dvojciferne cislo -->
	<xs:simpleType name="cislo2">
		<xs:restriction base="xs:integer">
			<xs:totalDigits value="2"/>
		</xs:restriction>
	</xs:simpleType>
	<!--  za obdobie  -->
	<xs:complexType name="zdanovanieObdobieType">
		<xs:sequence>
			<xs:element name="stvrtrok" type="optQuarterType"/>
			<xs:element name="rok" type="optYearType"/>
		</xs:sequence>
	</xs:complexType>
	<!--  dan z poistenia spravcovi  -->
	<xs:complexType name="osobaPovinnaPlatitDanType">
		<xs:sequence>
			<xs:element name="poistovatel" type="only_0_1"/>
			<xs:element name="poistovnaNaUzemiSr" type="only_0_1"/>
			<xs:element name="poistovnaMimoSr" type="only_0_1"/>
			<xs:element name="pobockaZahranicnejPoistovne" type="only_0_1"/>
			<xs:element name="poistnik" type="only_0_1"/>
			<xs:element name="pravnickaOsobaPreuctovaneNakl" type="only_0_1"/>
		</xs:sequence>
	</xs:complexType>
	<!--  Udaje o osobe povinnej platit dan z poistenia spravcovi dane  -->
	<xs:complexType name="udajeOsobaType">
		<xs:sequence>
			<xs:element name="pOFOMeno" type="pOFOMenoType"/>
			<xs:element name="tel" type="xs:string"/>
			<xs:element name="email" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>
		<!--  Obchodne meno pravnickej osoby/ meno a priezvisko fyzickej osoby  -->
	<xs:complexType name="pOFOMenoType">
		<xs:sequence>
			<xs:element name="riadok" type="xs:string" minOccurs="0" maxOccurs="2"/>
		</xs:sequence>
	</xs:complexType>
	<!--  Adresa sidla alebo trvaleho pobytu  -->
	<xs:complexType name="sidloType">
		<xs:sequence>
			<xs:element name="ulica" type="xs:string"/>
			<xs:element name="cislo" type="xs:string"/>
			<xs:element name="psc" type="xs:string"/>
			<xs:element name="obec" type="xs:string"/>
			<xs:element name="stat" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>
	<!--  Osoba opravnena na podanie danoveho priznania  -->
	<xs:complexType name="opravnenaOsobaType">
		<xs:sequence>
			<xs:element name="menoPriezvisko" type="xs:string"/>
            <xs:element name="tel" type="xs:string"/>
			<xs:element name="email" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>
	<!--  telo  -->
	<xs:complexType name="teloType">
		<xs:sequence>
			<xs:element name="vznikDanPovinnosti" type="vznikDanPovinnostiType"/>
            <xs:element name="tabulka" type="tabulkaType"/>
			<xs:element name="dodatocneUdaje" type="optDec"/>
		</xs:sequence>
	</xs:complexType>	
	<!--  Vznik danovej povinnosti poistovatela  -->
	<xs:complexType name="vznikDanPovinnostiType">
		<xs:sequence>
			<xs:element name="prijatimPlatPoistovne" type="only_0_1"/>
			<xs:element name="zauctovaniePohladvky" type="only_0_1"/>
			<xs:element name="splatnostPoistenia" type="only_0_1"/>
		</xs:sequence>
	</xs:complexType>
	<!--  Tabulka  -->
	<xs:complexType name="tabulkaType">
		<xs:sequence>
		    <xs:element name="r01" type="riadokType"/>
			<xs:element name="r02" type="riadokType"/>
			<xs:element name="r03" type="riadokType"/>
			<xs:element name="r04" type="riadokType"/>
			<xs:element name="r05" type="riadokType"/>
			<xs:element name="r06" type="riadokType"/>
			<xs:element name="r07" type="riadokType"/>
			<xs:element name="r08" type="riadokType"/>
			<xs:element name="r09" type="riadokType"/>
			<xs:element name="r10" type="riadokType"/>
			<xs:element name="r11" type="riadokType"/>
			<xs:element name="r12" type="riadokType"/>
			<xs:element name="r13" type="riadokType"/>
			<xs:element name="r14" type="riadokType"/>
			<xs:element name="r15" type="riadokType"/>
			<xs:element name="r16" type="riadokType"/>
			<xs:element name="r17" type="riadokType"/>
			<xs:element name="r18" type="riadokType"/>
			<xs:element name="r19" type="riadok2Type"/>
			<xs:element name="r20" type="riadok2Type"/>
		</xs:sequence>
	</xs:complexType>	
	<xs:complexType name="riadok2Type">
		<xs:sequence>
			<xs:element name="s02" type="optDec"/>
			<xs:element name="s03" type="optDec"/>
	    </xs:sequence>
	</xs:complexType>	
	<xs:complexType name="riadokType">
		<xs:sequence>
		    <xs:element name="s01" type="optInt2"/>
			<xs:element name="s02" type="optDec"/>
			<xs:element name="s03" type="optDec"/>
	    </xs:sequence>
	</xs:complexType>
</xs:schema>
