<?xml version="1.0" encoding="iso-8859-2"?>
<!DOCTYPE xsd:schema SYSTEM
  "file:/home/risko/progny4/dtds/XMLSchema.dtd" [

<!ENTITY % p 'xsd:'>
<!ENTITY % s ':xsd'>
]>

<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'
	    targetNamespace="http://gergo.risko.hu/leckekonyv"
	    xmlns="http://gergo.risko.hu/leckekonyv"
	    elementFormDefault='qualified'>

  <xsd:element name="leckekönyv" type="leckekönyv">
  </xsd:element>

  <xsd:complexType name="leckekönyv">
    <xsd:sequence>
      <xsd:element name="név" type="xsd:string"/>
      <xsd:element name="intézmény" type="xsd:string"/>
      <xsd:element name="félév" type="félév"
		   maxOccurs="20" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="félév">
    <xsd:choice minOccurs="1" maxOccurs="unbounded">
      <xsd:element name="előadás">
	<xsd:complexType>
	  <xsd:sequence>
	    <xsd:element name="vizsgajegy" maxOccurs="3" minOccurs="0">
	      <xsd:complexType>
		<xsd:simpleContent>
		  <xsd:extension base="jegy">
		    <xsd:attribute name="vizsgáztató"
				   type="xsd:string"
				   use="required"/>
		  </xsd:extension>
		</xsd:simpleContent>
	      </xsd:complexType>
	    </xsd:element>
	  </xsd:sequence>
	  <xsd:attributeGroup ref="tárgyAttrs"/>
	  <xsd:attribute name="előadó" type="xsd:string"/>
	</xsd:complexType>
      </xsd:element>
      <xsd:element name="gyakorlat">
	<xsd:complexType>
	  <xsd:sequence>
	    <xsd:element name="gyakorlatijegy" type="jegy" minOccurs="0"
			 maxOccurs="2"/>
	  </xsd:sequence>
	  <xsd:attributeGroup ref="tárgyAttrs"/>
	  <xsd:attribute name="gyakorlatvezető" type="xsd:string"
			 use="required"/>
	</xsd:complexType>
      </xsd:element>
    </xsd:choice>
    <xsd:attribute name="kar" type="xsd:string" use="required"/>
    <xsd:attribute name="tagozat" use="required">
      <xsd:simpleType>
	<xsd:restriction base="xsd:string">
	  <xsd:enumeration value="nappali"/>
	  <xsd:enumeration value="esti"/>
	</xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
    <xsd:attribute name="szak" type="xsd:string" use="required"/>
    <xsd:attribute name="tanév" use="required">
      <xsd:simpleType>
	<xsd:restriction base="xsd:string">
	  <xsd:pattern value="\d{4}/\d{4}"/>
	</xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
    <xsd:attribute name="szemeszter" use="required">
      <xsd:simpleType>
	<xsd:restriction base="xsd:string">
	  <xsd:enumeration value="őszi"/>
	  <xsd:enumeration value="tavaszi"/>
	</xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
  </xsd:complexType>

  <!-- jegy: 1..5-ig szám vagy "nem jelent meg",
       illetve "megtagadva", plusz egy dátum
       attribútum -->
  <xsd:complexType name="jegy">
    <xsd:simpleContent>
      <xsd:extension base="jegydátumnélkül">
	<xsd:attribute name="dátum" type="xsd:date"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

  <xsd:simpleType name="jegydátumnélkül">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="1"/>
      <xsd:enumeration value="2"/>
      <xsd:enumeration value="3"/>
      <xsd:enumeration value="4"/>
      <xsd:enumeration value="5"/>
      <xsd:enumeration value="nem jelent meg"/>
      <xsd:enumeration value="megtagadva"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:attributeGroup name="tárgyAttrs">
    <xsd:attribute name="tárgykód" type="xsd:string"
		   use="required"/>
    <xsd:attribute name="név" type="xsd:string"
		   use="required"/>
    <xsd:attribute name="óraszám" type="xsd:nonNegativeInteger"
		   use="required"/>
  </xsd:attributeGroup>
</xsd:schema>

