<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="/autor/namespace"
    xmlns="/autor/namespace"
    xmlns:klienci="/klienci/namespace"
>
    <xs:import namespace="/klienci/namespace" schemaLocation="klienci.xsd" />

    <xs:complexType name="autorType">
        <xs:all>
            <xs:element name="student" type="studentType" />
            <xs:element name="zadanie" type="zadanieType" />
        </xs:all>
    </xs:complexType>

    <xs:complexType name="studentType">
        <xs:sequence>
            <xs:element name="imie" type="klienci:klientNameType" />
            <xs:element name="nazwisko" type="klienci:klientNameType" />
            <xs:element name="indeks">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:length value="6" />
                        <xs:pattern value="\d+" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="zadanieType">
        <xs:sequence>
            <xs:element name="temat" type="xs:string"  minOccurs="0"/>
            <xs:element name="nazwa">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="Zadanie \d" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:schema>