<!-- OddAdd.DTD:  Special elements for tag set documents      -->
<!-- This DTD defines tags to add to standard prose for ODD   -->
<!-- documents:  taglist, dtdfrag, etc.                       -->
 
<!-- Revisions:                                               -->
<!--  1 Mar 93 : MSM : change dtdFrag FILE to CDATA, was NAME -->
<!--  2 Feb 93 : MSM : add msection to allow ms in dtdFrags   -->
<!--  8 Jan 92 : MSM : add clarifying comment to file att     -->
<!--  4 Jan 92 : LB, MSM : redo entdecls, add cladecl, drop   -->
<!--      pedecls (sigh)                                      -->
<!-- 29 Dec 91 : MSM : add ADLIST, to handle class atts.      -->
<!-- 18 Dec 91 : MSM : correct typo in peref attlist decl.    -->
<!-- 15 Dec 91 : MSM : add peref as legal in dtdfrag.         -->
<!-- 12 Dec 91 : MSM : correct typo in long comment.          -->
<!--  6 Dec 91 : MSM : change external entity names.          -->
<!-- 29 Nov 91 : MSM : add TYPE to PEdecl for OddP2X, OddDTD  -->
<!--      ensure every element in a DTDfrag points to a doc   -->
<!--           crystal (this may be too strict?)              -->
<!--      correct old references to DTDPart (now DTDref)      -->
<!-- 26 Nov 91 : MSM : change %globals; to %global; passim    -->
<!--      correct gidtype to gidesc, giatype to attdesc;      -->
<!--      rename comment to commdecl to avoid conflict with   -->
<!--           bibliographic comment element.                 -->
<!-- 25 Nov 91 : MSM : made file from old tagdoc.dtd          -->
<!--                                                          -->
 
<!-- include material common to OddAdd and P2XAdd DTDs.       -->
<!ENTITY % comadd  SYSTEM 'comadd.dtd'                          >
%comadd;
 
<!-- 1 Tag Lists in prose:  for first major part of canonical structure
for tag-presenting sections. -->
 
<!-- TagList:  marks a list of tags.  In print format, these should be
formatted like a definition list.  In the one-liners style, each TagDesc
generates the tag's GI in brackets as the term, and the element's
one-line description (from the Desc element in the TagDoc element) as
the definition.  Embedded lists of attributes may also occur within any
entry for a GI.  The other styles are there only as dummies now, to
remind us we may need more styles later.  -->
 
<!ELEMENT tagList       - -  (tagDesc+)                         >
<!ATTLIST tagList            %global;
          style              (long | one-line | green)
                                                 'one-line'     >
 
<!-- ADList:  Attribute Description List.  Marks a list of attributes
belonging to a class of elements; in the documentation, this will be
formatted like a glossary list (i.e. same as embedded attribute lists
within tagdesc within taglist).  Here and on TagDesc, ATTS attribute is
now CDATA but when the Odd and the tagset being defined use the same
SGML declaration (esp. name length), it should be NAMES.  -->
 
<!ELEMENT adList        - O  EMPTY                              >
<!ATTLIST adList             %global;
          classDoc           IDREF               #REQUIRED
          atts               CDATA               #REQUIRED      >
 
<!-- TagDesc:  empty tag indicating that a given gi should be included
in a TagList.  The GI is given as an attribute value (IDREF to the
appropriate TagDoc).  If the element has attributes which should be
mentioned in the list, their names are given as the value of the ATTS
attribute, and an embedded list is generated, with entries in the order
specified on the ATTS attribute.  A subset may be given.  If a null
string is given, no attributes are described; if the attribute is not
specified at all, *all* attributes defined in the TagDoc are included,
in the order they appear there.  If the attribute has a value list of
its own, all the entries in that value list are also reproduced.  -->
 
<!ELEMENT tagDesc       - O  EMPTY                              >
<!ATTLIST tagDesc            %global;
          tagDoc             IDREF               #REQUIRED
          atts               CDATA               #IMPLIED       >
 
 
<!-- 2 DTDfrag and dependent elements:  for final major part of
tag-presenting sections:  the DTD fragment which defines the tags in
question. -->
 
<!-- DTDfrag:  marks a fragment of a DTD.  In the simplest case (as
shown in the SAMPLE.ODD file), contains a set of TagDecl elements which
are replaced in the output with the element declaration and attlist
declaration for the element with the specified GI.
 
May also contain a DTDrefs, CommDecls, and EntDecls (no more PEDecls,
alas, alas), which are replaced in the output file by comment and entity
declarations.  Each of these except CommDecl must point at an associated
reference document crystal.  N.B. the content model for DTDfrag thus
tightly constrains the form taken by Odd-generated DTDs.
 
A DTDref element indicates that the content of some other DTDfrag
element logically belongs here.  OddP2X should fetch the name of the
other DTDfrag (given as the value of the N attribute) and print it as a
comment, in the form:
 
        <!++ ... declarations from section N.N.N (Definitions
             of phrase-level elements) go here ... ++>
    or
         <!++ Definitions of phrase-level elements here.  ++>
 
OddDTD should bodily insert a similar comment, but then follow it with
the contents of the specified DTD fragment, and follow that with a
comment saying that that DTD fragment is now ended.  OddRef ignores
DTDfrags entirely.
 
Other comments may be specified using the Commdecl element.  These should
all be block prose comments, as we expect to reformat them as
paragraphs.
 
EntDecl indicates that an entity declaration goes in the DTD at
this point; the entity declaration is defined in the related EntDoc
crystal.
 
ClaDecl indicates that a parameter entity declaration for an
element class goes in the DTD here; the entity declaration is derived
from the related ClassDoc, either
 
        1 by the members given for the element class in the Class
                elements of the TagDoc and ClassDoc crystals
        2 by the attlist defined in the ClassDoc crystal.
 
TagDoc's empty Classes element takes a list of class names as an
attribute value, the element being reckoned a member of each of these
classes.  E.g.
 
    <tagdoc gi=emph> ... <classes names='soup phrases rhet'>
    <tagdoc gi=highligh> ... <classes names='soup phrases typogr'>
 
Some DTDfrag would include
 
    <ClaDecl ClassDoc='rhet'   type='model'>
    <ClaDecl ClassDoc='typogr' type='atts' >
    <ClaDecl ClassDoc='soup'   type='model'>
 
which would generate (in the OddDTD processor) something like:
 
    <!entity % m.rhet 'emph | ...'>
    <!entity % a.typo 'font CDATA  #required
                       size NUMBER #required'>
    <!entity % m.soup 'emph | highlighted | ...'>
 
OddP2X processes a DTDFrag by printing a nice header for the fragment
and then nicely printing its contents:  the comment, element and
attribute list declarations are printed with appropriate delimiters, and
each DTDRef element present generates a comment with a cross-reference
to that DTD fragment.
 
OddDTD processes a DTDFrag by emitting a comment identifying the
fragment, then writing out the contents of the fragment:  comment,
element, and attlist declarations with appropriate delimiters, DTDref
cross-references by processing the appropriate DTDFrag.  Finally, an
ending comment is emitted.  The file into which all this is written is
given by the DTDFrag File attribute.  Use 8-character filename, no
extension.  **Changed 1 Mar 93:  default extension is .dtd, but
others may be used. MSM**
 
If no File attribute is given on the DTDfrag, the DTDfrag
should be a continuation of another or be referred to from some other
DTDfrag.  If this is not the case, OddDTD should issue a warning.  (An
element may be defined in more than one file, but this should happen
only if both of them are bases.)
 
If the DTDfrag element bears a CONTIN attribute, it should be viewed as
a continuation of the DTDfrag whose ID is given as the CONTIN value, and
printed / copied immediately after it.  A series of such continuations
will be printed / copied in order.  (It is a semantic error for the ID
in question to belong to anything other than a DTDfrag.)
-->
 
<!ELEMENT dtdFrag       - O  (tagDecl | dtdRef | commDecl
                             | entDecl | claDecl | peRef
                             | msection)*                       >
<!ATTLIST dtdFrag            %global;
          file               CDATA               #IMPLIED
          contin             IDREF               #IMPLIED       >
 
<!-- MSection:  indicates that a marked section occurs in the dtd
here; the KEYWORDS attribute is used to specify what keywords govern
the marked section; they are included without change. -->
<!ELEMENT msection      - -  (tagDecl | dtdRef | commDecl
                             | entDecl | claDecl | peRef
                             | msection)*                       >
<!ATTLIST msection           %global;
          keywords           CDATA               #REQUIRED      >
 
<!-- TagDecl:  indicates that the element and attribute list
declarations associated with the given GI logically belong here.  In
processing, the contents of the appropriate ElemDecl and AttlDecl
elements are transcribed here. -->
 
<!ELEMENT tagDecl       - O  EMPTY                              >
<!ATTLIST tagDecl            %global;
          tagDoc             IDREF               #REQUIRED      >
 
<!-- DTDRef:  indicates that the contents of a distinct DTDFrag element
logically belong here.  In OddP2X processing, a comment to this effect is
produced; in OddDTD processing, the contents of the specified DTDFrag
are physically copied into this location.  Unlike Knuth, who uses string
matching to link module definitions and uses, we will use the SGML ID /
IDREF mechanism.  The Target attribute must point at the DTDFrag which
logically belongs here.  -->
 
<!ELEMENT dtdRef        - O  EMPTY                              >
<!ATTLIST dtdRef             %global;
          dtdFrag            IDREF               #REQUIRED      >
 
<!-- Commdecl:  indicates that a comment declaration belongs at this
point.  The contents of the comment are given by the contents of the
element.  OddP2X and OddDTD processing each just put the comment into the
output file.  They might conceivably format it as a paragraph so they
can put begin and end comment marks on every line (to make it easy to
handle with Waterloo GML and look like the comments in TEI P1). -->
 
<!ELEMENT commDecl      - O  (#PCDATA)                          >
<!ATTLIST commDecl           %global;                           >
 
<!-- EntDecl:  indicates that an entity declaration belongs at this
point.  Entity name, type (pe or ge), and entity text are derived from
an EntDoc crystal pointed at by the Target attribute (from its entname
element, type attribute, and string element).  -->
 
<!ELEMENT entDecl       - O  EMPTY                              >
<!ATTLIST entDecl            %global;
          entDoc             IDREF               #REQUIRED      >
 
<!-- ClaDecl:  indicates that a parameter entity declaration for an
element class logically belongs at this point.  The ClassDoc attribute
points at the relevant ClassDoc; the Type attribute specifies whether
the parameter entity is for use in content models or attlist
declarations.
 
For content models, entity name is 'm.'  || classname; the entity text
is '%x.'  || classname || '; ' followed by a '|'-delimited list of
members, represented by GIs or '%m.'  || classnames.  (N.B.  OddDTD must
generate the x.class entity declaration with a null string entity text.)
For attribute declarations, name is 'a.'  || classname, entity text is
derived from the Attlist crystal in the ClassDoc.
 
-->
 
<!ELEMENT claDecl       - O  EMPTY                              >
<!ATTLIST claDecl            %global;
          classDoc           IDREF               #REQUIRED
          type               (model | atts)      #REQUIRED      >
 
<!-- PEref indicates that a reference to a parameter entity is made at
this point.  The name of the entity is given in the N attribute.  For
now, no check is made that the parameter entity is declared anywhere.
-->
 
<!ELEMENT peRef         - O  EMPTY                              >
<!ATTLIST peRef              %global;                           >







