<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
  elementFormDefault="qualified" 
  targetNamespace="http://www.daisy.org/z3986/2005/ncx/"
  xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" >
  
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
  
  <xs:element name="ncx">
    <xs:complexType>
      
      <xs:sequence>
        <xs:element ref="ncx:head"/>
        <xs:element ref="ncx:docTitle"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ncx:docAuthor"/>
        <xs:element ref="ncx:navMap"/>
        <xs:element minOccurs="0" ref="ncx:pageList"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ncx:navList"/>
      </xs:sequence>
      
      <xs:attribute name="version" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="2005-1"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      
      <xs:attributeGroup ref="ncx:i18n"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="head">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ncx:meta"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="docTitle">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ncx:text"/>
        <xs:element minOccurs="0" ref="ncx:img"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attributeGroup ref="ncx:i18n"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="docAuthor">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ncx:text"/>
        <xs:element minOccurs="0" ref="ncx:img"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attributeGroup ref="ncx:i18n"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="navMap">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ncx:navInfo"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ncx:navLabel"/>
        <xs:element maxOccurs="unbounded" ref="ncx:navPoint"/>
      </xs:sequence>
      <xs:attribute name="id"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="text">
    <xs:complexType mixed="true">
      <xs:attribute name="id"/>
      <xs:attribute name="class"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="img">
    <xs:complexType>
      <xs:attribute name="id"/>
      <xs:attribute name="class"/>
      <xs:attribute name="src" use="required"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="content">
    <xs:complexType>
      <xs:attribute name="id"/>
      <xs:attribute name="src" use="required"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="navInfo">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ncx:text"/>
        <xs:element minOccurs="0" ref="ncx:img"/>
      </xs:sequence>
      <xs:attributeGroup ref="ncx:i18n"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="navLabel">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ncx:text"/>
        <xs:element minOccurs="0" ref="ncx:img"/>
      </xs:sequence>
      <xs:attributeGroup ref="ncx:i18n"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="navPoint">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ncx:navLabel"/>
        <xs:element ref="ncx:content"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ncx:navPoint"/>
      </xs:sequence>
      <xs:attribute name="id" use="required"/>
      <xs:attribute name="class"/>
      <xs:attribute name="playOrder"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="pageList">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ncx:navLabel"/>
        <xs:element minOccurs="0" ref="ncx:navInfo"/>
        <xs:element maxOccurs="unbounded" ref="ncx:pageTarget"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attribute name="class"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="navList">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ncx:navInfo"/>
        <xs:element maxOccurs="unbounded" ref="ncx:navLabel"/>
        <xs:element maxOccurs="unbounded" ref="ncx:navTarget"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attribute name="class"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="pageTarget">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ncx:navLabel"/>
        <xs:element ref="ncx:content"/>
      </xs:sequence>
      <xs:attribute name="id"/>
      <xs:attribute name="value"/>
      <xs:attribute name="type" use="required"/>
      <xs:attribute name="class"/>
      <xs:attribute name="playOrder"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="navTarget">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ncx:navLabel"/>
        <xs:element ref="ncx:content"/>
      </xs:sequence>
      <xs:attribute name="id" use="required"/>
      <xs:attribute name="class"/>
      <xs:attribute name="value"/>
      <xs:attribute name="playOrder"/>
    </xs:complexType>
  </xs:element>
  
  <xs:element name="meta">
    <xs:complexType>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="content" use="required"/>
      <xs:attribute name="scheme"/>
    </xs:complexType>
  </xs:element>
  
  <xs:attributeGroup name="i18n">
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="dir">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="ltr"/>
          <xs:enumeration value="rtl"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  
</xs:schema>
