<?xml version="1.0" encoding="UTF-8"?>
<!-- Oznamenie platitela dane podla par. 43 ods. 13 o dani z prijmov o zrazeni a odvedeni dane vyberanej zrazkou podla par. 43 ods. 3, vzor 2020 -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xsd:annotation>
		<xsd:documentation>OZN4313v20 Oznamenie o zrazeni a odvedeni dane vyberanej zrazkou podla par. 43 ods. 3 pism. g)</xsd:documentation>
	</xsd:annotation>
	<!-- prazdny retazec -->
	<xsd:simpleType name="emptyStrType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value=""/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- nepovinna suma -->
	<xsd:simpleType name="optDec">
		<xsd:union memberTypes="suma13 emptyStrType"/>
	</xsd:simpleType>
	<!-- datum -->
	<xsd:simpleType name="datum">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="(((([0])?[1-9])|([1-2][0-9])|([3][0]))[.]((([0])?[13-9])|([1][0-2]))[.]([0-9][0-9][0-9][0-9]))"/>
			<xsd:pattern value="([3][1][.]((([0])?[13578])|([1][02]))[.]([0-9][0-9][0-9][0-9]))"/>
			<xsd:pattern value="(((([0])?[1-9])|([1][0-9])|([2][0-8]))[.]([0])?[2][.]([0-9][0-9][0-9][0-9]))"/>
			<xsd:pattern value="([2][9][.]([0])?[2])[.][0-9][0-9][13579][26]"/>
			<xsd:pattern value="([2][9][.]([0])?[2])[.][0-9][0-9][02468][048]"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- nepovinny datum v tvare: (d)d.(m)m.rrrr -->
	<xsd:simpleType name="optOneFieldDateType">
		<xsd:union memberTypes="datum emptyStrType"/>
	</xsd:simpleType>
	<!-- suma -->
	<xsd:simpleType name="suma13">
		<xsd:restriction base="xsd:decimal">
			<xsd:totalDigits value="13"/>
			<xsd:fractionDigits value="2"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- povinny rok -->
	<xsd:simpleType name="yearType">
		<xsd:restriction base="xsd:decimal">
			<xsd:pattern value="\d\d\d\d"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- nepovinny rok -->
	<xsd:simpleType name="optYearType">
		<xsd:union memberTypes="yearType emptyStrType"/>
	</xsd:simpleType>
	<!-- nepovinny stvrtrok -->
	<xsd:simpleType name="optStvrtRok">
		<xsd:union memberTypes="emptyStrType stvrtRokType"/>
	</xsd:simpleType>
	<!-- nepovinny checkbox -->
	<xsd:simpleType name="checkbox">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="1"/>
			<xsd:enumeration value="0"/>
			<xsd:enumeration value="1"/>
			<xsd:enumeration value=""/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- stvrtrok -->
	<xsd:simpleType name="stvrtRokType">
		<xsd:restriction base="xsd:int">
			<xsd:totalDigits value="1"/>
			<xsd:minExclusive value="0"/>
			<xsd:maxExclusive value="5"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="only_0_1">
		<xsd:restriction base="xsd:decimal">
			<xsd:totalDigits value="1"/>
			<xsd:pattern value="[0-1]"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- korenovy element -->
	<xsd:element name="dokument">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="hlavicka" type="hlavicka"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- hlavicka -->
	<xsd:complexType name="hlavicka">
		<xsd:sequence>
			<xsd:element name="dic" type="optDicType"/>
			<xsd:element name="zaObdobie" type="zaObdobieType"/>
			<xsd:element name="doplnenie" type="only_0_1"/>
			<xsd:element name="fyzickaOsoba" type="fyzickaOsobaType"/>
			<xsd:element name="pravnickaOsoba" type="pravnickaOsobaType"/>
			<xsd:element name="sidlo" type="sidloType"/>
			<xsd:element name="suhrnneUdaje" type="suhrnneUdajeType"/>
			<xsd:element name="vypracoval" type="vypracovalType"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- povinne dic -->
	<xsd:simpleType name="dicType">
		<xsd:restriction base="xsd:decimal">
			<xsd:pattern value="\d{10}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- nepovinne dic -->
	<xsd:simpleType name="optDicType">
		<xsd:union memberTypes="dicType emptyStrType"/>
	</xsd:simpleType>
	<!-- nepovinne dvojciferne cislo -->
	<xsd:simpleType name="optInt2">
		<xsd:union memberTypes="cislo2 emptyStrType"/>
	</xsd:simpleType>
	<!-- nepovinne patciferne cislo -->
	<xsd:simpleType name="optInt5">
		<xsd:union memberTypes="cislo5 emptyStrType"/>
	</xsd:simpleType>
	<!-- nepovinne desatciferne cislo -->
	<xsd:simpleType name="optInt10">
		<xsd:union memberTypes="cislo10 emptyStrType"/>
	</xsd:simpleType>
	<!-- cele dvojciferne cislo -->
	<xsd:simpleType name="cislo2">
		<xsd:restriction base="xsd:integer">
			<xsd:totalDigits value="2"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- cele patciferne cislo -->
	<xsd:simpleType name="cislo5">
		<xsd:restriction base="xsd:integer">
			<xsd:totalDigits value="5"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- cele desatciferne cislo -->
	<xsd:simpleType name="cislo10">
		<xsd:restriction base="xsd:integer">
			<xsd:totalDigits value="10"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- retazec o dlzke 10 znakov -->
	<xsd:simpleType name="string10">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="10"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- retazec o dlzke 11 znakov -->
	<xsd:simpleType name="string11">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="11"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- retazec o dlzke 20 znakov -->
	<xsd:simpleType name="string20">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="20"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- retazec o dlzke 37 znakov -->
	<xsd:simpleType name="string37">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="37"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- retazec o dlzke 40 znakov -->
	<xsd:simpleType name="string40">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="40"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- retazec o dlzke 50 znakov -->
	<xsd:simpleType name="string50">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="50"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- retazec o dlzke 60 znakov -->
	<xsd:simpleType name="string60">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="60"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- retazec o dlzke 100 znakov -->
	<xsd:simpleType name="string100">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="100"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- za obdobie -->
	<xsd:complexType name="zaObdobieType">
		<xsd:sequence>
			<xsd:element name="rok" type="yearType"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- fyzicka osoba -->
	<xsd:complexType name="fyzickaOsobaType">
		<xsd:sequence>
			<xsd:element name="priezvisko" type="string40"/>
			<xsd:element name="meno" type="string40"/>
			<xsd:element name="titulPred" type="string20"/>
			<xsd:element name="titulZa" type="string20"/>
			<!-- <xsd:element name="datumNarodenia" type="optOneFieldDateType"/> -->
		</xsd:sequence>
	</xsd:complexType>
	<!-- pravnicka osoba -->
	<xsd:complexType name="pravnickaOsobaType">
		<xsd:sequence>
			<xsd:element name="obchodneMeno" type="obchodneMenoType"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- obchodne meno -->
	<xsd:complexType name="obchodneMenoType">
		<xsd:sequence>
			<xsd:element name="riadok" type="string37" maxOccurs="3"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- sidlo -->
	<xsd:complexType name="sidloType">
		<xsd:sequence>
			<xsd:element name="ulica" type="string60"/>
			<xsd:element name="supisneOrientacneCislo" type="string20"/>
			<xsd:element name="psc" type="string10"/>
			<xsd:element name="obec" type="string40"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- Súhrnné údaje o zrazenej a odvedenej dani vyberanej zrážkou -->
	<xsd:complexType name="suhrnneUdajeType">
		<xsd:sequence>
			<xsd:element name="datum" type="optOneFieldDateType"/>
			<xsd:element name="suma" type="optDec"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- vypracoval -->
	<xsd:complexType name="vypracovalType">
		<xsd:sequence>
			<xsd:element name="vypracoval" type="string50"/>
			<xsd:element name="dna" type="optOneFieldDateType"/>
			<xsd:element name="telefon" type="string20"/>
			<xsd:element name="podpis" type="checkbox" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- nepovinne telefonne cislo -->
	<xsd:complexType name="telType">
		<xsd:sequence>
			<xsd:element name="cislo" type="string20"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>
