Базовая форма для Sql 0.1

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
  targetNamespace="https://deneblingvo.org/xsd/sql/0.1"
  elementFormDefault="qualified"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:sql="https://deneblingvo.org/xsd/sql/0.1">

  <xsd:element
    name="sql"
    type="sql:sql">
    <xsd:annotation>
      <xsd:documentation>Корневой элемент</xsd:documentation>
    </xsd:annotation>
  </xsd:element>

  <xsd:complexType name="sql">
    <xsd:annotation>
      <xsd:documentation>
        Корневой элемент.
        Содержит список пакетов.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="0"
      maxOccurs="unbounded">
      <xsd:element
        name="package"
        type="sql:package">
        <xsd:annotation>
          <xsd:documentation>Пакет</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="package">
    <xsd:annotation>
      <xsd:documentation>
        Пакет.
        Содержит коментарий, версии и таблицы.
        Имеет имя.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="1"
      maxOccurs="1">
      <xsd:element
        name="comment"
        type="sql:comment"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Коментарий</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element
        name="versions"
        type="sql:versions"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Версии</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element
        name="tables"
        type="sql:tables"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Таблицы</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute
      name="name"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>

  <xsd:complexType name="tables">
    <xsd:annotation>
      <xsd:documentation>
        Таблицы.
        Содержит список таблиц.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="0"
      maxOccurs="unbounded">
      <xsd:element
        name="table"
        type="sql:table">
        <xsd:annotation>
          <xsd:documentation>Таблица</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="table">
    <xsd:annotation>
      <xsd:documentation>
        Таблица.
        Содержит коментарий, версии, поля, строки.
        Имеет имя, префикс, вид и короткое имя.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="1"
      maxOccurs="1">
      <xsd:element
        name="comment"
        type="sql:comment"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Коментарий</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element
        name="versions"
        type="sql:versions"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Версии</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element
        name="fields"
        type="sql:fields"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Поля</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element
        name="rows"
        type="sql:rows"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Строки</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute
      name="name"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="prefix"
      type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Префикс</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="kind"
      type="sql:table-kind">
      <xsd:annotation>
        <xsd:documentation>Вид</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="short"
      type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Короткое имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>

  <xsd:complexType name="fields">
    <xsd:annotation>
      <xsd:documentation>
        Поля.
        Содержит список полей таблицы.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="0"
      maxOccurs="unbounded">
      <xsd:element
        name="field"
        type="sql:field">
        <xsd:annotation>
          <xsd:documentation>Поле.</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="field">
    <xsd:annotation>
      <xsd:documentation>
        Поле.
        Содержит комментарий, версии, ссылки.
        Имеет имя, вид, короткое имя, тип.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="1"
      maxOccurs="1">
      <xsd:element
        name="comment"
        type="sql:comment"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Коментарий</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element
        name="versions"
        type="sql:versions"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Версии</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element
        name="links"
        type="sql:links"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Ссылки</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute
      name="name"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="kind"
      type="sql:field-kind"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Вид</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="short"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Короткое имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="type"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Тип</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>

  <xsd:complexType name="links">
    <xsd:annotation>
      <xsd:documentation>
        Ссылки.
        Содержит список ссылок.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="0"
      maxOccurs="unbounded">
      <xsd:element
        name="link"
        type="sql:link">
        <xsd:annotation>
          <xsd:documentation>Ссылка</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="link">
    <xsd:annotation>
      <xsd:documentation>
        Ссылка.
        Содержит ссылку на таблицу и ссылку на поле.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="1"
      maxOccurs="1">
      <xsd:element
        name="link-table"
        type="sql:link-table"
        minOccurs="1"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Ссылка на таблицу</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element
        name="link-field"
        type="sql:link-field"
        minOccurs="1"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Ссылка на поле</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="link-table">
    <xsd:annotation>
      <xsd:documentation>
        Ссылка на таблицу.
        Имеет имя, префикс, вид и короткое имя.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:attribute
      name="name"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="prefix"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Префикс</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="kind"
      type="sql:table-kind"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Вид</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="short"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Короткое имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>

  <xsd:complexType name="link-field">
    <xsd:annotation>
      <xsd:documentation>
        Ссылка на поле.
        Имеет имя, вид, короткое имя, тип.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:attribute
      name="name"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="kind"
      type="sql:field-kind"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Вид</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="short"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Короткое имя</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="type"
      type="xsd:string"
      use="required">
      <xsd:annotation>
        <xsd:documentation>Тип</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>

  <xsd:complexType name="rows">
    <xsd:annotation>
      <xsd:documentation>
        Строки.
        Содержит список строк.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="0"
      maxOccurs="unbounded">
      <xsd:element
        name="row"
        type="sql:row">
        <xsd:annotation>
          <xsd:documentation>Строка</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:simpleType name="row">
    <xsd:annotation>
      <xsd:documentation>Строка.</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="table-kind">
    <xsd:annotation>
      <xsd:documentation>
        Вид таблицы.
        Одно из значений Dictionary, List, Register, Cross.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="D">
        <xsd:annotation>
          <xsd:documentation>Dictionary - cловарь</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration value="L">
        <xsd:annotation>
          <xsd:documentation>List - список</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration value="R">
        <xsd:annotation>
          <xsd:documentation>Register - журнал</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration value="X">
        <xsd:annotation>
          <xsd:documentation>Cross перекрёсные ссылки</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="field-kind">
    <xsd:annotation>
      <xsd:documentation>
        Вид поля.
        Одно из значений Key, Field, Link.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="K">
        <xsd:annotation>
          <xsd:documentation>Key - ключ</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration value="F">
        <xsd:annotation>
          <xsd:documentation>Field - поле</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration value="L">
        <xsd:annotation>
          <xsd:documentation>Link - ссылка</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="versions">
    <xsd:annotation>
      <xsd:documentation>
        Версии.
        Содержит список версий.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="0"
      maxOccurs="unbounded">
      <xsd:element
        name="version"
        type="sql:version">
        <xsd:annotation>
          <xsd:documentation>Версия</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="version">
    <xsd:annotation>
      <xsd:documentation>
        Версия.
        Содержит коментарий.
        Имеет номер версии, дату и автора.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence
      minOccurs="1"
      maxOccurs="1">
      <xsd:element
        name="comment"
        type="sql:comment"
        minOccurs="0"
        maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Коментарий</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute
      name="version"
      type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Номер версии</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="date"
      type="xsd:date">
      <xsd:annotation>
        <xsd:documentation>Дата</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute
      name="editor"
      type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Автор</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>

  <xsd:simpleType name="comment">
    <xsd:annotation>
      <xsd:documentation>Коментарий</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
    </xsd:restriction>
  </xsd:simpleType>

</xsd:schema>
File: