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

<!ENTITY % namespace.attr
    "xmlns CDATA #FIXED 'http://docbook2x.sourceforge.net/xmlns/Man-XML'">

<!ENTITY % section.class        "SH|SS">
<!ENTITY % misc.class           "nh|comment">
<!ENTITY % block.class          "para|TP|TPauto|indent|verbatim|
                                 br|sp|table|%misc.class;">
<!ENTITY % font.class           "b|i|tt">
<!ENTITY % inline.class         "#PCDATA|ulink|%font.class;">

<!-- This is the root element containing any number of manpages. -->
<!ELEMENT manpageset    (manpage)*>
<!ATTLIST manpageset    %namespace.attr;>

<!ELEMENT manpage
    (comment*,(SH,refnameline),(%section.class;|%block.class;)*)>
<!ATTLIST manpage
    title               CDATA                   #REQUIRED
    sect                CDATA                   #REQUIRED
    h1                  CDATA                   #REQUIRED
    h2                  CDATA                   #REQUIRED
    h3                  CDATA                   #IMPLIED
    h4                  CDATA                   #IMPLIED
    h5                  CDATA                   #IMPLIED
    preprocessors       CDATA                   #IMPLIED
    %namespace.attr;
>

<!-- NAME section of the man page -->
<!ELEMENT refnameline   (refname+,refpurpose)>
<!ELEMENT refname       (%inline.class;)*>
<!ELEMENT refpurpose    (%inline.class;)*>

<!-- Section headings -->
<!ELEMENT SS            (%inline.class;)*>
<!ELEMENT SH            (%inline.class;)*>

<!-- Paragraph -->
<!ELEMENT para          (%inline.class;|%block.class;)*>
<!ATTLIST para
    align               (l|r|c|b)               #IMPLIED
>

<!-- Paragraph with hanging tags -->
<!ELEMENT TP            (TPtag+,TPitem)>
<!ELEMENT TPtag         (%inline.class;)*>
<!ELEMENT TPitem        (%block.class;)*>
<!ATTLIST TP
    indent              CDATA                   #IMPLIED
>

<!-- This element creates a paragraph with a hanging tag
     like TP, but the "indent" is calculated to automatically
     start right next to the tag, instead of specified explicitly.
     This is useful for command and function synopses in man pages.
     
     Note that this element is not rendered with an actual TP macro. -->
<!ELEMENT TPauto        (TPtag,TPitem)>
<!ATTLIST TPauto
    align               (l|r|c|b)               #IMPLIED
>

<!-- Comment to be embedded in output -->
<!ELEMENT comment       (#PCDATA)>

<!-- Indent -->
<!ELEMENT indent        (%block.class;)*>
<!ATTLIST indent
    indent              CDATA                   #IMPLIED
>

<!-- Verbatim (turn off filling and adjusting) -->
<!ELEMENT verbatim      (%inline.class;|%misc.class;)*>

<!-- Line spacing -->
<!ELEMENT sp            EMPTY>
<!ATTLIST sp
    length              CDATA                   #REQUIRED
>
<!ELEMENT br            EMPTY>

<!-- Hyphenation control -->
<!ELEMENT nh            (%inline.class;|%block.class;)*>

<!-- Bold, italic, monospace -->
<!ELEMENT b             (%inline.class;)*>
<!ELEMENT i             (%inline.class;)*>
<!ELEMENT tt            (%inline.class;)*>

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

<!-- Tables -->
<!ELEMENT table         (tgroup*)>
<!-- To simplify man-page translators, we list all the possible
     attributes for frame from DocBook, although most of them
     cannot be implemented by tbl. -->
<!ATTLIST table
    pgwide              CDATA                   #IMPLIED
    frame               (above|all|below|border|bottom|box|hsides|
                         lhs|none|rhs|sides|top|topbot|void|vsides) #IMPLIED>



<!ELEMENT tgroup        (colspec*,spanspec*,thead?,tbody,tfoot?)>
<!ATTLIST tgroup
    cols                CDATA                   #REQUIRED
    rowsep              CDATA                   #IMPLIED
    colsep              CDATA                   #IMPLIED
    align               (left|right|center)     #IMPLIED
>

<!ELEMENT colspec       EMPTY>
<!ATTLIST colspec
    colname             NMTOKEN                 #IMPLIED
    colnum              CDATA                   #IMPLIED
    colsep              CDATA                   #IMPLIED
    rowsep              CDATA                   #IMPLIED
    align               (left|right|center)     #IMPLIED
    colwidth            CDATA                   #IMPLIED
>

<!ELEMENT spanspec      EMPTY>
<!ATTLIST spanspec
    spanname            NMTOKEN                 #REQUIRED
    namest              NMTOKEN                 #REQUIRED
    nameend             NMTOKEN                 #REQUIRED
    align               (left|right|center)     #IMPLIED
    colsep              CDATA                   #IMPLIED
    rowsep              CDATA                   #IMPLIED
>

<!ELEMENT tbody         (row*)>
<!ELEMENT thead         (colspec*,row*)>
<!ELEMENT tfoot         (colspec*,row*)>

<!ELEMENT row           ((entry|entrytbl|simentry)+)>
<!ATTLIST row
    rowsep              CDATA                   #IMPLIED
>

<!-- This is a "simple" entry in the table,
     meaning that we do not enter the entry as @T{} text block.
     This means that the text is NOT flowed, which is usually
     not what you want.  -->
<!ELEMENT simentry       (%inline.class;)*>
<!ATTLIST simentry
    colname             NMTOKEN                 #IMPLIED
    spanname            NMTOKEN                 #IMPLIED
    namest              NMTOKEN                 #IMPLIED
    nameend             NMTOKEN                 #IMPLIED
    align               (left|right|center)     #IMPLIED
    colsep              CDATA                   #IMPLIED
    rowsep              CDATA                   #IMPLIED
    morerows            CDATA                   #IMPLIED
>

<!-- Although XML does not allow us to enforce exclusions,
     we will never allow a table to appear as a descendant
     of entry (since nested tables are not supported
     by tbl). -->
<!ELEMENT entry         (%inline.class;|%block.class;)*>
<!ATTLIST entry
    colname             NMTOKEN                 #IMPLIED
    spanname            NMTOKEN                 #IMPLIED
    namest              NMTOKEN                 #IMPLIED
    nameend             NMTOKEN                 #IMPLIED
    align               (left|right|center)     #IMPLIED
    colsep              CDATA                   #IMPLIED
    rowsep              CDATA                   #IMPLIED
    morerows            CDATA                   #IMPLIED
>

<!ELEMENT entrytbl      (colspec*,thead?,tbody)>
<!ATTLIST entrytbl
    cols                CDATA                   #REQUIRED
>
