<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="xs3p.xsl" ?>
<xs:schema targetNamespace="bmbf.gv.at/lia/mv" 
           elementFormDefault="qualified"
           xmlns="bmbf.gv.at/lia/mv"
           xmlns:mstns="bmbf.gv.at/lia/mv"
           xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           version="300919">
    <xs:annotation>
        <xs:documentation>MV DZ Meldung</xs:documentation>
    </xs:annotation>
    <xs:element name="LehrerMeldung" type="LehrerMeldungType" />
    <xs:complexType name="LehrerMeldungType">
        <xs:annotation>
            <xs:documentation>Eine Meldung für Landeslehrpersoneninformation Austria</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="Lehrer" type="LehrerType" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="meldedatum" type="xs:date" use="required">
            <xs:annotation>
                <xs:documentation>Datum der Meldung</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="meldeart" type="meldeartDef" use="required">
            <xs:annotation>
                <xs:documentation>Art der Meldung [n|k]</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="absender" type="BLEnum" use="required">
            <xs:annotation>
                <xs:documentation>Absender der Meldung.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="schuljahr" type="schuljahrDef" use="required">
            <xs:annotation>
                <xs:documentation>Laufendes Schuljahr (Bsp.:2014/15)</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="monat" type="MOEnum" use="required">
            <xs:annotation>
                <xs:documentation>Berichtsmonat</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:complexType name="LehrerType">
        <xs:annotation>
            <xs:documentation>Eintrag für einen Lehrer</xs:documentation>
        </xs:annotation>
        <xs:attribute name="ERST_ANS" type="xs:boolean" use="required">
            <xs:annotation>
                <xs:documentation>Erstmals angesucht</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="PERS" type="string20" use="required">
            <xs:annotation>
                <xs:documentation>Personalnummer</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="PERS_Z" type="xs:integer" use="optional">
            <xs:annotation>
                <xs:documentation>Datensatzkennung – Zähler: mit 1 beginnend wird pro Datensatzkennung weitergezählt (nur einstellig)</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="MELDEART" type="MELDEARTEnum" use="required">
            <xs:annotation>
                <xs:documentation>Meldeart</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="NACHNAME" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>Nachname</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="VORNAME" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>Vorname</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="SVNR" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>Sozialversicherungsnummer (NNNNDDMMYY)</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="SKZ" type="skzDef" use="required">
            <xs:annotation>
                <xs:documentation>Schulkennzahl der Stammschule</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="SART" type="SARTEnum" use="required">
            <xs:annotation>
                <xs:documentation>Schulart</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="LV" type="LVEnum" use="required">
            <xs:annotation>
                <xs:documentation>Lehrverpflichtung</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="VW_ART" type="VW_ARTEnum" use="required">
            <xs:annotation>
                <xs:documentation>Art der Verwendung</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="INSP" type="INSPEnum" use="required">
            <xs:annotation>
                <xs:documentation></xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="EINR" type="EINREnum" use="required">
            <xs:annotation>
                <xs:documentation>Einrichtung</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="EINR_KENNZ" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation>Kennzahl der Einrichtung</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="ZR_VON" type="xs:dateTime" use="required">
            <xs:annotation>
                <xs:documentation>Beginn der Mitverwendung/Dienstzuteilung</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="ZR_BIS" type="xs:dateTime" use="required">
            <xs:annotation>
                <xs:documentation>Ende der Mitverwendung/Dienstzuteilung</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="ANMERKUNG_BL" type="xs:string" use="optional">
            <xs:annotation>
                <xs:documentation>Anmerkung des Bundeslandes</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="PH_LEHRE" type="xs:decimal" use="optional">
            <xs:annotation>
                <xs:documentation>Angabe der Gesamtstunden nur im Bereich PH/kPH</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="PH_VERWALTUNG" type="xs:decimal" use="optional">
            <xs:annotation>
                <xs:documentation>Angabe der Gesamtstunden nur im Bereich PH/kPH</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="WE" type="xs:decimal" use="optional">
            <xs:annotation>
                <xs:documentation>Werteinheiten der Mitverwendung nur für den Bereich Praxis und Bschule</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="WH" type="xs:decimal" use="optional">
            <xs:annotation>
                <xs:documentation>
        Wochenstunden der Mitverwendung bzw. Dienstfreistellung gegen Refundierung
      </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="pd" type="xs:boolean" use="optional">
            <xs:annotation>
                <xs:documentation>Schema pd</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <!-- Enumerations -->
    <xs:simpleType name="MOEnum">
        <xs:annotation>
            <xs:documentation>Berichtsmonat</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:integer">                
                <xs:enumeration value="3">
                    <xs:annotation>
                        <xs:documentation>März</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>                
                <xs:enumeration value="7">
                    <xs:annotation>
                        <xs:documentation>Juli</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="8">
                    <xs:annotation>
                        <xs:documentation>August</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>                
                <xs:enumeration value="10">
                    <xs:annotation>
                        <xs:documentation>Oktober</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="BLEnum">
        <xs:annotation>
            <xs:documentation>Bundesland:</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:integer">
                <xs:enumeration value="1">
                    <xs:annotation>
                        <xs:documentation>Burgenland</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="2">
                    <xs:annotation>
                        <xs:documentation>Kärnten</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="3">
                    <xs:annotation>
                        <xs:documentation>Niederösterreich</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="4">
                    <xs:annotation>
                        <xs:documentation>Oberösterreich</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="5">
                    <xs:annotation>
                        <xs:documentation>Salzburg</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="6">
                    <xs:annotation>
                        <xs:documentation>Steiermark</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="7">
                    <xs:annotation>
                        <xs:documentation>Tirol</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="8">
                    <xs:annotation>
                        <xs:documentation>Vorarlberg</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="9">
                    <xs:annotation>
                        <xs:documentation>Wien</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="MELDEARTEnum">
        <xs:annotation>
            <xs:documentation>Meldeart</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
                <xs:enumeration value="N">
                    <xs:annotation>
                        <xs:documentation>Neueinspielung</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="K">
                    <xs:annotation>
                        <xs:documentation>Korrigierte Einspielung</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="S">
                    <xs:annotation>
                        <xs:documentation>Stornierung einer vorangegangenen Meldung</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="SARTEnum">
        <xs:annotation>
            <xs:documentation>Schulart</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:integer">
                <xs:enumeration value="1">
                    <xs:annotation>
                        <xs:documentation>Volksschule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="2">
                    <xs:annotation>
                        <xs:documentation>Mittelschule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="3">
                    <xs:annotation>
                        <xs:documentation>Sonderschule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="4">
                    <xs:annotation>
                        <xs:documentation>Polytechnische Schule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="5">
                    <xs:annotation>
                        <xs:documentation>Berufsschule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="LVEnum">
        <xs:annotation>
            <xs:documentation>Lehrverpflichtung</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:integer">
                <xs:enumeration value="22">
                    <xs:annotation>
                        <xs:documentation>VS+SO</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="21">
                    <xs:annotation>
                        <xs:documentation>MS+PTS</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="23">
                    <xs:annotation>
                        <xs:documentation>BS</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="VW_ARTEnum">
        <xs:annotation>
            <xs:documentation>Art der Verwendung</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
                <xs:enumeration value="MV">
                    <xs:annotation>
                        <xs:documentation>Mitverwendung</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="DZ">
                    <xs:annotation>
                        <xs:documentation>Dienstzuteilung</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="DF">
                    <xs:annotation>
                        <xs:documentation>Dienstfreistellungen</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="INSPEnum">
        <xs:annotation>
            <xs:documentation></xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
                <xs:enumeration value="NZ">
                    <xs:annotation>
                        <xs:documentation>nicht zutreffend</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="FI">
                    <xs:annotation>
                        <xs:documentation>betrauter Fachinspektor</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="SQM">
                    <xs:annotation>
                        <xs:documentation>Schulqualitätsmanagement</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="FIDS">
                    <xs:annotation>
                        <xs:documentation>Fachbereich für Inklusion, Diversität und Sonderpädagogik</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="EINREnum">
        <xs:annotation>
            <xs:documentation>Einrichtung</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
                <xs:enumeration value="PH">
                    <xs:annotation>
                        <xs:documentation>Pädagogische Hochschule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="kPH">
                    <xs:annotation>
                        <xs:documentation>kirchlich Pädagogische Hochschule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="Praxis">
                    <xs:annotation>
                        <xs:documentation>Praxisschule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="Bschule">
                    <xs:annotation>
                        <xs:documentation>Bundesschule</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="BD">
                    <xs:annotation>
                        <xs:documentation>Bildungsdirektion</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="Min">
                    <xs:annotation>
                        <xs:documentation>Ministerium</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="AmtLand">
                    <xs:annotation>
                        <xs:documentation>Amt der Landesregierung</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="Sonst">
                    <xs:annotation>
                        <xs:documentation>Sonstige Einrichtung</xs:documentation>
                    </xs:annotation>
                </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    
    <!-- Predefined types -->

    <xs:simpleType name="string20">
        <xs:annotation>
            <xs:documentation>String mit max. 20 Zeichen</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:maxLength value="20" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="schuljahrDef">
        <xs:annotation>
            <xs:documentation>Beispiel: 2013/14</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="((((19)|(20))\d\d)|(\d\d))/[0-9]{2}" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="skzDef">
        <xs:annotation>
            <xs:documentation>Zahl zwischen 100000 und 999999</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:int">
            <xs:minInclusive value="100000" />
            <xs:maxInclusive value="999999" />
        </xs:restriction>
    </xs:simpleType>
   
    <xs:simpleType name="geburtsjahrDef">
        <xs:annotation>
            <xs:documentation>Geburtsjahr 4-stellig</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:int">
            <xs:minInclusive value="1900" />
            <xs:maxInclusive value="2500" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="meldeartDef">
        <xs:restriction base="xs:string">
            <xs:enumeration value="n">
                <xs:annotation>
                    <xs:documentation>
                        Neumeldung. Sollte schon eine Meldung in der Datenbank für die Kombination (Absender, Schuljahr, Monat) existieren,
                        werden alle bestehenden Daten gelöscht und nur die neue Meldung gespeichert.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="k">
                <xs:annotation>
                    <xs:documentation>
                        Korrekturmeldung. Sollte schon eine Meldung in der Datenbank für die Kombination (Absender, Schuljahr, Monat) existieren,
                        so werden bestehende dsk überschrieben und neue hinzugefügt. In der Datenbank bestehende dsk, die aber nicht
                        in der Korrekturmeldung enthalten sind, bleiben unverändert erhalten.
                    </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="decimal6.2">
        <xs:annotation>
            <xs:documentation>insgesamt 6 Stellen (ohne Komma), davon 2 nach dem Komma - Bsp. 1234.56</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:decimal">
            <xs:totalDigits value="6" />
            <xs:fractionDigits value="2" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="decimal8.2">
        <xs:annotation>
            <xs:documentation>insgesamt 8 Stellen (ohne Komma), davon 2 nach dem Komma - Bsp. 123456.78</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:decimal">
            <xs:totalDigits value="8" />
            <xs:fractionDigits value="2" />
        </xs:restriction>
    </xs:simpleType>
</xs:schema>