<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="AjpesDokument">
    <xs:annotation>
      <xs:documentation>root element</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element name="Ident">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Datum" type="xs:date" />
              <xs:element name="Ura" type="xs:time" />
              <xs:element name="Nacin_predlozitve" type="xs:string" minOccurs="0" />
              <xs:element name="Vse_pravice" type="xs:string" minOccurs="0" />
            </xs:sequence>
            <xs:attribute ref="Vrsta" />
          </xs:complexType>
        </xs:element>
        <xs:element name="Osnovni_podatki" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="OSN_Ime">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OSN_Sedez">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element ref="OSN_Maticna_stevilka" />
              <xs:element ref="OSN_Davcna_stevilka" />
              <xs:element name="OSN_Odgovorna_oseba_za_bilanco">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element ref="OSN_Telefonska_stevilka" />
              <xs:element name="OSN_Vodja_podjetja">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OSN_Datum_sestave_bilance" type="xs:date" />
              <xs:element name="OSN_Kraj_sestave_bilance">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OSN_Datum_posl_zacetek" type="xs:date" />
              <xs:element name="OSN_Datum_posl_konec" type="xs:date" />
              <xs:element name="OSN_Enaslov_kontaktne_osebe" type="xs:string" minOccurs="0" />
              <xs:element ref="IZJ_Oddal_izjavo" />
              <xs:element ref="POJ_Oddal" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Obrazci">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Obrazec" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="AOP" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="PODATEK" nillable="true" maxOccurs="unbounded">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:double">
                                  <xs:attribute ref="TIP" use="required" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute ref="ID" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute ref="id" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="POJASNILA" type="xs:string" minOccurs="0" />
        <xs:element name="Poslovno_porocilo" type="xs:string" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:attribute name="id">
    <xs:annotation>
      <xs:documentation>ime obrazca: Podatki_iz_bilance_stanja...</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="Podatki_iz_bilance_stanja" />
        <xs:enumeration value="Prihodkov_in_odhodkov" />
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
  <xs:attribute name="ID">
    <xs:annotation>
      <xs:documentation>AOP v obliki 001, 002 ...</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="001" />
        <xs:enumeration value="002" />
        <xs:enumeration value="003" />
        <xs:enumeration value="004" />
        <xs:enumeration value="005" />
        <xs:enumeration value="006" />
        <xs:enumeration value="007" />
        <xs:enumeration value="008" />
        <xs:enumeration value="009" />
        <xs:enumeration value="010" />
        <xs:enumeration value="011" />
        <xs:enumeration value="012" />
        <xs:enumeration value="013" />
        <xs:enumeration value="014" />
        <xs:enumeration value="015" />
        <xs:enumeration value="016" />
        <xs:enumeration value="017" />
        <xs:enumeration value="018" />
        <xs:enumeration value="019" />
        <xs:enumeration value="020" />
        <xs:enumeration value="021" />
        <xs:enumeration value="022" />
        <xs:enumeration value="023" />
        <xs:enumeration value="024" />
        <xs:enumeration value="025" />
        <xs:enumeration value="026" />
        <xs:enumeration value="027" />
        <xs:enumeration value="028" />
        <xs:enumeration value="029" />
        <xs:enumeration value="030" />
        <xs:enumeration value="031" />
        <xs:enumeration value="032" />
        <xs:enumeration value="033" />
        <xs:enumeration value="034" />
        <xs:enumeration value="035" />
        <xs:enumeration value="036" />
        <xs:enumeration value="037" />
        <xs:enumeration value="038" />
        <xs:enumeration value="039" />
        <xs:enumeration value="040" />
        <xs:enumeration value="041" />
        <xs:enumeration value="042" />
        <xs:enumeration value="043" />
        <xs:enumeration value="044" />
        <xs:enumeration value="045" />
        <xs:enumeration value="046" />
        <xs:enumeration value="047" />
        <xs:enumeration value="048" />
        <xs:enumeration value="049" />
        <xs:enumeration value="050" />
        <xs:enumeration value="051" />
        <xs:enumeration value="052" />
        <xs:enumeration value="053" />
        <xs:enumeration value="054" />
        <xs:enumeration value="055" />
        <xs:enumeration value="056" />
        <xs:enumeration value="057" />
        <xs:enumeration value="058" />
        <xs:enumeration value="059" />
        <xs:enumeration value="060" />
        <xs:enumeration value="061" />
        <xs:enumeration value="062" />
        <xs:enumeration value="063" />
        <xs:enumeration value="064" />
        <xs:enumeration value="065" />
        <xs:enumeration value="066" />
        <xs:enumeration value="067" />
        <xs:enumeration value="068" />
        <xs:enumeration value="069" />
        <xs:enumeration value="070" />
        <xs:enumeration value="071" />
        <xs:enumeration value="072" />
        <xs:enumeration value="073" />
        <xs:enumeration value="074" />
        <xs:enumeration value="075" />
        <xs:enumeration value="076" />
        <xs:enumeration value="077" />
        <xs:enumeration value="078" />
        <xs:enumeration value="079" />
        <xs:enumeration value="080" />
        <xs:enumeration value="081" />
        <xs:enumeration value="082" />
        <xs:enumeration value="083" />
        <xs:enumeration value="083" />
        <xs:enumeration value="084" />
        <xs:enumeration value="085" />
        <xs:enumeration value="086" />
        <xs:enumeration value="087" />
        <xs:enumeration value="088" />
        <xs:enumeration value="089" />
        <xs:enumeration value="090" />
        <xs:enumeration value="091" />
        <xs:enumeration value="092" />
        <xs:enumeration value="093" />
        <xs:enumeration value="094" />
        <xs:enumeration value="095" />
        <xs:enumeration value="096" />
        <xs:enumeration value="097" />
        <xs:enumeration value="098" />
        <xs:enumeration value="099" />
        <xs:enumeration value="100" />
        <xs:enumeration value="101" />
        <xs:enumeration value="102" />
        <xs:enumeration value="103" />
        <xs:enumeration value="104" />
        <xs:enumeration value="105" />
        <xs:enumeration value="106" />
        <xs:enumeration value="107" />
        <xs:enumeration value="108" />
        <xs:enumeration value="109" />
        <xs:enumeration value="110" />
        <xs:enumeration value="111" />
        <xs:enumeration value="112" />
        <xs:enumeration value="113" />
        <xs:enumeration value="114" />
        <xs:enumeration value="115" />
        <xs:enumeration value="116" />
        <xs:enumeration value="117" />
        <xs:enumeration value="118" />
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
  <xs:attribute name="TIP">
    <xs:annotation>
      <xs:documentation>T-tekoce leto, P-preteklo leto, X-</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="T" />
        <xs:enumeration value="P" />
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
  <xs:attribute name="Vrsta" type="xs:string" fixed="LPZP_2012">
    <xs:annotation>
      <xs:documentation>vrsta dokumenta</xs:documentation>
    </xs:annotation>
  </xs:attribute>
  <xs:element name="OSN_Maticna_stevilka">
    <xs:annotation>
      <xs:documentation>10-mestna maticna stevilka</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern value="[0-9]{10}" />
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:element name="OSN_Davcna_stevilka">
    <xs:annotation>
      <xs:documentation>9-mestna davcna stevilka</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern value="[0-9]{8}" />
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:element name="OSN_Telefonska_stevilka">
    <xs:annotation>
      <xs:documentation>telefonska stevilka mora imeti vsaj 7 znakov</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:minLength value="7" />
        <xs:maxLength value="30" />
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:element name="IZJ_Oddal_izjavo">
    <xs:annotation>
      <xs:documentation>1-oddal izjavo / 0-ni oddal izjave</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:integer">
        <xs:minInclusive value="0" />
        <xs:maxInclusive value="1" />
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
  <xs:element name="POJ_Oddal">
    <xs:annotation>
      <xs:documentation>0-niso oddana (oz. oddana na papirju), 1-poj. v xml formatu, 2-pojasnila v pdf</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:integer">
        <xs:minInclusive value="0" />
        <xs:maxInclusive value="2" />
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
</xs:schema>