<!--
# vim: sw=4 sta et
-->

<!ENTITY % section.class 
    "chapter|section|subsection|subsubsection|
     majorheading|chapheading|heading|subheading|subsubheading|
     top|unnumbered|unnumberedsec|unnumberedsubsec|unnumberedsubsubsec|
     appendix|appendixsec|appendixsubsec|appendixsubsubsec">

<!ENTITY % block.class
    "para|
     quotation|cartouche|flushleft|flushright|
     example|display|format|
     enumerate|itemize|varlist|
     multitable">


<!-- Treated as blocks -->
<!ENTITY % misc.class                   "comment|documentlanguage|sp|page">

<!ENTITY % top.level.class              "printindex">

<!ENTITY % font.class                   "i|b|r|t">

<!ENTITY % semantic.inline.class
    "code|samp|cite|email|dfn|file|sc|acronym|emph|strong|key|kbd|var">
<!ENTITY % graphic.class                "image">

<!ENTITY % inline.class
    "#PCDATA|%font.class;|%semantic.inline.class;|%graphic.class;">
<!ENTITY % footnote.class               "footnote">

<!ENTITY % link.class                   "xref|ref|pxref|uref">

<!ENTITY % node.class                   "node|menu">

<!ENTITY % anchor.class                 "anchor|indexterm">

<!ENTITY % block.content.class
    "%misc.class;|%anchor.class;|%block.class;">

<!-- This is the root element.  -->
<!ELEMENT texinfoset            (nodenamemap?,texinfo*)>
<!ATTLIST texinfoset
    xmlns CDATA #FIXED "http://docbook2x.sourceforge.net/xmlns/Texi-XML">

<!ELEMENT nodenamemap           (nodenamemapentry*)>
<!ELEMENT nodenamemapentry      (nodename*)>
<!ATTLIST nodenamemapentry
    id                  ID                      #REQUIRED
    file                CDATA                   #IMPLIED
>
<!ELEMENT nodename              (#PCDATA)>

<!ELEMENT texinfo 
    (comment*,
     settitle, directory?, titlepage?, 
     (%node.class;|%section.class;|%block.content.class;|%top.level.class;)+)>
<!ATTLIST texinfo
    file                CDATA                   #IMPLIED
>

<!ELEMENT settitle              (%inline.class;)*>

<!-- Title pages -->
<!ELEMENT titlepage             (title,subtitle?,author*)>
<!ELEMENT title                 (%inline.class;)*>
<!ELEMENT subtitle              (%inline.class;)*>
<!ELEMENT author                (%inline.class;)*>


<!-- Texinfo node declaration -->
<!ELEMENT node                  EMPTY>
<!ATTLIST node
    name                CDATA                   #IMPLIED
    next                CDATA                   #IMPLIED
    previous            CDATA                   #IMPLIED
    up                  CDATA                   #IMPLIED

    id                  IDREF                   #IMPLIED
    nextid              IDREF                   #IMPLIED
    previousid          IDREF                   #IMPLIED
    upid                IDREF                   #IMPLIED
>


<!-- Comments to be embedded inside the Texinfo output.
     Note that this is a block element and cannot be used as an
     inline, since the latter is not sufficiently useful to have
     to complicate the content model.
-->
<!ELEMENT comment       (#PCDATA)>

<!-- Set document language.
     We do not use a lang attribute for all the other
     elements, for the following reason:
     
     Suppose that a DocBook document sets a particular language
     on the lang attribute of a section element, which would
     then apply to all the text within that section.  However,
     since Texinfo sectioning elements are really just headings,
     not containers, we would need put the lang attribute in 
     a wrapper element, and this complicates the content model.

     Instead we switch languages in the same way that native
     Texinfo does.  This does introduce a little complication in 
     (XSLT) stylesheets though.  It is slightly eased by the new
     specification that, if lang is omitted on the documentlanguage
     element, it means the document should revert to the previous
     language that was set.
-->
<!ELEMENT documentlanguage      EMPTY>
<!ATTLIST documentlanguage
    lang                NMTOKEN                 #IMPLIED
>



<!-- Texinfo menus -->
<!ELEMENT directory             (menuentry*)>
<!ATTLIST directory
    category            CDATA                   #IMPLIED
>
<!ELEMENT menu                  ((menuline|menuentry)*, detailmenu?)>
<!ELEMENT detailmenu            ((menuline|menuentry)*)>
<!ELEMENT menuentry             (menuentrytitle,menuentrydescrip?)>
<!-- the attribute "node" is required for menu
     the attribute "file" is required for directory -->
<!ATTLIST menuentry
    node                CDATA                   #IMPLIED
    file                CDATA                   #IMPLIED
    idref               CDATA                   #IMPLIED
>
<!ELEMENT menuentrytitle        (%inline.class;)*>
<!ELEMENT menuentrydescrip      (%inline.class;)*>

<!-- The contents of a menuline element
     is to be rendered as one line in the Texinfo menu.
     Good for inserting text like "Detailed Node Menu". -->
<!ELEMENT menuline              (%inline.class;)*>


<!-- Section elements (really just headings -
     their content is the title; there is no separate title element) -->
<!ELEMENT chapter               (%inline.class;)*>
<!ELEMENT section               (%inline.class;)*>
<!ELEMENT subsection            (%inline.class;)*>
<!ELEMENT subsubsection         (%inline.class;)*>

<!ELEMENT majorheading          (%inline.class;)*>
<!ELEMENT chapheading           (%inline.class;)*>
<!ELEMENT heading               (%inline.class;)*>
<!ELEMENT subheading            (%inline.class;)*>
<!ELEMENT subsubheading         (%inline.class;)*>

<!ELEMENT top                   (%inline.class;)*>
<!ELEMENT unnumbered            (%inline.class;)*>
<!ELEMENT unnumberedsec         (%inline.class;)*>
<!ELEMENT unnumberedsubsec      (%inline.class;)*>
<!ELEMENT unnumberedsubsubsec   (%inline.class;)*>

<!ELEMENT appendix              (%inline.class;)*>
<!ELEMENT appendixsec           (%inline.class;)*>
<!ELEMENT appendixsubsec        (%inline.class;)*>
<!ELEMENT appendixsubsubsec     (%inline.class;)*>

<!-- Blocks -->
<!ELEMENT para                  
    (%inline.class;|%footnote.class;|%link.class;|%block.content.class;)*>
<!ELEMENT quotation             (%block.content.class;)*>
<!ELEMENT cartouche             (%block.content.class;)*>
<!ELEMENT flushleft             (%block.content.class;)*>
<!ELEMENT flushright            (%block.content.class;)*>

<!-- Verbatim blocks -->
<!ELEMENT example               (%inline.class;|%footnote.class;|anchor)*>
<!ELEMENT display               (%inline.class;|%footnote.class;|anchor)*>
<!ELEMENT format                (%inline.class;|%footnote.class;|anchor)*>


<!-- Vertical spacing -->
<!ELEMENT page                  EMPTY>
<!ELEMENT sp                    EMPTY>
<!ATTLIST sp
    lines                       CDATA           #REQUIRED
>


<!-- Links and cross references -->
<!ELEMENT xref          (%inline.class;)*>
<!ATTLIST xref
    node                        CDATA           #IMPLIED
    file                        CDATA           #IMPLIED

    idref                       IDREF           #IMPLIED
    
    infolabel                   CDATA           #IMPLIED
    printmanual                 CDATA           #IMPLIED
>
<!ELEMENT ref           (%inline.class;)*>
<!ATTLIST ref
    node                        CDATA           #IMPLIED
    file                        CDATA           #IMPLIED

    idref                       IDREF           #IMPLIED
    
    infolabel                   CDATA           #IMPLIED
    printmanual                 CDATA           #IMPLIED
>
<!ELEMENT pxref         (%inline.class;)*>
<!ATTLIST pxref
    node                        CDATA           #IMPLIED
    file                        CDATA           #IMPLIED

    idref                       IDREF           #IMPLIED

    infolabel                   CDATA           #IMPLIED
    printmanual                 CDATA           #IMPLIED
>
<!ELEMENT uref          (%inline.class;)*>
<!ATTLIST uref
    url                         CDATA           #REQUIRED
>

<!-- Lists -->
<!ELEMENT enumerate             ((%anchor.class;|listitem)*)>
<!ATTLIST enumerate
    begin               CDATA                   #IMPLIED
>
    
<!ELEMENT itemize               ((%anchor.class;|listitem)*)>
<!ATTLIST itemize
    markchar            CDATA                   #IMPLIED
>
    
<!ELEMENT listitem              (%block.content.class;)*>

<!ELEMENT varlist               (%anchor.class;|varlistentry)*>
<!ELEMENT varlistentry          ((%anchor.class;)*,term+,listitem)>
<!ELEMENT term                  (%inline.class;|%footnote.class;)*>


<!-- Tables -->
<!ELEMENT multitable            (colspec*,spanspec*,tbody)>
<!ATTLIST multitable
    cols                CDATA                   #REQUIRED
>

<!ELEMENT colspec               EMPTY>
<!ATTLIST colspec
    colname             NMTOKEN                 #IMPLIED
    colnum              CDATA                   #IMPLIED
    colwidth            CDATA                   #IMPLIED
>

<!ELEMENT spanspec              EMPTY>
<!ATTLIST spanspec
    spanname            NMTOKEN                 #REQUIRED
    namest              NMTOKEN                 #REQUIRED
    nameend             NMTOKEN                 #REQUIRED
>

<!ELEMENT tbody                 (row*)>
<!ELEMENT row                   (entry*)>

<!ELEMENT entry                 (%inline.class;|%footnote.class;|%link.class;)*>
<!ATTLIST entry
    colname             NMTOKEN                 #IMPLIED
    spanname            NMTOKEN                 #IMPLIED
    namest              NMTOKEN                 #IMPLIED
    nameend             NMTOKEN                 #IMPLIED
    morerows            CDATA                   #IMPLIED
>

<!-- Inline logical markup -->
<!ELEMENT code                  (%inline.class;|%footnote.class;)*>
<!ELEMENT samp                  (%inline.class;|%footnote.class;)*>
<!ELEMENT cite                  (%inline.class;|%footnote.class;)*>
<!ELEMENT email                 (%inline.class;|%footnote.class;)*>
<!ELEMENT dfn                   (%inline.class;|%footnote.class;)*>
<!ELEMENT file                  (%inline.class;|%footnote.class;)*>
<!ELEMENT sc                    (%inline.class;|%footnote.class;)*>
<!ELEMENT acronym               (%inline.class;|%footnote.class;)*>
<!ELEMENT emph                  (%inline.class;|%footnote.class;)*>
<!ELEMENT strong                (%inline.class;|%footnote.class;)*>
<!ELEMENT key                   (%inline.class;|%footnote.class;)*>
<!ELEMENT kbd                   (%inline.class;|%footnote.class;)*>
<!ELEMENT var                   (%inline.class;|%footnote.class;)*>
<!ELEMENT command               (%inline.class;|%footnote.class;)*>
<!ELEMENT env                   (%inline.class;|%footnote.class;)*>
<!ELEMENT option                (%inline.class;|%footnote.class;)*>

<!-- Font markup -->
<!ELEMENT i                     (%inline.class;|%footnote.class;)*>
<!ELEMENT b                     (%inline.class;|%footnote.class;)*>
<!ELEMENT r                     (%inline.class;|%footnote.class;)*>
<!ELEMENT t                     (%inline.class;|%footnote.class;)*>

<!-- Anchors -->
<!ELEMENT anchor                EMPTY>
<!ATTLIST anchor
    node                CDATA                   #IMPLIED
    idref               IDREF                   #IMPLIED
>


<!-- Images -->
<!ELEMENT image                 EMPTY>
<!ATTLIST image
    filename            CDATA                   #REQUIRED
    width               CDATA                   #IMPLIED
    height              CDATA                   #IMPLIED
>   

<!ELEMENT indexterm             (%inline.class;)*>
<!ATTLIST indexterm
    class               CDATA                   #REQUIRED
>

<!ELEMENT printindex            EMPTY>
<!ATTLIST printindex
    class               CDATA                   #REQUIRED
>

<!ELEMENT footnote              (%inline.class;)*>
