<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================= -->
<!--                    HEADER                                     -->
<!-- ============================================================= -->
<!--  MODULE:    XML EXCHANGE TABLE MODEL DECLARATION MODULE       -->
<!--  VERSION:   1.0.1                                             -->
<!--  DATE:      November 2005                                     -->
<!--                                                               -->
<!-- ============================================================= -->
<!-- ============================================================= -->
<!-- SYSTEM:     Darwin Information Typing Architecture (DITA)     -->
<!--                                                               -->
<!-- PURPOSE:    W3C XML Schema to describe DITA Tables            -->
<!--                                                               -->
<!-- ORIGINAL CREATION DATE:                                       -->
<!--             Derived from OASIS Exchange Table Model base      -->
<!--                                                               -->
<!--             (C) Copyright OASIS-Open.org 2005.                -->
<!--             (C) Copyright IBM Corporation 2001, 2004.         -->
<!--             All Rights Reserved.                              -->
<!--                                                               -->
<!--  UPDATES:                                                     -->
<!--    2005.11.15 EAS: Corrected definition for entry element     -->
<!-- ============================================================= -->
<!-- XML EXCHANGE TABLE MODEL DECLARATION MODULE                   -->
<!-- OASIS DITA 1.0 notes:
     The Exchange Table Model replaces the original CALS-based model
     used in development versions of the DITA definition.
     This set of declarations defines the XML version of the Exchange
     Table Model as adapted for OASIS DITA version 1.0.
     The base for the DITA version of the Exchange Table Model is
     defined at http://www.oasis-open.org/specs/tm9901.htm .
     The DITA version specifically extends this model with these DITA-
     specific content and attribute adaptations to the DITA processing
     requirements:

     STRUCTURE:

     Introduce the DITA-unique <desc> element (optional after <title>); this element
     enables more consistent presentation of both figures and tables.


     ATTRIBUTES:

     For the <table> element, add:
     %univ-atts; which consists of:
     %select-atts; [for selection, conditional processing]
     %id-atts; [for conref and linking]
     @translate + @xml:lang) [for NLS processing support]
     %global-atts; (@xtrf + @xtrc) [for tracing and messaging support in processors]
     @class [for specialization support]
     @outputclass [for role designation (ie, styles, future migrations)]
     @rowheader [for accessibility support in processing]
     %display-atts; which consists of:
     @scale [for presentational equivalence with other scaled exhibits: fig, pre, lines, simpletable]
     @frame (already part of table)
     @pgwide (already part of table, same intent as original @expanse)

     For <tgroup>, <thead>, <tbody>, and <row>, add:
     %univ-atts;
     %global-atts;
     @class
     @outputclass [for role designation (ie, styles, future migrations)]

     For <entry>, add:
     %id-atts;
     %global-atts
     @class
     @outputclass [for role designation (ie, styles, future migrations)]
     @rev [for indication of revised content for flag-based processing]

     -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="table" type="table.class">
    <xs:annotation>
      <xs:documentation>
        The &lt;<keyword>table</keyword>> element organizes arbitrarily
        complex relationships of tabular information. This standard table markup allows
        column or row spanning and table captions or descriptions. A optional title
        allowed inside the table element provides a caption to describe the table.
        See <ph><xref href="simpletable.xml">simpletable</xref></ph> for a simplified
        table model that can be specialized to represent more regular relationships
        of data.
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="table.class">
    <xs:sequence>
      <xs:sequence minOccurs="0">
        <xs:group ref="title" minOccurs="0"/>
        <xs:group ref="desc" minOccurs="0"/>
      </xs:sequence>
      <xs:group ref="tgroup" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attributeGroup ref="colrowsep-atts"/>
    <xs:attribute name="pgwide" type="xs:NMTOKEN"/>
    <xs:attribute name="rowheader" type="rowheader-att.class"/>
    <xs:attribute name="outputclass" type="xs:string"/>
    <xs:attributeGroup ref="display-atts"/>
    <xs:attributeGroup ref="univ-atts"/>
    <xs:attributeGroup ref="global-atts"/>
    <xs:attribute ref="class" default="- topic/table "/>
  </xs:complexType>
  <xs:simpleType name="rowheader-att.class">
    <xs:restriction base="xs:string">
      <xs:enumeration value="firstcol"/>
      <xs:enumeration value="norowheader"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="tgroup" type="tgroup.class">
    <xs:annotation>
      <xs:documentation>
        The &lt;<keyword>tgroup</keyword>> element in a table contains
        column, row, spanning, header and footer specifications, and the body (&lt;<keyword>tbody</keyword>>)
        of the table.
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="tgroup.class">
    <xs:sequence>
      <xs:group ref="colspec" minOccurs="0" maxOccurs="unbounded"/>
      <xs:group ref="thead" minOccurs="0"/>
      <xs:group ref="tbody"/>
    </xs:sequence>
    <xs:attribute name="cols" type="xs:NMTOKEN" use="required"/>
    <xs:attributeGroup ref="colrowsep-atts"/>
    <xs:attribute name="align" type="align-att.class"/>
    <xs:attribute name="outputclass" type="xs:string"/>
    <xs:attributeGroup ref="univ-atts"/>
    <xs:attributeGroup ref="global-atts"/>
    <xs:attribute ref="class" default="- topic/tgroup "/>
  </xs:complexType>
  <xs:attributeGroup name="colrowsep-atts">
    <xs:attribute name="colsep" type="xs:NMTOKEN"/>
    <xs:attribute name="rowsep" type="xs:NMTOKEN"/>
  </xs:attributeGroup>
  <xs:element name="colspec" type="colspec.class">
    <xs:annotation>
      <xs:documentation>
        The &lt;<keyword>colspec</keyword>> element contains a column specification
        for a table, including assigning a column name and number, cell content alignment,
        and column width.
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="colspec.class">
    <xs:attribute name="colnum" type="xs:NMTOKEN"/>
    <xs:attribute name="colname" type="xs:NMTOKEN"/>
    <xs:attribute name="align" type="align-att.class"/>
    <xs:attribute name="colwidth" type="xs:string"/>
    <xs:attributeGroup ref="colrowsep-atts"/>
    <xs:attribute name="char" type="xs:string"/>
    <xs:attribute name="charoff" type="xs:NMTOKEN"/>
    <xs:attributeGroup ref="global-atts"/>
    <xs:attribute ref="class" default="- topic/colspec "/>
  </xs:complexType>
  <xs:element name="thead" type="thead.class">
    <xs:annotation>
      <xs:documentation>
        The table header (&lt;<keyword>thead</keyword>>) element precedes
        the table body (&lt;<keyword>tbody</keyword>>) element in a complex table.
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="thead.class">
    <xs:sequence>
      <xs:group ref="row" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="valign" type="valign-att.class"/>
    <xs:attribute name="outputclass" type="xs:string"/>
    <xs:attributeGroup ref="univ-atts"/>
    <xs:attributeGroup ref="global-atts"/>
    <xs:attribute ref="class" default="- topic/thead "/>
  </xs:complexType>
  <xs:element name="tbody" type="tbody.class">
    <xs:annotation>
      <xs:documentation>
        The &lt;<keyword>tbody</keyword>> element contains the rows in
        a table.
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="tbody.class">
    <xs:choice>
      <xs:group ref="row" maxOccurs="unbounded"/>
    </xs:choice>
    <xs:attribute name="valign" type="valign-att.class"/>
    <xs:attribute name="outputclass" type="xs:string"/>
    <xs:attributeGroup ref="univ-atts"/>
    <xs:attributeGroup ref="global-atts"/>
    <xs:attribute ref="class" default="- topic/tbody "/>
  </xs:complexType>
  <xs:element name="row" type="row.class">
    <xs:annotation>
      <xs:documentation>The &lt;<keyword>row</keyword>> element contains a single row in
        a table &lt;<keyword>tgroup</keyword>>.
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="row.class">
    <xs:choice>
      <xs:group ref="entry" maxOccurs="unbounded"/>
    </xs:choice>
    <xs:attribute name="rowsep" type="xs:NMTOKEN"/>
    <xs:attribute name="valign" type="valign-att.class"/>
    <xs:attribute name="outputclass" type="xs:string"/>
    <xs:attributeGroup ref="univ-atts"/>
    <xs:attributeGroup ref="global-atts"/>
    <xs:attribute ref="class" default="- topic/row "/>
  </xs:complexType>
  <xs:element name="entry" type="entry.class">
    <xs:annotation>
      <xs:documentation>The &lt;<keyword>entry</keyword>> element defines a single cell
        in a table.        
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="entry.class" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:group ref="tblcell.cnt"/>
    </xs:choice>
    <xs:attribute name="namest" type="xs:string"/>
    <xs:attribute name="nameend" type="xs:string"/>
    <xs:attribute name="spanname" type="xs:string"/>
    <xs:attribute name="colname" type="xs:string"/>
    <xs:attribute name="morerows" type="xs:string"/>
    <xs:attributeGroup ref="colrowsep-atts"/>
    <xs:attribute name="align" type="align-att.class"/>
    <xs:attribute name="valign" type="valign-att.class"/>
    <xs:attribute name="rev" type="xs:string"/>
    <xs:attribute name="outputclass" type="xs:string"/>
    <xs:attributeGroup ref="global-atts"/>
    <xs:attribute ref="class" default="- topic/entry "/>
    <!-- added DITA attributes -->
  </xs:complexType>
  <xs:simpleType name="align-att.class">
    <xs:restriction base="xs:string">
      <xs:enumeration value="left"/>
      <xs:enumeration value="right"/>
      <xs:enumeration value="center"/>
      <xs:enumeration value="justify"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="valign-att.class">
    <xs:restriction base="xs:string">
      <xs:enumeration value="top"/>
      <xs:enumeration value="middle"/>
      <xs:enumeration value="bottom"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>

