<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:include schemaLocation="F_OVZ_common_2026_1.xsd" />

    <!-- form element -->
    <xsd:element name="F_OVZ_POPL">
        <xsd:complexType>

            <xsd:sequence>
                <xsd:element name="meta-info" type="MetaInfoTyp" />
                <xsd:element name="sekce1" type="Sekce1Typ" />
                <xsd:choice>
                    <xsd:element name="poplPrizBezUplatneni" type="BezUplatneniTyp" />
                    <xsd:element name="poplPrizSUplatnenim" type="SUplatnenimTyp" />
                </xsd:choice>
            </xsd:sequence>

            <xsd:attribute name="version" type="ShortStringTyp" use="required" fixed="2026" />
            <xsd:attribute name="revision" type="ShortStringTyp" use="required" fixed="1" />

        </xsd:complexType>
    </xsd:element>
    <!-- end of form element -->

    <!-- sekce complex types -->
    <xsd:complexType name="BezUplatneniTyp">
        <xsd:sequence>
            <xsd:element name="sekce21" type="Sekce21Typ" />
            <xsd:element name="prilohaBezUplatneni" type="FileDataTyp" minOccurs="0" />
            <xsd:element name="prilohyDilciBezUplatneni" type="PrilohyDilciBezUplatneniTyp" minOccurs="0" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="SUplatnenimTyp">
        <xsd:sequence>
            <xsd:element name="sekce22" type="Sekce22Typ" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="Sekce1Typ">
        <xsd:all>
            <xsd:element name="radneDoplneneHlaseni" type="RadneDoplneneHlaseniTyp" />
            <xsd:element name="rok" type="RokTyp" fixed="2026" />

            <xsd:element name="overovatel" type="OverovatelTyp" />

            <xsd:element name="hlaseniVyplnil" type="ZpracovatelNTTyp" />
            <xsd:element name="ohlasovatel" type="OhlasovatelOvzTyp" />
            <xsd:element name="ohlasovatelOstatni" type="OhlasovatelOstatniTyp" />
            <xsd:element name="provozovna" type="ProvozovnaOvzTyp" />
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="OverovatelTyp">
        <xsd:all>
            <xsd:element name="text" type="LongStringTyp" />
            <xsd:element name="kod" type="OverovatelKodTyp" />
        </xsd:all>
    </xsd:complexType>

    <xsd:simpleType name="OverovatelKodTyp">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="(CZ\d{3})|(\d{4})" />
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="Sekce21Typ">
        <xsd:all>
            <xsd:element name="poplatekTZL" type="PoplatekTyp" />
            <xsd:element name="poplatekSO2" type="PoplatekTyp" />
            <xsd:element name="poplatekNOx" type="PoplatekTyp" />
            <xsd:element name="poplatekVOC" type="PoplatekTyp" />
            <xsd:element name="celkovaVyse" type="CelkovaVyseTyp" />
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="Sekce22Typ">
        <xsd:all>
            <xsd:element name="poplatekTZL" type="PoplatekSekce22Typ" />
            <xsd:element name="poplatekSO2" type="PoplatekSekce22Typ" />
            <xsd:element name="poplatekNOx" type="PoplatekSekce22Typ" />
            <xsd:element name="poplatekVOC" type="PoplatekSekce22Typ" />
            <xsd:element name="celkovaVyse" type="CelkovaVyseSekce22Typ" />
            <xsd:element name="prilohy" type="PrilohySekce22Typ" />
        </xsd:all>
    </xsd:complexType>
    <!-- end of sekce complex types -->

    <!-- complex types -->
    <xsd:complexType name="OhlasovatelOstatniTyp">
        <xsd:all>
            <xsd:element name="statutarniZastupceJmeno" type="LongStringTyp" minOccurs="0" />
            <xsd:element name="statutarniZastupcePrijmeni" type="LongStringTyp" minOccurs="0" />
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="PoplatekTyp">
        <xsd:all>
            <xsd:element name="nazev" type="LongStringTyp" minOccurs="0" />
            <xsd:element name="mnozstvi" type="Decimal4FrTyp" minOccurs="0" />
            <xsd:element name="poplatek" type="Decimal2FrTyp" minOccurs="0" />
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="CelkovaVyseTyp">
        <xsd:all>
            <xsd:element name="poplatek" type="ZaokrouhlenyPoplatekTyp" />
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="PoplatekSekce22Typ">
        <xsd:all>
            <xsd:element name="nazev" type="LongStringTyp" minOccurs="0" />
            <xsd:element name="mnozstvi" type="Decimal4FrTyp" minOccurs="0" />
            <xsd:element name="poplatekPred" type="Decimal2FrTyp" minOccurs="0" />
            <xsd:element name="nevymereni" type="xsd:boolean" minOccurs="0" />
            <xsd:element name="snizeniSazeb" type="xsd:boolean" minOccurs="0" />
            <xsd:element name="poplatekPo" type="Decimal2FrTyp" minOccurs="0" />
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="CelkovaVyseSekce22Typ">
        <xsd:all>
            <xsd:element name="poplatekPred" type="ZaokrouhlenyPoplatekTyp" />
            <xsd:element name="poplatekPo" type="ZaokrouhlenyPoplatekTyp" />
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="PrilohyDilciBezUplatneniTyp">
        <xsd:sequence>
            <xsd:element name="prilohaDilciBezUplatneni" type="FileDataTyp" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="PrilohySekce22Typ">
        <xsd:sequence>
            <xsd:element name="priloha1" type="FileDataTyp" />
            <xsd:element name="priloha2" type="FileDataTyp" minOccurs="0" />
            <xsd:element name="priloha3" type="FileDataTyp" minOccurs="0" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="ZaokrouhlenyPoplatekTyp">
        <xsd:restriction base="NonNegativeDecimal">
            <xsd:fractionDigits value="0"/> 
        </xsd:restriction>
    </xsd:simpleType>

    <!-- end of complex types -->

</xsd:schema>
