<?xml version="1.0" encoding="utf-8"?>
<!-- ====================================================================== -->
<!-- Copyright © 2004-2012 Typefi Systems. All rights reserved.             -->
<!--                                                                        -->
<!-- Schema Version: 2.0                                                    -->
<!-- Schema Location: http://www.typefi.com/TPS/content/2_0/ContentXML.xsd  -->
<!--                                                                        -->
<!-- Version:                                                               -->
<!--     $Id: ContentXML_2_0.xsd 7555 2011-11-17 00:48:19Z bhauser $        -->
<!--                                                                        -->
<!-- ====================================================================== -->
<xsd:schema xmlns="http://www.typefi.com/ContentXML" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.typefi.com/ContentXML" elementFormDefault="qualified"
  attributeFormDefault="unqualified" xml:lang="en">

  <!-- ==================================================================== -->
  <!-- Import for xml:lang and xml:space                                    -->
  <!-- ==================================================================== -->
  <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
    schemaLocation="http://www.w3.org/2001/xml.xsd"/>

  <!-- ==================================================================== -->
  <!-- Content is composed of paras, contexts, conditions, images and lists -->
  <!-- ==================================================================== -->
  <xsd:group name="ContentGroup">
    <xsd:choice>
      <xsd:element name="p" type="InlineType"/>
      <xsd:element name="context" type="ContextType"/>
      <xsd:element name="condition" type="ConditionType"/>
      <xsd:element name="image" type="ImageType"/>
      <xsd:element name="ol" type="OrderedListType"/>
      <xsd:element name="ul" type="UnorderedListType"/>
      <xsd:element name="table" type="TableType"/>
      <xsd:element name="break" type="BreakType"/>
    </xsd:choice>
  </xsd:group>

  <!-- ==================================================================== -->
  <!-- Deprecated in Typefi Publish 6                                        -->
  <!-- Valid values for the xref type attribute.                            -->
  <!--  Enumeration is here for reference. Some values will extend PartType -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="XRefTypeEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="pagecount"/>
      <xsd:enumeration value="content"/>
      <xsd:enumeration value="display"/>
      <xsd:enumeration value="itemcount"/>
      <xsd:enumeration value="itemindex"/>
      <xsd:enumeration value="indexname"/>
      <xsd:enumeration value="paracount"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Deprecated in Typefi Publish 6                                       -->
  <!-- Valid values for the xef partType attribute.                         -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="PartTypeEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="content"/>
      <xsd:enumeration value="field"/>
      <xsd:enumeration value="pageNumber"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Valid values for the xef refType attribute.                          -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="LegacyRefTypeEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="project"/>
      <xsd:enumeration value="document"/>
      <xsd:enumeration value="section"/>
      <xsd:enumeration value="context"/>
      <xsd:enumeration value="paragraph"/>
      <xsd:enumeration value="anchor"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Valid values for the xef textType attribute.                         -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="TextTypeEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="dynamic"/>
      <xsd:enumeration value="static"/>
      <xsd:enumeration value="error"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Valid values for the table valign attribute.                         -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="TableValignEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="top"/>
      <xsd:enumeration value="middle"/>
      <xsd:enumeration value="bottom"/>
      <xsd:enumeration value="justify"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Valid values for the table halign attribute.                         -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="TableHalignEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="left"/>
      <xsd:enumeration value="center"/>
      <xsd:enumeration value="right"/>
      <xsd:enumeration value="justify"/>
      <xsd:enumeration value="justifyLeft"/>
      <xsd:enumeration value="justifyCenter"/>
      <xsd:enumeration value="justifyRight"/>
      <xsd:enumeration value="justifyFull"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Valid values for the table rotate attribute.                         -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="TableRotateEnumeration">
    <xsd:restriction base="xsd:integer">
      <xsd:enumeration value="0"/>
      <xsd:enumeration value="90"/>
      <xsd:enumeration value="180"/>
      <xsd:enumeration value="270"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Valid values for the attribute type of a soft-style (tps:style).     -->
  <!-- These values can be combined using '|' as delimiter.                 -->
  <!-- Note: The schema doesn't use this enumeration explicitly.            -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="BasicSoftStyleEnumeration_enum">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="bold"/>
      <xsd:enumeration value="italic"/>
      <xsd:enumeration value="underline"/>
      <xsd:enumeration value="underlineWord"/>
      <xsd:enumeration value="nobreak"/>
      <xsd:enumeration value="strikethrough"/>
      <xsd:enumeration value="superscript"/>
      <xsd:enumeration value="subscript"/>
      <xsd:enumeration value="allCaps"/>
      <xsd:enumeration value="smallCaps"/>
      <xsd:enumeration value="outline"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="BasicSoftStyleEnumeration_pattern">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="lang[:][\-_a-zA-Z0-9]+"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- Bug fix 4535: Redefined BasicSoftStyleEnumeration into a union of an enumaration and the pattern -->
  <xsd:simpleType name="BasicSoftStyleEnumeration">
    <xsd:union memberTypes="BasicSoftStyleEnumeration_enum BasicSoftStyleEnumeration_pattern"/>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Valid values for the attribute style of ordered lists.               -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="OrderedListStyleEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="1"/>
      <xsd:enumeration value="I"/>
      <xsd:enumeration value="i"/>
      <xsd:enumeration value="A"/>
      <xsd:enumeration value="a"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- The schema change is a new attribute on <content> and <section>      -->
  <!-- called whiteSpaceMode. Like strictSpace it will be optional (to      -->
  <!-- maintain backwards compatibility). If both are present               -->
  <!-- whiteSpaceMode overrides strictSpace.                                -->
  <!--                                                                      -->
  <!-- The strictSpace attribute is now deprecated. Still supported, but    -->
  <!-- deprecated. From V6 our documentation should talk only about         -->
  <!-- whiteSpaceMode.                                                      -->
  <!--                                                                      -->
  <!-- Like strictSpace:                                                    -->
  <!--                                                                      -->
  <!-- 1. whiteSpaceMode applies to all content within the relevant content -->
  <!--    or section, and                                                   -->
  <!-- 2. single jobs can mix up whiteSpaceModes on a section by section    -->
  <!--    basis                                                             -->
  <!--                                                                      -->
  <!-- The 3 valid values for whiteSpaceMode are:                           -->
  <!--                                                                      -->
  <!-- 1. "classic" This is the behaviour of early versions of Typefi       -->
  <!--    Publish:                                                          -->
  <!--    a. All occurrences of #x9 (tab), #xA (line feed) and #xD          -->
  <!--       (carriage return)                                              -->
  <!--       are replaced with #x20 (space).                                -->
  <!--    b. Contiguous sequences of #x20’s are collapsed to a single #x20. -->
  <!--    c. Leading #x20’s are trimmed from the beginning of <p> elements. -->
  <!-- 2. "strict"  This is the only mode that guarantees immunity from     -->
  <!--    pretty printing                                                   -->
  <!--    (as long as you’ve setup all your <s/> tags correctly).           -->
  <!--    a. All occurrences of #x9 (tab), #xA (line feed) and #xD          -->
  <!--       (carriage return)                                              -->
  <!--       are replaced with #x20 (space).                                -->
  <!--    b. Contiguous sequences of #x20’s are collapsed to a single #x20. -->
  <!--    c. Leading and trailing #x20’s are removed from all text nodes.   -->
  <!-- 3. "preserve" No normalization is done, the value is not changed.    -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="WhiteSpaceModeEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="classic"/>
      <xsd:enumeration value="strict"/>
      <xsd:enumeration value="preserve"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Table cells are composed of the normal content group.                -->
  <!-- ==================================================================== -->
  <xsd:complexType name="TableCellType">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:group ref="ContentGroup"/>
    </xsd:choice>
    <xsd:attribute name="namest" type="xsd:string" use="optional"/>
    <xsd:attribute name="nameend" type="xsd:string" use="optional"/>
    <xsd:attribute name="valign" type="TableValignEnumeration" use="optional"/>
    <xsd:attribute name="align" type="TableHalignEnumeration" use="optional"/>
    <xsd:attribute name="rotate" type="TableRotateEnumeration" use="optional"/>
    <xsd:attribute name="morerows" type="xsd:integer" use="optional"/>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Table rows are composed of table cells.                              -->
  <!-- ==================================================================== -->
  <xsd:complexType name="TableRowType">
    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="entry" type="TableCellType"/>
    </xsd:sequence>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Table Sections are composed of table rows.                           -->
  <!-- ==================================================================== -->
  <xsd:complexType name="TableSectionType">
    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="row" type="TableRowType"/>
    </xsd:sequence>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- A table col spec defines column information for a table.             -->
  <!-- ==================================================================== -->
  <xsd:complexType name="TableColSpecType">
    <!-- colname must be a sequential integer starting with 1 -->
    <xsd:attribute name="colname" type="xsd:integer" use="required"/>
    <xsd:attribute name="align" type="TableHalignEnumeration" use="optional"/>
    <xsd:attribute name="rotate" type="TableRotateEnumeration" use="optional"/>
    <xsd:attribute name="colwidth" type="FixedOrRelativeWidthType" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- http://www.oasis-open.org/specs/tm9901.html#AEN530                   -->
  <!--                                                                      -->
  <!-- Either proportional measure of the form number*, e.g., “5*” for 5    -->
  <!-- times the proportion, or “*” (which is equivalent to “1*”); fixed    -->
  <!-- measure, e.g., 2pt for 2 point, 3pi for 3 pica. (Mixed measure,      -->
  <!-- e.g., 2*+3pt, while allowed in the full CALS table model, is not     -->
  <!-- supported in this Exchange model.) Coefficients are positive         -->
  <!-- integers or fixed point numbers; for fixed point numbers, a leading  -->
  <!-- (possibly 0) integer part is required, and implementations should    -->
  <!-- support at least 2 decimal places. A value of "" [the null string]   -->
  <!-- is treated as a proportional measure of “1*”.                        -->
  <!--                                                                      -->
  <!-- The fixed unit values are case insensitive. The standard list of     -->
  <!-- allowed unit values is “pt” (points), “cm” (centimeters), “mm”       -->
  <!-- (millimeters), “pi” (picas), and “in” (inches). The default fixed    -->
  <!-- unit should be interpreted as “pt” if neither a proportion nor a     -->
  <!-- fixed unit is specified.                                             -->
  <!--                                                                      -->
  <!-- NOTE: Typefi Publish also allows % as a valid unit.                  -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="FixedOrRelativeWidthType">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="\d+|\d+(\.\d+)?\s*([Pp][Tt]|[Cc][Mm]|[Mm][Mm]|[Pp][Ii]|[Ii][Nn]|%|\*)?"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- A table group is a sequence of header, body and footer regions.      -->
  <!-- ==================================================================== -->
  <xsd:complexType name="TableGroupType">
    <xsd:sequence>
      <!-- each column in the table must have a colspec -->
      <xsd:element name="colspec" minOccurs="1" maxOccurs="unbounded" type="TableColSpecType"/>
      <xsd:element name="thead" minOccurs="0" maxOccurs="1" type="TableSectionType"/>
      <xsd:element name="tbody" minOccurs="1" maxOccurs="1" type="TableSectionType"/>
      <xsd:element name="tfoot" minOccurs="0" maxOccurs="1" type="TableSectionType"/>
    </xsd:sequence>
    <xsd:attribute name="cols" type="xsd:integer" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Tables are composed of table groups.                                 -->
  <!-- ==================================================================== -->
  <xsd:complexType name="TableType">
    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="tgroup" type="TableGroupType"/>
    </xsd:sequence>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
    <xsd:attribute name="width" type="FixedOrRelativeWidthType" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Ordered List type.                                                   -->
  <!-- ==================================================================== -->
  <xsd:complexType name="OrderedListType">
    <xsd:sequence>
      <xsd:element name="liFormat" minOccurs="0" maxOccurs="1" type="ListItemFormatType"/>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element name="li" type="ListItemType"/>
        <xsd:element name="condition" type="ConditionalListItems"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
    <xsd:attribute name="isRoot" type="xsd:boolean" use="optional" default="false"/>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
    <xsd:attribute name="style" type="OrderedListStyleEnumeration" use="optional"/>
    <xsd:attribute name="start" type="xsd:integer" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Unordered List type.                                                 -->
  <!-- ==================================================================== -->
  <xsd:complexType name="UnorderedListType">
    <xsd:sequence>
      <xsd:element name="liFormat" minOccurs="0" maxOccurs="1" type="ListItemFormatType"/>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element name="li" type="ListItemType"/>
        <xsd:element name="condition" type="ConditionalListItems"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
    <xsd:attribute name="isRoot" type="xsd:boolean" use="optional" default="false"/>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
    <xsd:attribute name="style" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Conditional List Items Type.                                         -->
  <!-- ==================================================================== -->
  <xsd:complexType name="ConditionalListItems">
    <xsd:sequence>
      <xsd:element name="li" minOccurs="0" maxOccurs="unbounded" type="ListItemType"/>
    </xsd:sequence>
    <xsd:attribute name="type" type="xsd:string" use="required"/>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- List Item Format Type.                                               -->
  <!-- ==================================================================== -->
  <xsd:complexType name="ListItemFormatType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="style" type="ListItemFormatContentType"/>
    </xsd:choice>
    <xsd:attribute name="align" type="TableHalignEnumeration" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Paras are composed of inline elements.                               -->
  <!-- ==================================================================== -->
  <xsd:complexType name="ListItemFormatContentType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="style" type="ListItemFormatContentType"/>
    </xsd:choice>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- List Item Reference Type.                                            -->
  <!-- ==================================================================== -->
  <xsd:complexType name="ListItemReferenceType">
    <xsd:attribute name="level" type="xsd:integer" use="optional" default="0"/>
    <xsd:attribute name="style" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- List Item Type.                                                      -->
  <!-- ==================================================================== -->
  <xsd:complexType name="ListItemType">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:group ref="ContentGroup"/>
    </xsd:choice>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Images contain ref and comment attributes.                           -->
  <!-- ==================================================================== -->
  <xsd:complexType name="ImageType">
    <xsd:attribute name="ref" type="xsd:string" use="optional"/>
    <xsd:attribute name="comment" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Conditions are composed of sections or standard content.             -->
  <!-- ==================================================================== -->
  <xsd:complexType name="ConditionType">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:group ref="ContentGroup"/>
    </xsd:choice>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
    <xsd:attribute name="type" type="xsd:string" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="XRefConditionType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="c" type="StyledTextType"/>
      <xsd:element name="style" type="StyledTextType"/>
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="condition" type="XRefConditionType"/>
      <xsd:element name="p" type="StyledTextType"/>
    </xsd:choice>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
    <xsd:attribute name="type" type="xsd:string" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Contexts are composed of standard content.                           -->
  <!-- ==================================================================== -->
  <xsd:complexType name="ContextType">
    <xsd:sequence>
      <xsd:element name="fieldSet" minOccurs="0" maxOccurs="unbounded" type="FieldSetType"/>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:group ref="ContentGroup"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" use="required"/>
    <xsd:attribute name="type" type="xsd:string" use="required"/>
    <xsd:attribute name="variant" type="xsd:string" use="optional"/>
    <xsd:attribute ref="xml:lang" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Footnotes and endnotes are composed of standard content.             -->
  <!-- ==================================================================== -->
  <xsd:complexType name="FootnoteType">
    <xsd:sequence>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:group ref="ContentGroup"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
    <xsd:attribute name="value" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Anchors are InlineTypes with a couple of extra attributes.           -->
  <!-- ==================================================================== -->
  <xsd:complexType name="AnchorType">
    <xsd:attribute name="name" type="xsd:string" use="optional"/>
    <xsd:attribute name="id" type="xsd:string" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Deprecated in Typefi Publish 6                                       -->
  <!-- Anchors are InlineTypes with a couple of extra attributes.           -->
  <!-- ==================================================================== -->
  <xsd:complexType name="EndAnchorType">
    <xsd:attribute name="name" type="xsd:string" use="optional"/>
    <xsd:attribute name="id" type="xsd:string" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Deprecated in Typefi Publish 6                                       -->
  <!-- xrefs can have some content set, if they are dynamic, the content is -->
  <!-- usually the result of resolving the xref the last time, otherwise it -->
  <!-- is usually some static text.                                         -->
  <!--                                                                      -->
  <!-- TODO: The content of an xref needs to allow to contain conditions    -->
  <!--       and needs to allow the use of intermediate paragraphs.         -->
  <!-- ==================================================================== -->
  <xsd:complexType name="XRefType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="c" type="StyledTextType"/>
      <xsd:element name="style" type="StyledTextType"/>
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="condition" type="XRefConditionType"/>
      <xsd:element name="p" type="StyledTextType"/>
    </xsd:choice>
    <xsd:attribute name="ref" type="xsd:string" use="optional"/>
    <xsd:attribute name="refType" type="LegacyRefTypeEnumeration" use="optional"/>
    <xsd:attribute name="refName" type="xsd:string" use="optional"/>
    <xsd:attribute name="refId" type="xsd:string" use="optional"/>
    <xsd:attribute name="partType" type="PartTypeEnumeration" use="optional"/>
    <xsd:attribute name="partName" type="xsd:string" use="optional"/>
    <xsd:attribute name="textType" type="TextTypeEnumeration" use="optional"/>
    <xsd:attribute name="textLimit" type="xsd:integer" use="optional"/>
    <xsd:attribute name="nolink" type="xsd:boolean" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- New in Typefi Publish 6                                              -->
  <!-- A cross-reference.                                                   -->
  <!-- ==================================================================== -->
  <xsd:complexType name="RefType">
    <xsd:attribute name="refType" type="RefTypeEnumeration" use="required"/>
    <xsd:attribute name="refId" type="xsd:string" use="required"/>
    <xsd:attribute name="format" type="xsd:string" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- New in Typefi Publish 6                                              -->
  <!-- Valid values for the <ref> refType attribute.                        -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="RefTypeEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="anchor"/>
      <xsd:enumeration value="paragraph"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Whitespace is an empty element with a single attribute.              -->
  <!-- ==================================================================== -->
  <xsd:complexType name="WhitespaceType">
    <xsd:attribute name="c" type="xsd:integer" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Paras are composed of inline elements.                               -->
  <!-- ==================================================================== -->
  <xsd:complexType name="InlineType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="c" type="InlineType"/>
      <xsd:element name="context" type="ContextType"/>
      <xsd:element name="condition" type="InlineType"/>
      <xsd:element name="image" type="ImageType"/>
      <xsd:element name="footnote" type="FootnoteType"/>
      <xsd:element name="endnote" type="FootnoteType"/>
      <xsd:element name="anchor" type="AnchorType"/>
      <xsd:element name="endAnchor" type="EndAnchorType"/> <!-- Deprecated in Typefi Publish 6 -->
      <xsd:element name="xref" type="XRefType"/>
      <xsd:element name="ref" type="RefType"/>
      <xsd:element name="link" type="LinkType"/>
      <xsd:element name="doclink" type="DocLinkType"/>
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="style" type="InlineType"/>
      <xsd:element name="indexterm" type="IndexTermType"/>
      <xsd:element name="table" type="TableType"/>
      <xsd:element name="char" type="CharType"/>
    </xsd:choice>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
    <xsd:attribute ref="xml:lang" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Break type.                                                          -->
  <!-- ==================================================================== -->
  <xsd:complexType name="BreakType">
    <xsd:attribute name="type" type="BreakTypeEnumeration" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Valid values for the type attribute of <break> tags.                 -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="BreakTypeEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="column"/>
      <xsd:enumeration value="frame"/>
      <xsd:enumeration value="evenPage"/>
      <xsd:enumeration value="oddPage"/>
      <xsd:enumeration value="page"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Char type.                                                           -->
  <!-- ==================================================================== -->
  <xsd:complexType name="CharType">
    <xsd:attribute name="type" type="CharTypeEnumeration" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- Valid values for the type attribute of <char> tags.                  -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="CharTypeEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="currentPageNumber"/>
      <xsd:enumeration value="nextPageNumber"/>
      <xsd:enumeration value="previousPageNumber"/>
      <xsd:enumeration value="sectionMarker"/>
      <xsd:enumeration value="rightIndentTab"/>
      <xsd:enumeration value="indentToHere"/>
      <xsd:enumeration value="endNestedStyleHere"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- Styled text is mixed with character styles and whitespace.           -->
  <!-- ==================================================================== -->
  <xsd:complexType name="StyledTextType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="c" type="StyledTextType"/>
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="condition" type="StyledTextType"/>
      <xsd:element name="style" type="StyledTextType"/>
    </xsd:choice>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- A field set contains the field's 'name' and 'value'.                 -->
  <!-- ==================================================================== -->
  <xsd:complexType name="FieldSetType">
    <xsd:attribute name="name" type="xsd:string" use="required"/>
    <xsd:attribute name="value" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <xsd:complexType name="SimpleTextType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
    </xsd:choice>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- A link contains the reference and an optional label.                 -->
  <!-- ==================================================================== -->
  <xsd:complexType name="LinkType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="c" type="SubLinkType"/>
      <xsd:element name="context" type="ContextType"/>
      <xsd:element name="condition" type="SubLinkType"/>
      <xsd:element name="image" type="ImageType"/>
      <xsd:element name="footnote" type="FootnoteType"/>
      <xsd:element name="endnote" type="FootnoteType"/>
      <xsd:element name="anchor" type="AnchorType"/>
      <xsd:element name="endAnchor" type="EndAnchorType"/> <!-- Deprecated in Typefi Publish 6 -->
      <xsd:element name="xref" type="XRefType"/>
      <xsd:element name="ref" type="RefType"/>
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="style" type="SubLinkType"/>
      <xsd:element name="indexterm" type="IndexTermType"/>
      <xsd:element name="char" type="CharType"/>
    </xsd:choice>
    <xsd:attribute name="ref" type="xsd:string" use="required"/>
    <xsd:attribute name="label" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- A doclink contains the reference and an optional label.              -->
  <!-- ==================================================================== -->
  <xsd:complexType name="DocLinkType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="c" type="SubLinkType"/>
      <xsd:element name="context" type="ContextType"/>
      <xsd:element name="condition" type="SubLinkType"/>
      <xsd:element name="image" type="ImageType"/>
      <xsd:element name="footnote" type="FootnoteType"/>
      <xsd:element name="endnote" type="FootnoteType"/>
      <xsd:element name="anchor" type="AnchorType"/>
      <xsd:element name="endAnchor" type="EndAnchorType"/> <!-- Deprecated in Typefi Publish 6 -->
      <xsd:element name="xref" type="XRefType"/>
      <xsd:element name="ref" type="RefType"/>
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="style" type="SubLinkType"/>
      <xsd:element name="indexterm" type="IndexTermType"/>
      <xsd:element name="char" type="CharType"/>
    </xsd:choice>
    <xsd:attribute name="refType" type="RefTypeEnumeration" use="required"/>
    <xsd:attribute name="refId" type="xsd:string" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- The sub link type is a helper construction to avoid the use of       -->
  <!-- tps:link inside tps:c and tps:condition if thes occur in the context -->
  <!-- of a tps:link. The attribute id is needed for conditions.            -->
  <!-- ==================================================================== -->
  <xsd:complexType name="SubLinkType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="c" type="SubLinkType"/>
      <xsd:element name="context" type="ContextType"/>
      <xsd:element name="condition" type="SubLinkType"/>
      <xsd:element name="image" type="ImageType"/>
      <xsd:element name="footnote" type="FootnoteType"/>
      <xsd:element name="endnote" type="FootnoteType"/>
      <xsd:element name="anchor" type="AnchorType"/>
      <xsd:element name="endAnchor" type="EndAnchorType"/> <!-- Deprecated in Typefi Publish 6 -->
      <xsd:element name="xref" type="XRefType"/>
      <xsd:element name="ref" type="RefType"/>
      <xsd:element name="t" type="WhitespaceType"/>
      <xsd:element name="s" type="WhitespaceType"/>
      <xsd:element name="l" type="WhitespaceType"/>
      <xsd:element name="liRef" type="ListItemReferenceType"/>
      <xsd:element name="style" type="SubLinkType"/>
      <xsd:element name="indexterm" type="IndexTermType"/>
      <xsd:element name="char" type="CharType"/>
    </xsd:choice>
    <xsd:attribute name="type" type="xsd:string" use="optional"/>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- An index term.                                                       -->
  <!-- Similar to http://www.docbook.org/tdg/en/html/indexterm.html         -->
  <!-- ==================================================================== -->
  <xsd:complexType name="IndexTermType">
    <xsd:sequence>
      <xsd:element name="primary" minOccurs="0" maxOccurs="1" type="IndexTopicType"/>
      <xsd:element name="secondary" minOccurs="0" maxOccurs="1" type="IndexTopicType"/>
      <xsd:element name="tertiary" minOccurs="0" maxOccurs="1" type="IndexTopicType"/>
      <xsd:element name="quaternary" minOccurs="0" maxOccurs="1" type="IndexTopicType"/>
      <xsd:choice minOccurs="0" maxOccurs="1">
        <xsd:element name="see" type="IndexReferenceType"/>
        <xsd:element name="seealso" type="IndexReferenceType"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="class" type="IndexTermClassEnumeration" use="optional"/>
    <xsd:attribute name="id" type="xsd:string" use="optional"/>
    <xsd:attribute name="startref" type="xsd:string" use="optional"/>
    <xsd:attribute name="pageNumberStyle" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- An index topic.                                                      -->
  <!-- ==================================================================== -->
  <xsd:complexType name="IndexTopicType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="c" type="IndexTopicCharStyleType"/>
      <xsd:element name="s" type="WhitespaceType"/>
    </xsd:choice>
    <xsd:attribute name="sortas" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- A char style within an index topic.                                  -->
  <!-- ==================================================================== -->
  <xsd:complexType name="IndexTopicCharStyleType" mixed="true">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="s" type="WhitespaceType"/>
    </xsd:choice>
    <xsd:attribute name="type" type="xsd:string" use="required"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- An index reference.                                                  -->
  <!-- ==================================================================== -->
  <xsd:complexType name="IndexReferenceType" mixed="true"/>

  <!-- ==================================================================== -->
  <!-- Valid values for the class attribute of indexterm entries.           -->
  <!-- This is used to denote the indexterm is marking a range of content.  -->
  <!-- There are two supported ways to mark a range.                        -->
  <!--                                                                      -->
  <!-- Example usage for the Microsoft Word style range:                    -->
  <!--                                                                      -->
  <!--   <indexterm class="bookmark" id="Arizona">                          -->
  <!--     <primary>Arizona</primary>                                       -->
  <!--   </indexterm>                                                       -->
  <!--   ...                                                                -->
  <!--   <anchor name="Arizona"/>                                           -->
  <!--                                                                      -->
  <!-- Example usage for the DocBook style range:                           -->
  <!--                                                                      -->
  <!--   <indexterm class="startofrange" id="Arizona"/>                     -->
  <!--     <primary>Arizona</primary>                                       -->
  <!--   </indexterm>                                                       -->
  <!--   ...                                                                -->
  <!--   <indexterm class="endofrange" startref="Arizona"/>                 -->
  <!-- ==================================================================== -->
  <xsd:simpleType name="IndexTermClassEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="bookmark"/>
      <xsd:enumeration value="startofrange"/>
      <xsd:enumeration value="endofrange"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- ==================================================================== -->
  <!-- A section consists of (optional) fieldSets                           -->
  <!-- followed by a possibly large amount of mixed section content.        -->
  <!-- ==================================================================== -->
  <xsd:complexType name="SectionType">
    <xsd:sequence>
      <xsd:element name="fieldSet" minOccurs="0" maxOccurs="unbounded" type="FieldSetType"/>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:group ref="ContentGroup"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" use="required"/>
    <xsd:attribute name="type" type="xsd:string" use="required"/>
    <xsd:attribute name="condition" type="xsd:string" use="optional"/>
    <xsd:attribute name="strictSpace" type="xsd:boolean" use="optional"/> <!-- Deprecated in Typefi Publish 6 -->
    <xsd:attribute name="whiteSpaceMode" type="WhiteSpaceModeEnumeration" use="optional"/>
    <xsd:attribute ref="xml:lang" use="optional"/>
  </xsd:complexType>

  <!-- ==================================================================== -->
  <!-- A content.xml document consists of a top-level 'content' element     -->
  <!-- containing a collection of sections and conditions.                  -->
  <!-- ==================================================================== -->
  <xsd:element name="content">
    <xsd:complexType>
      <xsd:sequence>
        <!-- Allow to pass project level fields at the beginning of the     -->
        <!-- content. Section level fields would be interpreted as document -->
        <!-- level fields if they would be used here.                       -->
        <xsd:element name="fieldSet" minOccurs="0" maxOccurs="unbounded" type="FieldSetType"/>
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
          <xsd:element name="section" type="SectionType"/>
        </xsd:choice>
      </xsd:sequence>
      <!-- type is not currently used for the content element. It is always
           set to 'book' in current TPS. -->
      <xsd:attribute name="type" type="xsd:string" use="optional"/>
      <xsd:attribute name="schemaVersion" use="optional" type="xsd:string"/>
      <xsd:attribute name="strictSpace" type="xsd:boolean" use="optional"/> <!-- Deprecated in Typefi Publish 6 -->
      <xsd:attribute name="whiteSpaceMode" type="WhiteSpaceModeEnumeration" use="optional"/>
      <xsd:attribute ref="xml:lang" use="optional"/>
    </xsd:complexType>
  </xsd:element>

  <!-- ==================================================================== -->
  <!-- A content.xml document can also start with a top-level 'section'     -->
  <!-- element                                                              -->
  <!-- ==================================================================== -->
  <xsd:element name="section" type="SectionType"/>

</xsd:schema>
