<?xml version="1.0" encoding="utf-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <include href="historical-classes.ent.rng"/>
  <include href="bookcustom-classes.ent.rng"/>
  <include href="default-classes.ent.rng"/>
  <include href="historical-mixes.ent.rng"/>
  <include href="bookcustom-mixes.ent.rng"/>
  <include href="default-mixes.ent.rng"/>
  <include href="historical-models.ent.rng"/>
  <include href="bookcustom-models.ent.rng"/>
  <include href="common.ent.rng"/>
  <include href="articlemeta.ent.rng"/>
  <include href="backmatter.ent.rng"/>
  <include href="display.ent.rng"/>
  <include href="format.ent.rng"/>
  <include href="link.ent.rng"/>
  <include href="list.ent.rng"/>
  <include href="math.ent.rng"/>
  <include href="nlmcitation.ent.rng"/>
  <include href="para.ent.rng"/>
  <include href="phrase.ent.rng"/>
  <include href="references.ent.rng"/>
  <include href="section.ent.rng"/>
  <include href="chars.ent.rng"/>
  <include href="mathmlsetup.ent.rng"/>
  <include href="XHTMLtablesetup.ent.rng"/>
  <define name="dtd-version">
    <optional>
      <attribute name="dtd-version" a:defaultValue="2.3">
        <value type="string" datatypeLibrary="">2.3</value>
      </attribute>
    </optional>
  </define>
  <define name="book-identifier-atts">
    <optional>
      <attribute name="book-id">
        <data type="ID"/>
      </attribute>
    </optional>
  </define>
  <define name="book-atts">
    <ref name="book-identifier-atts"/>
    <ref name="dtd-version"/>
    <optional>
      <attribute name="xml:lang" a:defaultValue="EN">
        <data type="NMTOKEN"/>
      </attribute>
    </optional>
    <ref name="XLINK.xmlns.attrib"/>
    <ref name="MATHML.xmlns.attrib"/>
    <ref name="Schema.xmlns.attrib"/>
  </define>
  <include href="annotation.ent.rng"/>
  <include href="bookmeta.ent.rng"/>
  <include href="bookpart.ent.rng"/>
  <include href="bookimagemap.ent.rng"/>
  <include href="bookmultilink.ent.rng"/>
  <include href="bookrelated-object.ent.rng"/>
  <include href="historicalmeta.ent.rng"/>
  <define name="book-model">
    <ref name="book-meta"/>
    <optional>
      <ref name="digital-edition-meta"/>
    </optional>
    <optional>
      <ref name="book-front"/>
    </optional>
    <ref name="body"/>
    <optional>
      <ref name="back"/>
    </optional>
  </define>
  <define name="book">
    <element name="book">
      <ref name="book-attlist"/>
      <ref name="book-model"/>
    </element>
  </define>
  <define name="book-attlist" combine="interleave">
    <ref name="book-atts"/>
  </define>
  <define name="book-meta">
    <element name="book-meta">
      <ref name="book-meta-attlist"/>
      <ref name="book-meta-model"/>
    </element>
  </define>
  <define name="book-meta-attlist" combine="interleave">
    <empty/>
  </define>
  <define name="book-front-model">
    <zeroOrMore>
      <ref name="title"/>
    </zeroOrMore>
    <zeroOrMore>
      <ref name="doc-front-matter-mix"/>
    </zeroOrMore>
  </define>
  <define name="book-front">
    <element name="book-front">
      <ref name="book-front-attlist"/>
      <ref name="book-front-model"/>
    </element>
  </define>
  <define name="book-front-attlist" combine="interleave">
    <empty/>
  </define>
  <define name="body">
    <element name="body">
      <ref name="body-attlist"/>
      <ref name="body-model"/>
    </element>
  </define>
  <define name="body-attlist" combine="interleave">
    <empty/>
  </define>
  <define name="back-model">
    <zeroOrMore>
      <ref name="title"/>
    </zeroOrMore>
    <zeroOrMore>
      <choice>
        <ref name="doc-back-matter-mix"/>
        <ref name="just-table.class"/>
      </choice>
    </zeroOrMore>
  </define>
  <define name="back">
    <element name="back">
      <ref name="back-attlist"/>
      <ref name="back-model"/>
    </element>
  </define>
  <define name="back-attlist" combine="interleave">
    <empty/>
  </define>
  <start>
    <choice>
      <ref name="floats-wrap"/>
      <ref name="article-meta"/>
      <ref name="x"/>
      <ref name="book"/>
    </choice>
  </start>
  <define name="any">
    <zeroOrMore>
      <choice>
        <element>
          <anyName/>
          <ref name="any"/>
        </element>
        <text/>
      </choice>
    </zeroOrMore>
  </define>
</grammar>