<?xml version="1.0" encoding="UTF-8"?>
<!-- These Namespaces to be confirmed. "data:,Layout" would be another possibility -->
<!-- XMP -->
<!-- XHTML Namespace, not currently used -->
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:Table="http://iso.org/pdf/ssn/Table" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:pdf1="http://iso.org/pdf/ssn" xmlns:pdfuaid="http://www.aiim.org/pdfua/ns/id/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:Artifact="http://iso.org/pdf/ssn/Artifact" xmlns:pdf2="http://iso.org/pdf2/ssn" xmlns:Layout="http://iso.org/pdf/ssn/Layout" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:x="adobe:ns:meta/" xmlns:List="http://iso.org/pdf/ssn/List" xmlns:PrintField="http://iso.org/pdf/ssn/PrintField" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <!-- slightly modified MathML-Core schema. -->
  <include href="latex-mathml.rng">
    <start combine="choice">
      <notAllowed/>
    </start>
  </include>
  <!-- Extensions -->
  <define name="mo.attributes" combine="interleave">
    <a:documentation>MathML Namespace (temp actualtext moved to content element in new code)</a:documentation>
    <optional>
      <attribute name="actualtext"/>
    </optional>
  </define>
  <define name="mpadded-length-percentage" combine="choice">
    <data type="string">
      <param name="pattern">\s*(([\-+]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s*</param>
    </data>
  </define>
  <define name="mathse">
    <ref name="math"/>
  </define>
  <!-- Attributes When Rolemaps are needed for PDF2  elements used in PDF1 -->
  <define name="pdf1rolemap-Any">
    <optional>
      <notAllowed/>
    </optional>
  </define>
  <define name="pdf1rolemap-P">
    <optional>
      <notAllowed/>
    </optional>
  </define>
  <define name="pdf1rolemap-Span">
    <optional>
      <notAllowed/>
    </optional>
  </define>
  <define name="pdf1rolemap-Note">
    <optional>
      <notAllowed/>
    </optional>
  </define>
  <!-- UA-2 Single Document element root. -->
  <start>
    <ref name="PDF"/>
  </start>
  <define name="PDF">
    <element>
      <name ns="">PDF</name>
      <ref name="StructTreeRoot"/>
      <optional>
        <ref name="XMP"/>
      </optional>
    </element>
  </define>
  <define name="StructTreeRoot">
    <element>
      <name ns="">StructTreeRoot</name>
      <choice>
        <ref name="Document"/>
        <ref name="DocumentFragment"/>
      </choice>
    </element>
  </define>
  <define name="AssociatedFile">
    <element>
      <name ns="">AssociatedFile</name>
      <attribute name="name"/>
      <choice>
        <text/>
        <ref name="math"/>
      </choice>
    </element>
  </define>
  <define name="AssociatedFilemath">
    <element>
      <name ns="">AssociatedFile</name>
      <attribute name="name"/>
      <ref name="math"/>
    </element>
  </define>
  <define name="AssociatedFiletext">
    <element>
      <name ns="">AssociatedFile</name>
      <attribute name="name"/>
      <text/>
    </element>
  </define>
  <define name="formula-requirements">
    <choice>
      <attribute name="actualtext"/>
      <attribute name="alt"/>
      <group>
        <zeroOrMore>
          <ref name="Lbl"/>
        </zeroOrMore>
        <ref name="mathse"/>
      </group>
      <ref name="AssociatedFilemath"/>
    </choice>
  </define>
  <define name="pdfuaid_part">
    <a:documentation>PDF/UA-2</a:documentation>
    <element name="pdfuaid:part">
      <value>2</value>
    </element>
  </define>
  <!-- XMP data -->
  <define name="anyelem">
    <a:documentation>share with pdf1.7 version from here to end</a:documentation>
    <element>
      <anyName/>
      <zeroOrMore>
        <choice>
          <zeroOrMore>
            <attribute>
              <anyName/>
            </attribute>
          </zeroOrMore>
          <text/>
          <ref name="anyelem"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="XMP">
    <element>
      <name ns="">XMP</name>
      <interleave>
        <ref name="x_xmpmeta"/>
        <zeroOrMore>
          <ref name="anyelem"/>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="x_xmpmeta">
    <element name="x:xmpmeta">
      <zeroOrMore>
        <attribute>
          <anyName/>
        </attribute>
      </zeroOrMore>
      <interleave>
        <ref name="rdf_RDF"/>
        <zeroOrMore>
          <ref name="anyelem"/>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="rdf_RDF">
    <element name="rdf:RDF">
      <zeroOrMore>
        <attribute>
          <anyName/>
        </attribute>
      </zeroOrMore>
      <interleave>
        <ref name="rdf_Description"/>
        <zeroOrMore>
          <ref name="anyelem"/>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="rdf_Description">
    <element name="rdf:Description">
      <zeroOrMore>
        <attribute>
          <anyName/>
        </attribute>
      </zeroOrMore>
      <interleave>
        <ref name="pdfuaid_part"/>
        <zeroOrMore>
          <ref name="anyelem"/>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <!-- end of XMP -->
  <define name="textorHTML" combine="interleave">
    <zeroOrMore>
      <choice>
        <ref name="Link"/>
        <ref name="Reference"/>
        <ref name="Strong"/>
        <ref name="Code"/>
        <ref name="Em"/>
        <ref name="Lbl"/>
        <ref name="Span"/>
        <ref name="mathse"/>
        <ref name="Quote"/>
        <ref name="RB"/>
        <ref name="Annot"/>
        <ref name="Figure"/>
        <ref name="Form"/>
      </choice>
    </zeroOrMore>
  </define>
  <define name="MathMLPGlobalAttributes" combine="interleave">
    <ref name="showtags-attributes"/>
  </define>
  <define name="pdf2-attributes">
    <a:documentation>PDF structure Namespace</a:documentation>
    <ref name="structure-properties"/>
    <ref name="layout-attributes"/>
    <ref name="otherns-attributes"/>
    <ref name="showtags-attributes"/>
  </define>
  <define name="showtags-attributes">
    <optional>
      <attribute name="af"/>
    </optional>
    <optional>
      <attribute name="rolemapped-from"/>
    </optional>
    <optional>
      <attribute name="referenced-as"/>
    </optional>
    <zeroOrMore>
      <ref name="AssociatedFile"/>
    </zeroOrMore>
  </define>
  <!--
    Standard Attribute Owner Namespaces (such as CSS3, HTML-5.00) apart from the ones listed here
    and also vendor-specific namespaced attributes are allowed with any name/value.
  -->
  <define name="otherns-attributes">
    <zeroOrMore>
      <attribute>
        <anyName>
          <except>
            <nsName ns=""/>
            <nsName ns="http://iso.org/pdf/ssn/Layout"/>
            <nsName ns="http://iso.org/pdf/ssn/PrintField"/>
            <nsName ns="http://iso.org/pdf/ssn/Table"/>
            <nsName ns="http://iso.org/pdf/ssn/List"/>
            <nsName ns="http://iso.org/pdf/ssn/Artifact"/>
          </except>
        </anyName>
      </attribute>
    </zeroOrMore>
  </define>
  <!-- Properties are modelled as attributes in no namespace -->
  <define name="structure-properties">
    <optional>
      <attribute name="lang"/>
    </optional>
    <optional>
      <!-- Lang -->
      <attribute name="expansion"/>
    </optional>
    <optional>
      <!-- E -->
      <attribute name="actualtext"/>
    </optional>
    <optional>
      <!-- ActualText -->
      <attribute name="alt"/>
    </optional>
    <optional>
      <!-- Alt -->
      <attribute name="title"/>
    </optional>
    <optional>
      <!-- T -->
      <attribute name="id"/>
    </optional>
    <optional>
      <!-- ID -->
      <attribute name="phoneme"/>
    </optional>
    <optional>
      <!-- Phoneme -->
      <attribute name="phonetic-alphabet"/>
    </optional>
    <optional>
      <!-- PhoneticAlphabet -->
      <attribute name="revision"/>
    </optional>
  </define>
  <!-- R -->
  <define name="layout-attributes">
    <optional>
      <!--
        Only validate Layout attributes with Owner Layout
        PDF 2 states Attributes in this category shall be defined in attribute objects whose O
        (owner) entry has the value Layout or whose owner is any other owner excluding List, Table,
        PrintField and Artifact.
        
      -->
      <attribute name="Layout:Placement">
        <choice>
          <value>Block</value>
          <value>Inline</value>
          <value>Before</value>
          <value>Start</value>
          <value>End</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="Layout:WritingMode">
        <choice>
          <value>LrTb</value>
          <value>RlTb</value>
          <value>TbRl</value>
          <value>TbLr</value>
          <value>LrBt</value>
          <value>RlBt</value>
          <value>BtRl</value>
          <value>BtLr</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="Layout:BackgroundColor"/>
    </optional>
    <optional>
      <attribute name="Layout:BorderColor"/>
    </optional>
    <optional>
      <attribute name="Layout:BorderStyle"/>
    </optional>
    <optional>
      <attribute name="Layout:BorderThickness"/>
    </optional>
    <optional>
      <attribute name="Layout:Color"/>
    </optional>
    <optional>
      <attribute name="Layout:Padding"/>
    </optional>
    <optional>
      <!---->
      <attribute name="Layout:SpaceBefore"/>
    </optional>
    <optional>
      <attribute name="Layout:SpaceAfter"/>
    </optional>
    <optional>
      <attribute name="Layout:StartIndent"/>
    </optional>
    <optional>
      <attribute name="Layout:EndIndent"/>
    </optional>
    <optional>
      <!---->
      <attribute name="Layout:TextIndent"/>
    </optional>
    <optional>
      <attribute name="Layout:TextAlign">
        <choice>
          <value>Start</value>
          <value>Center</value>
          <value>End</value>
          <value>Justify</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="Layout:BBox"/>
    </optional>
    <optional>
      <!--
         see apryse PDFA example
        
      -->
      <attribute name="Layout:LineHeight"/>
    </optional>
    <optional>
      <attribute name="Layout:BaselineShift"/>
    </optional>
    <optional>
      <attribute name="Layout:TextDecorationType">
        <choice>
          <value/>
          <value>Underline</value>
          <value>Overline</value>
          <value>LineThrough</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="Layout:TextPosition">
        <choice>
          <value>Sup</value>
          <value>Sub</value>
          <value>Normal</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="Layout:TextDecorationColor"/>
    </optional>
    <optional>
      <attribute name="Layout:TextDecorationThickness"/>
    </optional>
    <optional>
      <!---->
      <attribute name="Layout:ColumnCount"/>
    </optional>
    <optional>
      <attribute name="Layout:ColumnWidths"/>
    </optional>
    <optional>
      <attribute name="Layout:ColumnGap"/>
    </optional>
    <optional>
      <!---->
      <attribute name="Layout:GlyphOrientationVertical"/>
    </optional>
  </define>
  <define name="list-attributes">
    <optional>
      <attribute name="List:ListNumbering">
        <choice>
          <value/>
          <value>None</value>
          <value>Unordered</value>
          <value>Description</value>
          <value>Disc</value>
          <value>Circle</value>
          <value>Square</value>
          <value>Ordered</value>
          <value>Decimal</value>
          <value>UpperRoman</value>
          <value>LowerRoman</value>
          <value>UpperAlpha</value>
          <value>LowerAlpha</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="List:ContinuedList"/>
    </optional>
    <optional>
      <attribute name="List:ContinuedFrom"/>
    </optional>
  </define>
  <define name="printfield-attributes">
    <optional>
      <attribute name="PrintField:Role"/>
    </optional>
    <optional>
      <attribute name="PrintField:Checked"/>
    </optional>
    <optional>
      <attribute name="PrintField:checked"/>
    </optional>
    <optional>
      <attribute name="PrintField:Desc"/>
    </optional>
  </define>
  <define name="table-attributes">
    <optional>
      <attribute name="Table:RowSpan"/>
    </optional>
    <optional>
      <attribute name="Table:ColSpan"/>
    </optional>
    <optional>
      <attribute name="Table:Headers"/>
    </optional>
    <optional>
      <attribute name="Table:Summary"/>
    </optional>
  </define>
  <define name="artifact-attributes">
    <optional>
      <attribute name="Artifact:Type"/>
    </optional>
    <optional>
      <attribute name="Artifact:BBox"/>
    </optional>
    <optional>
      <attribute name="Artifact:SubType"/>
    </optional>
  </define>
  <define name="document.n">
    <choice>
      <ref name="Document"/>
      <ref name="DocumentFragment"/>
      <ref name="Part"/>
      <ref name="Art"/>
      <ref name="Div"/>
      <ref name="Sect"/>
      <ref name="TOC"/>
      <ref name="Aside"/>
      <ref name="BlockQuote"/>
      <ref name="NonStruct"/>
      <ref name="Private"/>
      <ref name="P"/>
      <ref name="Note"/>
      <ref name="Code"/>
      <ref name="Hn"/>
      <ref name="Title"/>
      <ref name="Link"/>
      <ref name="Annot"/>
      <ref name="Form"/>
      <ref name="FENote"/>
      <ref name="Index"/>
      <ref name="L"/>
      <ref name="Table"/>
      <ref name="Figure"/>
      <ref name="Formula"/>
      <ref name="Artifact"/>
    </choice>
  </define>
  <define name="document.1">
    <optional>
      <ref name="H"/>
    </optional>
  </define>
  <define name="Hn">
    <choice>
      <ref name="H1"/>
      <ref name="H2"/>
      <ref name="H3"/>
      <ref name="H4"/>
      <ref name="H5"/>
      <ref name="H6"/>
      <ref name="H7"/>
    </choice>
  </define>
  <define name="Document">
    <a:documentation>Document Level</a:documentation>
    <element name="pdf2:Document">
      <ref name="pdf2-attributes"/>
      <interleave>
        <ref name="document.1"/>
        <zeroOrMore>
          <ref name="document.n"/>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="DocumentFragment">
    <element name="pdf2:DocumentFragment">
      <ref name="pdf1rolemap-Any"/>
      <ref name="pdf2-attributes"/>
      <interleave>
        <ref name="document.1"/>
        <zeroOrMore>
          <ref name="document.n"/>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="Part">
    <a:documentation>Grouping</a:documentation>
    <element name="pdf2:Part">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <ref name="document.n"/>
          <ref name="H"/>
          <ref name="TOCI"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Reference"/>
          <ref name="BibEntry"/>
          <ref name="Caption"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Sect">
    <element name="pdf2:Sect">
      <ref name="pdf2-attributes"/>
      <interleave>
        <optional>
          <ref name="H"/>
        </optional>
        <zeroOrMore>
          <choice>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="TOC"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="Title"/>
            <ref name="Lbl"/>
            <ref name="Link"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="Table"/>
            <ref name="Caption"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="Aside">
    <element name="pdf2:Aside">
      <ref name="pdf1rolemap-Any"/>
      <ref name="pdf2-attributes"/>
      <interleave>
        <optional>
          <ref name="H"/>
        </optional>
        <optional>
          <ref name="Caption"/>
        </optional>
        <zeroOrMore>
          <choice>
            <text/>
            <ref name="Document"/>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="TOC"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="Lbl"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="NonStruct">
    <element name="pdf2:NonStruct">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="Document"/>
          <ref name="DocumentFragment"/>
          <ref name="Part"/>
          <ref name="Art"/>
          <ref name="Div"/>
          <ref name="Sect"/>
          <ref name="TOC"/>
          <ref name="TOCI"/>
          <ref name="Aside"/>
          <ref name="BlockQuote"/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="P"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Hn"/>
          <ref name="H"/>
          <ref name="Title"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="RB"/>
          <ref name="RT"/>
          <ref name="RP"/>
          <ref name="Warichu"/>
          <ref name="WT"/>
          <ref name="WP"/>
          <ref name="FENote"/>
          <ref name="Index"/>
          <ref name="L"/>
          <ref name="LI"/>
          <ref name="LBody"/>
          <ref name="BibEntry"/>
          <ref name="Table"/>
          <ref name="TR"/>
          <ref name="TH"/>
          <ref name="TD"/>
          <ref name="THead"/>
          <ref name="TBody"/>
          <ref name="TFoot"/>
          <ref name="Caption"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Div">
    <element name="pdf2:Div">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <ref name="Document"/>
          <ref name="DocumentFragment"/>
          <ref name="Part"/>
          <ref name="Art"/>
          <ref name="Div"/>
          <ref name="Sect"/>
          <ref name="TOC"/>
          <ref name="TOCI"/>
          <ref name="Aside"/>
          <ref name="BlockQuote"/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="P"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Hn"/>
          <ref name="H"/>
          <ref name="Title"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="RB"/>
          <ref name="RT"/>
          <ref name="RP"/>
          <ref name="Warichu"/>
          <ref name="WT"/>
          <ref name="WP"/>
          <ref name="FENote"/>
          <ref name="Index"/>
          <ref name="L"/>
          <ref name="LI"/>
          <ref name="LBody"/>
          <ref name="BibEntry"/>
          <ref name="Table"/>
          <ref name="TR"/>
          <ref name="TH"/>
          <ref name="TD"/>
          <ref name="THead"/>
          <ref name="TBody"/>
          <ref name="TFoot"/>
          <ref name="Caption"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="P">
    <a:documentation>Block</a:documentation>
    <element name="pdf2:P">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="L"/>
          <ref name="BibEntry"/>
          <ref name="Table"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="sechead.content">
    <ref name="pdf2-attributes"/>
    <interleave>
      <optional>
        <ref name="Art"/>
      </optional>
      <optional>
        <ref name="Sect"/>
      </optional>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="BibEntry"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </interleave>
  </define>
  <define name="H1">
    <element name="pdf2:H1">
      <ref name="sechead.content"/>
    </element>
  </define>
  <define name="H2">
    <element name="pdf2:H2">
      <ref name="sechead.content"/>
    </element>
  </define>
  <define name="H3">
    <element name="pdf2:H3">
      <ref name="sechead.content"/>
    </element>
  </define>
  <define name="H4">
    <element name="pdf2:H4">
      <ref name="sechead.content"/>
    </element>
  </define>
  <define name="H5">
    <element name="pdf2:H5">
      <ref name="sechead.content"/>
    </element>
  </define>
  <define name="H6">
    <element name="pdf2:H6">
      <ref name="sechead.content"/>
    </element>
  </define>
  <define name="H7">
    <element name="pdf2:H7">
      <ref name="pdf1rolemap-Any"/>
      <ref name="sechead.content"/>
    </element>
  </define>
  <define name="H">
    <element name="pdf2:H">
      <ref name="sechead.content"/>
    </element>
  </define>
  <define name="Title">
    <element name="pdf2:Title">
      <ref name="pdf1rolemap-P"/>
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="Part"/>
          <ref name="Div"/>
          <ref name="Aside"/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="P"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="L"/>
          <ref name="BibEntry"/>
          <ref name="Table"/>
          <ref name="Caption"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="fenote-attributes">
    <optional>
      <notAllowed/>
    </optional>
  </define>
  <define name="FENote">
    <element name="pdf2:FENote">
      <ref name="pdf1rolemap-Note"/>
      <ref name="pdf2-attributes"/>
      <ref name="fenote-attributes"/>
      <choice>
        <zeroOrMore>
          <choice>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="L"/>
            <ref name="Table"/>
            <ref name="Caption"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
        <zeroOrMore>
          <!-- Grouping -->
          <choice>
            <text/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="L"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </choice>
      <!-- Block -->
    </element>
  </define>
  <define name="BibEntry">
    <element name="pdf2:BibEntry">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="Part"/>
          <ref name="Div"/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="P"/>
          <ref name="Note"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="FENote"/>
          <ref name="Figure"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Sub">
    <a:documentation>Sub Block</a:documentation>
    <element name="pdf2:Sub">
      <ref name="pdf1rolemap-Any"/>
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="L"/>
          <ref name="BibEntry"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Lbl">
    <a:documentation>Inline</a:documentation>
    <element name="pdf2:Lbl">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Sub"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="BibEntry"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
          <ref name="mathse"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Em">
    <element name="pdf2:Em">
      <ref name="pdf1rolemap-Span"/>
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="BibEntry"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Strong">
    <element name="pdf2:Strong">
      <ref name="pdf1rolemap-Span"/>
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="BibEntry"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Span">
    <element name="pdf2:Span">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="BibEntry"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Link">
    <element name="pdf2:Link">
      <ref name="pdf2-attributes"/>
      <choice>
        <zeroOrMore>
          <choice>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="H"/>
            <ref name="Title"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="L"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="Caption"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
            <ref name="mathse"/>
          </choice>
        </zeroOrMore>
        <zeroOrMore>
          <!-- Grouping -->
          <choice>
            <text/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
            <ref name="mathse"/>
          </choice>
        </zeroOrMore>
      </choice>
      <!---->
    </element>
  </define>
  <define name="Annot">
    <element name="pdf2:Annot">
      <ref name="pdf2-attributes"/>
      <choice>
        <zeroOrMore>
          <choice>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="H"/>
            <ref name="Title"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="L"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="Caption"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
        <zeroOrMore>
          <!-- Grouping -->
          <choice>
            <text/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Link"/>
            <ref name="Annot"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="BibEntry"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </choice>
      <!---->
    </element>
  </define>
  <define name="Form">
    <element name="pdf2:Form">
      <ref name="pdf2-attributes"/>
      <optional>
        <attribute name="Layout:Width"/>
      </optional>
      <optional>
        <attribute name="Layout:Height"/>
      </optional>
      <ref name="printfield-attributes"/>
      <choice>
        <zeroOrMore>
          <interleave>
            <optional>
              <ref name="Caption"/>
            </optional>
            <choice>
              <ref name="Part"/>
              <ref name="Div"/>
              <ref name="NonStruct"/>
              <ref name="Private"/>
              <ref name="Note"/>
              <ref name="Code"/>
              <ref name="Lbl"/>
              <ref name="Reference"/>
              <ref name="FENote"/>
              <ref name="L"/>
              <ref name="BibEntry"/>
              <ref name="Table"/>
              <ref name="Figure"/>
              <ref name="Formula"/>
              <ref name="Artifact"/>
            </choice>
          </interleave>
        </zeroOrMore>
        <!-- Grouping -->
        <interleave>
          <optional>
            <ref name="Caption"/>
          </optional>
          <zeroOrMore>
            <choice>
              <text/>
              <ref name="Div"/>
              <ref name="NonStruct"/>
              <ref name="Private"/>
              <ref name="Note"/>
              <ref name="Lbl"/>
              <ref name="FENote"/>
              <ref name="BibEntry"/>
              <ref name="Artifact"/>
            </choice>
          </zeroOrMore>
        </interleave>
      </choice>
      <!-- Block -->
    </element>
  </define>
  <!-- [a] == Table 369 ISO 32000-2 -->
  <define name="Ruby">
    <a:documentation>Ruby</a:documentation>
    <element name="pdf2:Ruby">
      <ref name="pdf2-attributes"/>
      <optional>
        <attribute name="Layout:RubyAlign">
          <choice>
            <value>Start</value>
            <value>Center</value>
            <value>End</value>
            <value>Justify</value>
            <value>Distribute</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="Layout:RubyPosition">
          <choice>
            <value>Before</value>
            <value>After</value>
            <value>Warichu</value>
            <value>Inline</value>
          </choice>
        </attribute>
      </optional>
      <interleave>
        <zeroOrMore>
          <choice>
            <text/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
          </choice>
        </zeroOrMore>
        <group>
          <ref name="RB"/>
          <choice>
            <ref name="RT"/>
            <group>
              <ref name="RB"/>
              <ref name="RT"/>
              <ref name="RP"/>
            </group>
          </choice>
        </group>
      </interleave>
    </element>
  </define>
  <define name="RB">
    <element name="pdf2:RB">
      <ref name="pdf2-attributes"/>
      <optional>
        <attribute name="Layout:RubyAlign">
          <choice>
            <value>Start</value>
            <value>Center</value>
            <value>End</value>
            <value>Justify</value>
            <value>Distribute</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="Layout:RubyPosition">
          <choice>
            <value>Before</value>
            <value>After</value>
            <value>Warichu</value>
            <value>Inline</value>
          </choice>
        </attribute>
      </optional>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Sub"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Link"/>
          <ref name="Form"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="RT">
    <element name="pdf2:RT">
      <ref name="pdf2-attributes"/>
      <optional>
        <attribute name="Layout:RubyAlign">
          <choice>
            <value>Start</value>
            <value>Center</value>
            <value>End</value>
            <value>Justify</value>
            <value>Distribute</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="Layout:RubyPosition"/>
      </optional>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Sub"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Link"/>
          <ref name="Form"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="RP">
    <element name="pdf2:RP">
      <ref name="pdf2-attributes"/>
      <optional>
        <attribute name="Layout:RubyAlign"/>
      </optional>
      <optional>
        <attribute name="Layout:RubyPosition"/>
      </optional>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Sub"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Link"/>
          <ref name="Form"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <!-- [b] = Table 369 ISO 32000-2 -->
  <define name="Warichu">
    <element name="pdf2:Warichu">
      <ref name="pdf2-attributes"/>
      <interleave>
        <zeroOrMore>
          <choice>
            <text/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
          </choice>
        </zeroOrMore>
        <group>
          <ref name="WP"/>
          <ref name="WT"/>
          <ref name="WP"/>
        </group>
      </interleave>
    </element>
  </define>
  <define name="WT">
    <element name="pdf2:WT">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Sub"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="WP">
    <element name="pdf2:WP">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Sub"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <!--
    Caption here is 0..1  matching 32005
    Table 370 ISO 32000-2 says first or last which would be
    (Caption, (NonStruct|Private|L|LI|Artifact)*) | ((NonStruct|Private|L|LI|Artifact)*, Caption?)
  -->
  <define name="L">
    <a:documentation>Lists</a:documentation>
    <element name="pdf2:L">
      <ref name="pdf2-attributes"/>
      <ref name="list-attributes"/>
      <interleave>
        <optional>
          <ref name="Caption"/>
        </optional>
        <zeroOrMore>
          <choice>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="L"/>
            <ref name="LI"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="LI">
    <element name="pdf2:LI">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="Div"/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Lbl"/>
          <ref name="LBody"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="LBody">
    <element name="pdf2:LBody">
      <ref name="pdf2-attributes"/>
      <interleave>
        <optional>
          <ref name="H"/>
        </optional>
        <optional>
          <ref name="Caption"/>
        </optional>
        <zeroOrMore>
          <choice>
            <text/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="Sub"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="Index">
    <element name="pdf2:Index">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <ref name="Part"/>
          <ref name="Div"/>
          <ref name="Sect"/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="P"/>
          <ref name="Note"/>
          <ref name="Hn"/>
          <ref name="H"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="FENote"/>
          <ref name="L"/>
          <ref name="Table"/>
          <ref name="Caption"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <!--
    Caption here is 0..1  matching 32005
    Table 371 ISO 32000-2 says first or last which would be
    (Caption, (...)) | ((...), Caption?)
  -->
  <define name="Table">
    <a:documentation>Tables</a:documentation>
    <element name="pdf2:Table">
      <ref name="pdf2-attributes"/>
      <optional>
        <attribute name="Layout:Width"/>
      </optional>
      <optional>
        <attribute name="Layout:Height"/>
      </optional>
      <ref name="table-attributes"/>
      <interleave>
        <zeroOrMore>
          <choice>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="TR"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
        <group>
          <optional>
            <ref name="THead"/>
          </optional>
          <zeroOrMore>
            <ref name="TBody"/>
          </zeroOrMore>
          <optional>
            <ref name="TFoot"/>
          </optional>
        </group>
        <optional>
          <ref name="Caption"/>
        </optional>
      </interleave>
    </element>
  </define>
  <define name="THead">
    <element name="pdf2:THead">
      <ref name="pdf2-attributes"/>
      <ref name="table-attributes"/>
      <zeroOrMore>
        <choice>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="TR"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="TBody">
    <element name="pdf2:TBody">
      <ref name="pdf2-attributes"/>
      <ref name="table-attributes"/>
      <zeroOrMore>
        <choice>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="TR"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="TFoot">
    <element name="pdf2:TFoot">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="TR"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="TR">
    <element name="pdf2:TR">
      <ref name="pdf2-attributes"/>
      <ref name="table-attributes"/>
      <zeroOrMore>
        <choice>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="TH"/>
          <ref name="TD"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="TH">
    <element name="pdf2:TH">
      <ref name="pdf2-attributes"/>
      <optional>
        <attribute name="Layout:Width"/>
      </optional>
      <optional>
        <attribute name="Layout:Height"/>
      </optional>
      <optional>
        <attribute name="Layout:BlockAlign">
          <choice>
            <value>Before</value>
            <value>Middle</value>
            <value>After</value>
            <value>Justify</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="Layout:InlineAlign">
          <choice>
            <value>Start</value>
            <value>Center</value>
            <value>End</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="Layout:TBorderStyle"/>
      </optional>
      <optional>
        <attribute name="Layout:TPadding"/>
      </optional>
      <!---->
      <ref name="table-attributes"/>
      <optional>
        <attribute name="Table:Scope">
          <choice>
            <value>Column</value>
            <value>Row</value>
            <value>Both</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="Table:Short"/>
      </optional>
      <interleave>
        <optional>
          <ref name="H"/>
        </optional>
        <zeroOrMore>
          <choice>
            <text/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="TD">
    <element name="pdf2:TD">
      <ref name="pdf2-attributes"/>
      <optional>
        <attribute name="Layout:Width"/>
      </optional>
      <optional>
        <attribute name="Layout:Height"/>
      </optional>
      <optional>
        <attribute name="Layout:BlockAlign">
          <choice>
            <value>Before</value>
            <value>Middle</value>
            <value>After</value>
            <value>Justify</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="Layout:InlineAlign">
          <choice>
            <value>Start</value>
            <value>Center</value>
            <value>End</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="Layout:TBorderStyle"/>
      </optional>
      <optional>
        <attribute name="Layout:TPadding"/>
      </optional>
      <ref name="table-attributes"/>
      <interleave>
        <optional>
          <ref name="H"/>
        </optional>
        <zeroOrMore>
          <choice>
            <text/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <!-- Captions and Figures -->
  <define name="Caption">
    <element name="pdf2:Caption">
      <ref name="pdf2-attributes"/>
      <choice>
        <interleave>
          <optional>
            <ref name="H"/>
          </optional>
          <zeroOrMore>
            <choice>
              <ref name="DocumentFragment"/>
              <ref name="Part"/>
              <ref name="Art"/>
              <ref name="Div"/>
              <ref name="Sect"/>
              <ref name="Aside"/>
              <ref name="BlockQuote"/>
              <ref name="NonStruct"/>
              <ref name="Private"/>
              <ref name="P"/>
              <ref name="Note"/>
              <ref name="Code"/>
              <ref name="Hn"/>
              <ref name="Sub"/>
              <ref name="Lbl"/>
              <ref name="Link"/>
              <ref name="Reference"/>
              <ref name="Annot"/>
              <ref name="Form"/>
              <ref name="Ruby"/>
              <ref name="Warichu"/>
              <ref name="FENote"/>
              <ref name="Index"/>
              <ref name="L"/>
              <ref name="BibEntry"/>
              <ref name="Table"/>
              <ref name="Figure"/>
              <ref name="Formula"/>
              <ref name="Artifact"/>
            </choice>
          </zeroOrMore>
        </interleave>
        <!-- Grouping -->
        <interleave>
          <optional>
            <ref name="H"/>
          </optional>
          <zeroOrMore>
            <choice>
              <text/>
              <ref name="Part"/>
              <ref name="Art"/>
              <ref name="Div"/>
              <ref name="Sect"/>
              <ref name="Aside"/>
              <ref name="BlockQuote"/>
              <ref name="NonStruct"/>
              <ref name="Private"/>
              <ref name="P"/>
              <ref name="Note"/>
              <ref name="Code"/>
              <ref name="Hn"/>
              <ref name="Sub"/>
              <ref name="Lbl"/>
              <ref name="Em"/>
              <ref name="Strong"/>
              <ref name="Span"/>
              <ref name="Quote"/>
              <ref name="Link"/>
              <ref name="Reference"/>
              <ref name="Annot"/>
              <ref name="Form"/>
              <ref name="Ruby"/>
              <ref name="Warichu"/>
              <ref name="FENote"/>
              <ref name="Index"/>
              <ref name="L"/>
              <ref name="BibEntry"/>
              <ref name="Table"/>
              <ref name="Figure"/>
              <ref name="Formula"/>
              <ref name="Artifact"/>
            </choice>
          </zeroOrMore>
        </interleave>
      </choice>
      <!---->
    </element>
  </define>
  <define name="figure-attributes">
    <interleave>
      <optional>
        <attribute name="actualtext"/>
      </optional>
      <optional>
        <!-- ActualText -->
        <attribute name="alt"/>
      </optional>
    </interleave>
  </define>
  <!-- Alt -->
  <define name="Figure">
    <element name="pdf2:Figure">
      <optional>
        <attribute name="lang"/>
      </optional>
      <optional>
        <!-- Lang -->
        <attribute name="expansion"/>
      </optional>
      <optional>
        <!-- E -->
        <attribute name="title"/>
      </optional>
      <optional>
        <!-- T -->
        <attribute name="id"/>
      </optional>
      <!-- ID -->
      <ref name="layout-attributes"/>
      <ref name="otherns-attributes"/>
      <ref name="showtags-attributes"/>
      <optional>
        <attribute name="Layout:Width"/>
      </optional>
      <optional>
        <attribute name="Layout:Height"/>
      </optional>
      <ref name="figure-attributes"/>
      <choice>
        <interleave>
          <optional>
            <ref name="H"/>
          </optional>
          <optional>
            <ref name="Caption"/>
          </optional>
          <zeroOrMore>
            <choice>
              <ref name="Part"/>
              <ref name="Art"/>
              <ref name="Div"/>
              <ref name="Sect"/>
              <ref name="Aside"/>
              <ref name="BlockQuote"/>
              <ref name="NonStruct"/>
              <ref name="Private"/>
              <ref name="P"/>
              <ref name="Note"/>
              <ref name="Code"/>
              <ref name="Hn"/>
              <ref name="Sub"/>
              <ref name="Lbl"/>
              <ref name="Link"/>
              <ref name="Reference"/>
              <ref name="Annot"/>
              <ref name="Form"/>
              <ref name="Ruby"/>
              <ref name="Warichu"/>
              <ref name="FENote"/>
              <ref name="Index"/>
              <ref name="L"/>
              <ref name="BibEntry"/>
              <ref name="Table"/>
              <ref name="Figure"/>
              <ref name="Formula"/>
              <ref name="Artifact"/>
            </choice>
          </zeroOrMore>
        </interleave>
        <!-- Grouping -->
        <interleave>
          <optional>
            <ref name="H"/>
          </optional>
          <optional>
            <ref name="Caption"/>
          </optional>
          <zeroOrMore>
            <choice>
              <text/>
              <ref name="Part"/>
              <ref name="Art"/>
              <ref name="Div"/>
              <ref name="Sect"/>
              <ref name="Aside"/>
              <ref name="BlockQuote"/>
              <ref name="NonStruct"/>
              <ref name="Private"/>
              <ref name="P"/>
              <ref name="Note"/>
              <ref name="Code"/>
              <ref name="Hn"/>
              <ref name="Lbl"/>
              <ref name="Em"/>
              <ref name="Strong"/>
              <ref name="Span"/>
              <ref name="Quote"/>
              <ref name="Link"/>
              <ref name="Reference"/>
              <ref name="Annot"/>
              <ref name="Form"/>
              <ref name="Ruby"/>
              <ref name="Warichu"/>
              <ref name="FENote"/>
              <ref name="Index"/>
              <ref name="L"/>
              <ref name="BibEntry"/>
              <ref name="Table"/>
              <ref name="Figure"/>
              <ref name="Formula"/>
              <ref name="Artifact"/>
            </choice>
          </zeroOrMore>
        </interleave>
      </choice>
      <!---->
    </element>
  </define>
  <!-- expanded pdf2-attributes to avoid so much backtracking -->
  <define name="Formula">
    <a:documentation>Formula</a:documentation>
    <element name="pdf2:Formula">
      <zeroOrMore>
        <ref name="AssociatedFiletext"/>
      </zeroOrMore>
      <ref name="formula-requirements"/>
      <zeroOrMore>
        <ref name="AssociatedFiletext"/>
      </zeroOrMore>
      <group>
        <optional>
          <attribute name="lang"/>
        </optional>
        <optional>
          <!-- Lang -->
          <attribute name="expansion"/>
        </optional>
        <optional>
          <!-- E -->
          <attribute name="title"/>
        </optional>
        <optional>
          <!-- T -->
          <attribute name="id"/>
        </optional>
        <optional>
          <!-- ID -->
          <attribute name="phoneme"/>
        </optional>
        <optional>
          <!-- Phoneme -->
          <attribute name="phonetic-alphabet"/>
        </optional>
        <optional>
          <!-- PhoneticAlphabet -->
          <attribute name="revision"/>
        </optional>
        <!-- R -->
        <ref name="layout-attributes"/>
        <ref name="otherns-attributes"/>
        <optional>
          <attribute name="af"/>
        </optional>
        <optional>
          <attribute name="rolemapped-from"/>
        </optional>
        <optional>
          <attribute name="referenced-as"/>
        </optional>
        <optional>
          <attribute name="Layout:Width"/>
        </optional>
        <optional>
          <attribute name="Layout:Height"/>
        </optional>
        <interleave>
          <optional>
            <ref name="H"/>
          </optional>
          <optional>
            <ref name="Caption"/>
          </optional>
          <zeroOrMore>
            <choice>
              <text/>
              <ref name="Part"/>
              <ref name="Div"/>
              <ref name="Aside"/>
              <ref name="BlockQuote"/>
              <ref name="NonStruct"/>
              <ref name="Private"/>
              <ref name="P"/>
              <ref name="Note"/>
              <ref name="Code"/>
              <ref name="Hn"/>
              <ref name="Sub"/>
              <ref name="Lbl"/>
              <ref name="Em"/>
              <ref name="Strong"/>
              <ref name="Span"/>
              <ref name="Quote"/>
              <ref name="Link"/>
              <ref name="Reference"/>
              <ref name="Annot"/>
              <ref name="Form"/>
              <ref name="Ruby"/>
              <ref name="Warichu"/>
              <ref name="FENote"/>
              <ref name="Index"/>
              <ref name="L"/>
              <ref name="BibEntry"/>
              <ref name="Table"/>
              <ref name="Figure"/>
              <ref name="Formula"/>
              <ref name="Artifact"/>
              <ref name="mathse"/>
            </choice>
          </zeroOrMore>
        </interleave>
      </group>
    </element>
  </define>
  <define name="Artifact">
    <a:documentation>Artifact</a:documentation>
    <element name="pdf2:Artifact">
      <ref name="pdf1rolemap-Any"/>
      <ref name="pdf2-attributes"/>
      <ref name="artifact-attributes"/>
      <interleave>
        <optional>
          <ref name="H"/>
        </optional>
        <optional>
          <ref name="Caption"/>
        </optional>
        <zeroOrMore>
          <choice>
            <text/>
            <ref name="Document"/>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="TOC"/>
            <ref name="TOCI"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="Title"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="RB"/>
            <ref name="RT"/>
            <ref name="RP"/>
            <ref name="Warichu"/>
            <ref name="WT"/>
            <ref name="WP"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="LI"/>
            <ref name="LBody"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="TR"/>
            <ref name="TH"/>
            <ref name="TD"/>
            <ref name="THead"/>
            <ref name="TBody"/>
            <ref name="TFoot"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="Art">
    <a:documentation>PDF1</a:documentation>
    <element name="pdf1:Art">
      <ref name="pdf2-attributes"/>
      <interleave>
        <optional>
          <ref name="H"/>
        </optional>
        <zeroOrMore>
          <choice>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="TOC"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="Title"/>
            <ref name="Lbl"/>
            <ref name="Link"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="Table"/>
            <ref name="Caption"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="Private">
    <element name="pdf1:Private">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="Document"/>
          <ref name="DocumentFragment"/>
          <ref name="Part"/>
          <ref name="Art"/>
          <ref name="Div"/>
          <ref name="Sect"/>
          <ref name="TOC"/>
          <ref name="TOCI"/>
          <ref name="Aside"/>
          <ref name="BlockQuote"/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="P"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Hn"/>
          <ref name="H"/>
          <ref name="Title"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="RB"/>
          <ref name="RT"/>
          <ref name="RP"/>
          <ref name="Warichu"/>
          <ref name="WT"/>
          <ref name="WP"/>
          <ref name="FENote"/>
          <ref name="Index"/>
          <ref name="L"/>
          <ref name="LI"/>
          <ref name="LBody"/>
          <ref name="BibEntry"/>
          <ref name="Table"/>
          <ref name="TR"/>
          <ref name="TH"/>
          <ref name="TD"/>
          <ref name="THead"/>
          <ref name="TBody"/>
          <ref name="TFoot"/>
          <ref name="Caption"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="TOC">
    <element name="pdf1:TOC">
      <ref name="pdf2-attributes"/>
      <interleave>
        <optional>
          <ref name="Caption"/>
        </optional>
        <zeroOrMore>
          <choice>
            <ref name="Part"/>
            <ref name="TOC"/>
            <ref name="TOCI"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="TOCI">
    <element name="pdf1:TOCI">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <ref name="Div"/>
          <ref name="TOC"/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="P"/>
          <ref name="Lbl"/>
          <ref name="Reference"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Note">
    <element name="pdf1:Note">
      <ref name="pdf2-attributes"/>
      <choice>
        <zeroOrMore>
          <choice>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Link"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="Table"/>
            <ref name="Caption"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
        <zeroOrMore>
          <!-- Grouping -->
          <choice>
            <text/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </choice>
      <!-- Block -->
    </element>
  </define>
  <define name="Reference">
    <element name="pdf1:Reference">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Link"/>
          <ref name="Annot"/>
          <ref name="FENote"/>
          <ref name="BibEntry"/>
          <ref name="Figure"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="Code">
    <element name="pdf1:Code">
      <ref name="pdf2-attributes"/>
      <choice>
        <zeroOrMore>
          <choice>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Link"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="Table"/>
            <ref name="Caption"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
        <zeroOrMore>
          <!-- Grouping -->
          <choice>
            <text/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="Aside"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Sub"/>
            <ref name="Lbl"/>
            <ref name="Em"/>
            <ref name="Strong"/>
            <ref name="Span"/>
            <ref name="Quote"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="Ruby"/>
            <ref name="Warichu"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="BibEntry"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </choice>
      <!-- Block -->
    </element>
  </define>
  <!-- Aside + Title -->
  <define name="BlockQuote">
    <element name="pdf1:BlockQuote">
      <ref name="pdf2-attributes"/>
      <interleave>
        <optional>
          <ref name="H"/>
        </optional>
        <optional>
          <ref name="Caption"/>
        </optional>
        <zeroOrMore>
          <choice>
            <text/>
            <ref name="Document"/>
            <ref name="DocumentFragment"/>
            <ref name="Part"/>
            <ref name="Art"/>
            <ref name="Div"/>
            <ref name="Sect"/>
            <ref name="TOC"/>
            <ref name="BlockQuote"/>
            <ref name="NonStruct"/>
            <ref name="Private"/>
            <ref name="P"/>
            <ref name="Note"/>
            <ref name="Code"/>
            <ref name="Hn"/>
            <ref name="Title"/>
            <ref name="Lbl"/>
            <ref name="Link"/>
            <ref name="Reference"/>
            <ref name="Annot"/>
            <ref name="Form"/>
            <ref name="FENote"/>
            <ref name="Index"/>
            <ref name="L"/>
            <ref name="Table"/>
            <ref name="Figure"/>
            <ref name="Formula"/>
            <ref name="Artifact"/>
          </choice>
        </zeroOrMore>
      </interleave>
    </element>
  </define>
  <define name="Quote">
    <element name="pdf1:Quote">
      <ref name="pdf2-attributes"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="NonStruct"/>
          <ref name="Private"/>
          <ref name="Note"/>
          <ref name="Code"/>
          <ref name="Sub"/>
          <ref name="Lbl"/>
          <ref name="Em"/>
          <ref name="Strong"/>
          <ref name="Span"/>
          <ref name="Quote"/>
          <ref name="Link"/>
          <ref name="Reference"/>
          <ref name="Annot"/>
          <ref name="Form"/>
          <ref name="Ruby"/>
          <ref name="Warichu"/>
          <ref name="FENote"/>
          <ref name="BibEntry"/>
          <ref name="Figure"/>
          <ref name="Formula"/>
          <ref name="Artifact"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
</grammar>
