<!-- ********************************************************

              IETM CONTENT DATA MODEL    Version 6.1
              Generic Layer           1 October 1992

              MIL-D-87269 AMENDMENT 1 - 21 April 1995

              11-20-95 - Added step element to %orglvllist.

              04-11-96 - Added follow-on element to %orglvllist.

              06-17-96 - Removed follow-on element from %orglvllist.

     ********************************************************

     The IETM Content Data Model (CDM) provides a representation of technical
information elements and their relationships.  The CDM is composed of two
separate layers.  The first is the "Generic Layer".  It defines general
characteristics which are common across all applications.  The second layer is
the "Content Specific Layer," which contains content specific DTDs.

     The generic layer defines the templates, linking elements, primitive
elements, and context filtering elements which are used to create content
specific DTDs.  Templates define rules which must be followed in the creation
of content specific DTD's and document instances.  The templates provide the
structure for creating composite nodes, context dependent filtering, user
interaction and branching.  The templates provide basic sets of rules to which
elements must adhere.  Those rules are explained after the declaration of each
template in this document.

     The CDM hylink element is taken from the HyTime Model. This element
provides the capability to link between CDM elements, other SGML files, and
non SGML documents. These capabilities are explained in the HyTime Linking
Mechanism section of this document.  The CDM "link" element is a non-HyTime
linking mechanism.  It provides the capability to link between CDM elements
only.

     The primitive elements ("text", "table", "graphic", "audio",
"video","process", and "dialog") are defined in the generic layer.  These
elements may be used to construct a variety of composite elements in the
content specific layer.  The primitive elements' structures shall remain
constant.

     Context dependent filtering provides the capability to present the user
with only the information that applies to a specific situation.  The
precondition and postcondition elements provide the mechanism for context
dependent filtering.  The precondition element enables the selection of the
appropriate information for presentation.  The postcondition element enables
the recording of presentation events for later filtering.

     *********************************************************

                    PUBLIC ENTITY DECLARATIONS

     ********************************************************

<!ENTITY % ietmdba PUBLIC "-//USA-DOD//DTD Content Data Model
Generic Layer//EN" "c:\omni\sgml\87269\ietmdba">  -->

<!-- Inclusion of MIL-M-28001 math package -->

<!ENTITY % mathpac PUBLIC "-//USA-DOD//DTD SUP MIL-M-28001 MATHPACK 911001//EN" 
"mathpac.ent" >
%mathpac;

<!ENTITY % mathtxt "dfref | f" >
<!ENTITY % mathcon "df | dfg" >

<!--  The following entity declarations provide a mechanism for referencing
primitive elements in the Generic Layer, and within any Content Specific DTD. 
In SGML, an entity must be declared prior to an element referencing that
entity.  Therefore, all primitive entities have been moved to this section.  A
detailed description of each primitive will appear when the element is
declared later in this document.  -->

<!ENTITY % text    "text | text-alts" >
<!ENTITY % table   "table | table-alts" >
<!ENTITY % graphic "graphic | graphic-alts | grphprim | grphprim-alts" >
<!ENTITY % audio   "audio | audio-alts" >
<!ENTITY % video   "video | video-alts" >
<!ENTITY % process "process | process-alts" >
<!ENTITY % dialog  "dialog | dialog-alts" >
<!ENTITY % link    "link | hylink" >

<!--  The following entity provides a simple method for referencing the
primitive elements defined in the Generic Layer. -->

<!ENTITY % primitive "%text; | %table; | %graphic; | %audio;
                     | %video; | %process; | %dialog; | expression
                     | assertion" >

<!-- The Organizational Level List contains the reference types for the
Organization Level DTD. -->

<!ENTITY % orglvllist "system | descinfo | partinfo | task | partbase | step" >

<!-- The linkendlist is the entity directly referenced by the reftypes
attribute of a link or a hylink. It includes the standard types for the
generic layer and uses an entity to include those for derived DTDs. The
default O-level DTD is included using the orglvllist entity.  Targets for
other DTDs can be included with entities similiar to the orglvllist. This can
lead to overruning the capacity declarations in the SGML Declaration in which
case the required adjustments should be made (e.g., increase the capacity
declaration or remove unused targets in the list).  -->

<!ENTITY % linkendlist "(%orglvllist; | text | table | graphic
                        | audio | video | para | process | dialog
                        | expression | assertion | entry)" >

<!-- *******************************************************

                      NOTATION DECLARATIONS

     *******************************************************

     The following notations define external references to "public" graphics
standards used in the CDM.  The specified abbreviations (cgmbin, cgmclear,
cgmchar, fax, faxtile, iges) are used by the element "grphpirm" to specify the
type of graphic representation used to encode a particular graphic primitive.
-->

<!NOTATION   cgmbin      PUBLIC "ISO 8632/2//NOTATION Binary
encoding//EN">

<!NOTATION   cgmchar     PUBLIC "ISO 8632/2//NOTATION Character
encoding//EN">

<!NOTATION   cgmclear    PUBLIC "ISO 8632/2//NOTATION Clear text
encoding//EN">

<!NOTATION   fax         PUBLIC "-//USA-DOD//NOTATION CCITT Group
4 Facsimile Type 1 Untiled Raster//EN">

<!NOTATION   faxtile     PUBLIC "-//USA-DOD//NOTATION CCITT Group
4 Facsimile Type 2 Tiled Raster//EN">

<!NOTATION   iges        PUBLIC "-//USA-DOD//NOTATION (ASME/ANSI Y14.26M-1987)
Initial Graphics Exchange Specification//EN">

<!-- NOTE: The following notation (bitmap) is used in the document instance
example of the Organizational Level DTD in this Guide.  This commercial
notation is not included in CALS standards. The status and use of commercial
data formats for MIL-D-87269 deliverables is determined by the procuring
agency. -->

<!NOTATION   bitmap      PUBLIC "+//ISBN 0-7923-9432-1::Graphic
Notation//NOTATION Microsoft Windows bitmap//EN" >

<!-- The following NOTATION declaration is used for external SGML document
instances, e.g., to break up data base files into smaller sets. -->

<!NOTATION   SGML        PUBLIC "+//ISO 8879:1986//NOTATION Standard
Generalized Markup Language//EN">

<!-- To use the SGML entity for external references, declare an entity as
follows:
        <!ENTITY database3 system "database3.sgm" CDATA SGML>
-->

<!-- ********************************************************

                            ROOT ENTITY

     ********************************************************

     The a.root entity enables a content specific layer to comply with the
support requirements for HyTime.  This entity is only used in the root element
of the DTD.  -->

<!ENTITY % a.root
                    "HyTime    CDATA #IMPLIED
                     boslevel  CDATA #IMPLIED" >

<!-- ********************************************************

                            TEMPLATES

     ********************************************************

     NOTE:  MIL-D-87269 architectural forms begin with the term "element" in
lowercase to distinguish them from element type definitions per the
conventions of ISO 10744. Do not attempt to uncomment these and use them as
element type definitions.

     The following section defines the generic layer templates. These
templates define semantic rules for creating content specific elements.  These
semantic rules make up the minimum set of constraints on content specific
elements.

     There are two general rules to follow when creating a content specific
element.  First, the element's content model must comply with the template's
content model.  Second, the template's attribute entity must be included in
the element's attribute list.  The attribute entities for all templates
include the attributes "id", "cdm", "ref".  The "cdm" attribute indicates
which template the element is employing.  The "id" and "ref" attributes are
used for non-redundant referencing and linking.

The "ref" attribute utilizes the SGML #IMPLIED capability.  A #IMPLIED attribute
is only filled in when the element's content model is empty.  In this case,
the #IMPLIED attribute contains a reference which is a unique identifier to
either an element of the appropriate type or a location element that resolves
to an element of the appropriate type (see section on Hytime linking
mechanism).  When an element uses the #IMPLIED capability, the referencer's
attribute list will take precedence over the referenced element's attributes.

This section includes an element declaration for each template (NODE,
NODE-ALTS, NODE-SEQ, IF-NODE, LOOP-NODE).  The declarations are enclosed
within comments, and are not formally a part of the DTD.  These element
declarations use template names, in all caps, to describe content model
constraints for each template.  When creating content specific elements, these
template names must be replaced by element names of the appropriate type.

The "hylink" element utilizes the HyTime ilink capability. In this case, a
hylink is a reference which is a unique identifier to a location element that
resolves to an element of the appropriate type (see section on HyTime linking
mechanism).

The "link" element is a simpler version of the HyTime linking mechanism. This
link provides a capability to link only within the IETMDB using the SGML
#IMPLIED feature.  -->

              <!-- *****  NODE TEMPLATE  ***** -->

<!-- The NODE contains the content of the technical information. The NODE
element creates hierarchy within the CDM.  NODE also contains context
filtering preconditions and postconditions.  The link entity within the NODE
provides the capability to cross reference other technical information, both
internal (link element) and external (hylink element) to the IETMDB.  The use
of link, from the Hytime model, provides additional functionality by allowing
a link to be made to a document outside the CDM specification boundary.

The NODE template provides the capability to create composite structures
within the content specific layer. Composite structures may contain
subcomponents that employ the NODE, NODE-ALTS, or NODE-SEQ templates.  The
NODE subcomponents may be composite structures themselves or they may be
primitive NODES (text, tables, graphics, audio, video, process, and dialog).
Composite structures create hierarchy within the CDM.  When composite nodes
contain other composite nodes there is an implied hierarchy.  The composite
node in the content-model is at a lower level in the hierarchy (e.g. a
Task-Node contains Step-Nodes in its content model).

      The following defines the NODE template:

<!element "NODE"  - -  (precond*, (%link;)*, ( NODE | NODE-ALTS |
                        NODE-SEQ | %primitive; )*, postcond*) >

-->

<!ENTITY % a.node
                    "id        ID         #IMPLIED
                     name      CDATA      #IMPLIED
                     type      CDATA      #IMPLIED
                     itemid    CDATA      #IMPLIED
                     cdm       CDATA      #FIXED     'node'
                     ref       IDREF      #IMPLIED" >

<!--  The following semantic rules apply to any content specific element
employing the NODE template: (1) The element may contain a list of
preconditions that identify the element's applicability.  The list of
preconditions will be evaluated at presentation time, and if all preconditions
evaluate to true, that node will be presented. (2) The element may contain
relational links to other data items. (3) The element may contain
subcomponents that employ the NODE, NODE-ALTS, or NODE-SEQ templates. (4) The
element may contain a list of postconditions which record presentation events.
The postconditions will be evaluated after the NODE and all its subcomponents
have been presented.  The postcondition values will then be assigned to their
specified properties.  -->

            <!-- *****  NODE-ALTS TEMPLATE  ***** -->

<!--  NODE-ALTS  (node alternatives) will contain a list of mutually exclusive
nodes.  Their grouping is due to the fact that they apply in different
contextual situations.  In this manner, the NODE-ALTS element is a logical
reference that contains a set of NODES which might apply to different
situations.  An important fact in the NODE-ALTS structure is that no hierarchy
is implied between the generic identifier and the content model NODES (e.g. a
Task-alts element will contain Task-nodes in its content model).

     The following defines the NODE-ALTS template:

<!element "NODE-ALTS"       - -        ( NODE )+ >

-->

<!ENTITY % a.node-alts
          "id       ID        #IMPLIED
           cdm      CDATA     #FIXED    'node-alts'
           ref      IDREF     #IMPLIED"                   >

<!--  The following semantic rules apply to any content specific element
employing the NODE-ALTS template. (1) The element must contain components that
employ the NODE template. (2) The components must be of the same element type
and at the same level in the hierarchy. (3)  At presentation time, the
precondition for each NODE alternative will be evaluated.  The NODE whose
precondition evaluates to "true" will be selected for presentation. (4) These
components must contain mutually exclusive preconditions.  In any specific
situation, at most one node would have a precondition which evaluates to true.
(5) There need not be an applicable component for every possible situation.
-->
            <!-- *****  NODE-SEQ TEMPLATE  ***** -->

<!--  The NODE-SEQ template is the mechanism for creating interactive
sequences with the user.

     The following defines the NODE-SEQ template:

<!element "NODE-SEQ"   - -    ( NODE | NODE-ALTS | IF-NODE |
                                LOOP-NODE )+ >

-->

<!ENTITY % a.node-seq
          "id       ID        #IMPLIED
           cdm      CDATA     #FIXED    'node-seq'
           ref      IDREF     #IMPLIED"                  >

<!--  The following semantic rules apply to the NODE-SEQ template. (1) Any
content specific element employing NODE-SEQ must contain components that
employ the NODE, NODE-ALTS, IF-NODE, or LOOP-NODE templates. (2) The
components of a NODE-SEQ are always traversed in the order they appear.  This
traversal includes the branching and iteration implicit in any IF-NODES or
LOOP-NODES in the sequence logic.  -->

             <!-- *****  IF-NODE TEMPLATE  ***** -->

<!--  The IF-NODE template uses the same logic as the IF-THEN-ELSE statement
in a programming language.  The "IF" part is the expression in the
content-model.   The "THEN" part is the first NODE-SEQ; the "ELSE" part is the
second NODE-SEQ, which is optional.

     The following defines the IF-NODE template:

<!element "IF-NODE"   - -     ( expression, NODE-SEQ, NODE-SEQ? ) >

-->

<!ENTITY % a.if-node
          "id       ID        #IMPLIED
           cdm      CDATA     #FIXED    'if-node'
           ref      IDREF     #IMPLIED"                  >

<!--  The following semantic rules apply to the IF-NODE template. (1)  The
expression will be evaluated at presentation time; (2) If the expression
evaluates to "true" the first NODE-SEQ will be traversed; (3) If the
expression evaluates to anything but "true", and the second NODE-SEQ is
present, the second NODE-SEQ is traversed. (4) If the expression evaluates to
anything but "true", and the second NODE-SEQ is not present, the next element
in the sequence will be presented. -->

            <!-- *****  LOOP-NODE TEMPLATE  ***** -->

<!--  The LOOP-NODE template provides the capability similar to that found in
a programming language for creating loops.  The template provides the syntax
for creating WHILE or FOR-NEXT loops, whichever applies to the situation.  For
example, when creating a FOR-NEXT loop, the first assertion initializes the
control variable for the loop.  The expression is the test criterium for
exiting the loop.  The second assertion alters the control variable at the end
of each loop iteration.  The node sequence provides the actual element(s) to
be repeated within the loop.

     The following defines the LOOP-NODE template:

<!element "LOOP-NODE"    - -    ( assertion?, expression,
                                  assertion?, NODE-SEQ ) >

-->
<!ENTITY % a.loop-node
          "id       ID        #IMPLIED
           cdm      CDATA     #FIXED    'loop-node'
           ref      IDREF     #IMPLIED"                       >

<!--  The following semantic rules apply to the LOOP-NODE template, when
employing it as in a FOR-NEXT loop. (1) At the beginning of the loop the first
assertion is evaluated and the value is assigned to the specified property.
(2) The expression is evaluated and if the expression evaluates to anything
but "true" the loop is terminated. (3) If the expression evaluates to true,
the NODE-SEQ is traversed. (4)  At the end of each iteration, the second
assertion is evaluated and the value is assigned to the specified property.
(5) Steps 2-4 are continued until the loop terminates.

     The semantic rules which apply to the LOOP-NODE template, when employing
it as in a WHILE loop, are as follows. (1)  The expression is evaluated and if
the expression evaluates to anything but "true" the loop is terminated. (2) 
If the expression evaluates to true, the NODE-SEQ is traversed. (3) Steps 1-2
are continued until the loop terminates.

     ********************************************************

                    LINKING MECHANISM

     ********************************************************

     This section defines the simple linking mechanism used for
linking internal to the IETMDB.  -->

<!ELEMENT link     ( #PCDATA )  >
<!ATTLIST link
          id             ID             #IMPLIED
          endtypes       %linkendlist;  #REQUIRED
          linkends       IDREFS         #REQUIRED  >

<!--  The "link" element provides the capability for creating relational links
within the CDM.  "Link" is included within the content model of the NODE
template, therefore, any content specific element employing the NODE template
may include relational links.

  The 'endtypes' attribute identifies the type of primitive or element that
the link is pointing to, and the 'linkends' attribute contains the unique
identifier attribute (id) of the element being pointed to.

     ********************************************************

                    HYTIME LINKING MECHANISM

     ********************************************************

     This section defines the linking mechanism based on the HyTime standard. 
-->

<!ELEMENT hylink   ( #PCDATA )  >
<!ATTLIST hylink
          HyTime    CDATA     #FIXED 'ilink'
          id        ID        #IMPLIED
          anchrole  CDATA     #FIXED 'hotspot target #AGG'
          linkends  IDREFS    #REQUIRED
          reftype   CDATA     #FIXED 'linkends %linkendlist; #SEQ'
          extra     CDATA     'A A'
          intra     CDATA     'A A'
          endterms  IDREFS    #IMPLIED
          aggtrav   CDATA     #IMPLIED>

<!--  The "hylink" element provides the capability for creating
HyTime-compliant relational links within the CDM.  "Hylink" is included within
the content model of the NODE template, therefore, any content specific
element employing the NODE template may include relational HyTime links.  The
'anchrole' attribute identifies the type of primitive or element that the link
is pointing to, and the 'linkends' attribute contains the unique identifier
attribute (id) of the element being pointed to. -->

<!ELEMENT nmlist    ( #PCDATA ) >
<!ATTLIST nmlist
          HyTime    CDATA #IMPLIED
          nametype  (entity | element | unified) #REQUIRED
          obnames   (obnames | nobnames)         "nobnames"
          docorsub  ENTITY  #IMPLIED
          dtdorlpd  CDATA #IMPLIED >

<!ELEMENT nameloc   (nmlist)* >
<!ATTLIST nameloc
          HyTime    CDATA #IMPLIED
          id        ID      #REQUIRED
          ordering  (ordered | noorder)        "ordered"
          set       (set | notset)             "notset"
          aggloc    (aggloc | agglink | nagg)  "agglink" >

<!-- ********************************************************

                    PRIMITIVE ELEMENT DECLARATIONS

     ********************************************************

     The following element declarations define the primitive data elements
used throughout the technical information.  Each element is defined in terms
which can be employed in any content specific DTD.   -->

                   <!-- *****  TEXT  ***** -->

<!ELEMENT text      ( #PCDATA|precond|%link;| 
						text-alts | text | property
                        | %mathtxt; | %mathcon; )* >
<!ATTLIST text
          %a.node; >

<!--  A "text" unit is basically a text string of "parsable character data" or
PCDATA.  Within a text string, there may be embedded "text" elements which
allow the referencing of other elements or parts of elements through the link
or hylink/location mechanism explained in the HyTime section of this document.
Those embedded "text" references are inserted in the text string that
contained them.  For example, the string may contain a reference to a standard
system name, a standard part nomenclature or a standard task name.  By using
this mechanism, standard terminology can be referenced consistently throughout
the data base, and any changes to the standard terminology can be made in one
location and automatically updated throughout the data base.  -->

<!ELEMENT text-alts      ( text )+ >
<!ATTLIST text-alts
          %a.node-alts;                    >

<!--  This element provides the ability to have context sensitive filtering of
text.  -->

                  <!-- *****  TABLE  ***** -->

<!ELEMENT table       ( precond*, (%link;)*, rowhddef*,
                                 ( colhddef?, entry+ )+ ) >
<!ATTLIST table
          %a.node;                           >

<!--  This element defines how a table is constructed.  A "table" will contain
a list of the row headers.  Each column header will be followed by one or more
entries.  The combination of column header and entries may be repeated for as
many columns as the "table" requires.  -->

<!ELEMENT table-alts      ( table )+ >
<!ATTLIST table-alts
          %a.node-alts;                         >

<!--  This element provides the ability to have context sensitive filtering of
"tables".  -->

<!ELEMENT rowhddef    ( %text; ) >
<!ATTLIST rowhddef
            id               ID         #IMPLIED
            ref              IDREF      #IMPLIED
            row              NMTOKEN      #REQUIRED >

<!--  This element defines a row header to be a piece of text and a row
number.  However, if a row header has been previously defined, the 'ref'
attribute allows the referencing of that element from another table.  The
'row' for the element that references a previously defined header takes
precedence over the original 'row' in the referenced header.  -->

<!ELEMENT colhddef    ( %text; ) >
<!ATTLIST colhddef
            id               ID         #IMPLIED
            ref              IDREF      #IMPLIED
            colnum           NMTOKEN    #REQUIRED >

<!--  This element defines a column header to be a piece of text and a column
number.  However, if a column header has been previously defined, the 'ref'
attribute allows the referencing of that element from another table.  The
'colnum' for the element that references a previously defined header takes
precedence over the original 'colnum' in the referenced header.  -->

<!ELEMENT entry       ((%link;)*, ( %text; | %graphic; )) >
<!ATTLIST entry
            id               ID         #IMPLIED
            ref              IDREF      #IMPLIED
            colnum           NMTOKEN    #REQUIRED
            row              NMTOKEN    #REQUIRED >

<!--  This element defines an entry for a cell in a table to be a piece of
text and the appropriate row and column.  The row and column define the cell
to place the entry.  However, if an entry has been previously defined, the
'ref' attribute allows the referencing of that element from another table. 
The 'colnum' and 'row' for the element that references a previously defined
entry take precedence over the original 'colnum' and 'row'. -->

                 <!-- *****  GRAPHICS  ***** -->

<!--  The CDM allows the referencing of "graphics" in external representations
or embedded within the CDM.  Graphics are an integral part of technical
information.  Therefore, all possible standard representations have been
included within the following primitive elements.  -->

<!ELEMENT graphic    ( precond*, (%link;)*, ( %graphic;)+,
                               assertion* ) >
<!ATTLIST graphic
     %a.node;
     minsize        NMTOKENS            #IMPLIED 
     penshape       CDATA               #IMPLIED
     penpatt        CDATA               #IMPLIED
     transfrm       NMTOKENS            #IMPLIED
     window         NMTOKENS            #IMPLIED >

<!--  This element describes graphics in terms of primitives or references to
other graphics, thus providing the ability to create composite graphics.  -->

<!ELEMENT graphic-alts    ( graphic )+ >
<!ATTLIST graphic-alts
          %a.node-alts;   >

<!--  This element provides the ability to have context sensitive filtering of
graphics.  -->

<!ELEMENT grphprim     ( precond*, (%link;)*, (%text;) ) >
<!ATTLIST grphprim
     %a.node;
     coding         NOTATION (cgmchar  | cgmbin   | cgmclear | fax
                             | faxtile | iges     | bitmap ) 'cgmbin'
     minsize        NMTOKENS            #IMPLIED 
     penpatt        CDATA               #IMPLIED
     penshape       CDATA               #IMPLIED
     transfrm       NMTOKENS            #IMPLIED
     x-location     NMTOKEN             #IMPLIED
     y-location     NMTOKEN             #IMPLIED
     window         NMTOKENS            #IMPLIED
     external-ptr   ENTITY              #IMPLIED
     picid          NMTOKEN             #IMPLIED >

<!--  This element defines a primitive graphic which may be contained in the
content model or referenced by the 'ref' attribute.  The graphic is
represented in one of the valid formats (cgmbin, cgmchar, cgmclear, fax,
faxtile, iges), and the format is indicated by the coding attribute.  The
'type' attribute may identify a graphic as a "hotspot", thus making it
selectable during presentation.  The minsize attribute specifies the minimum
height requirements for display of the graphic.  Any transformations or
manipulations of the graphic, other than those described by the notations, can
be defined using the penpatt, penshape, transfrm, or window attributes on the
graphic primitive element.  -->

<!ELEMENT grphprim-alts        ( grphprim )+ >
<!ATTLIST grphprim-alts
          %a.node-alts;                               >

<!--  This element provides the ability to have context sensitive filtering of
graphic primitives.  -->

          <!-- *****  AUDIO, VIDEO & PROCESS  ***** -->

<!-- The elements "audio", "video", "process" provide the capability for the
author to define an audio sequence, video sequence, or a call to a software
process.  These element definitions require further inspection and updating,
which will be done upon completion of a closer look at the HyTime multi-media
event definitions. -->

<!ELEMENT audio     ( precond*, (%link;)* ) >
<!ATTLIST audio
          %a.node;
          external-ptr   ENTITY   #REQUIRED  >

<!--  This element will be used to include an audio sequence into technical
information.  The model is incomplete pending the Hytime completion.  -->

<!ELEMENT audio-alts  ( audio+ ) >
<!ATTLIST audio-alts
          %a.node-alts;               >

<!--  This element provides the ability to have context sensitive filtering of
audio sequences.  -->


<!ELEMENT video     ( precond*, (%link;)* ) >
<!ATTLIST video
          %a.node;
          external-ptr   ENTITY   #REQUIRED  >

<!--  This element will be used to include an video sequence into technical
information.  The model is incomplete pending the Hytime completion.  -->

<!ELEMENT video-alts  ( video+ ) >
<!ATTLIST video-alts
          %a.node-alts;               >

<!--  This element provides the ability to have context sensitive filtering of
video sequences.  -->

<!ELEMENT process   ( precond*, (%link;)*, parameter* ) >
<!ATTLIST process
          %a.node;
          external-ptr   CDATA   #REQUIRED    >

<!--  This element is used to reference an external software process.  The
external pointer attribute will point to a location element defined within
Hytime.  The parameter element will provide some expression for passing
parameters to the software process.  -->

<!ELEMENT process-alts  ( process+ ) >
<!ATTLIST process-alts
          %a.node-alts;   >

<!--  This element provides the ability to have context sensitive filtering of
processes and reduces data redundancy through the referencing capability of
#IMPLIED.  -->

<!ELEMENT parameter     ( expression ) >
<!ATTLIST parameter
          mode      ( in | out | in-out )    'in' >

<!--  This element includes an expression which will be used to create the
parameters required by an external software process. For example: the 1553 bus
on the aircraft might require parameters concerning a given channel to look
up.  The parameter element will contain the channel required by the process.
-->

                 <!-- *****  DIALOGS  ***** -->

<!-- "Dialogs" provide interactivity between the user and the electronic
technical information.  It is sometimes necessary to receive data from the
user in order to present the proper information at the proper time.  "Dialogs"
provide the capability of prompting the user to input a response ("fillin"),
select a choice from a set of alternatives ("menu"), or to select items from
within a text, table or graphic ("selection").  -->

<!ELEMENT dialog      ( precond*, (%link;)*, ( %text;)?,
                              ( %dialog; | fillin | menu |
                              selection )+ ) >
<!ATTLIST dialog
          %a.node;
          agent      CDATA       #IMPLIED >

<!--  This element defines a "dialog" which provides the capability for user
interaction.  A "dialog" could contain a subdialog, a "fillin", a "menu", a
"selection", or any combination of the four.  It may also contain an optional
text string which would be the title of the composite dialog.  The 'agent'
attribute defines to whom the question is asked ( i.e. a technician or a 1553
Bus ).  -->

<!ELEMENT dialog-alts     ( dialog )+ >
<!ATTLIST dialog-alts
          %a.node-alts;                        >

<!--  This element provides the ability to have context sensitive filtering of
dialogs and reduces data redundancy through the referencing capability of
#IMPLIED.  -->

<!ELEMENT fillin  ( (%link;)*, prompt, property, ( %text; )?,
                        generic-range? ) >
<!ATTLIST fillin
          id             ID             #IMPLIED
          ref            IDREF          #IMPLIED  >

<!--  This element defines how a fill-in shall be constructed. It would
contain a "prompt", a "property", and an optional default value.  The "prompt"
contains the question to be presented to the user.  The property element
identifies the variable which will receive a value from the user's response.
The property element also identifies the value type of the user's response. 
The fill-in will be presented to the user according to the value type.  The
optional text element provides the capability for defining a default value for
the fill-in.  The generic range element may be used to provide a range for the
value(s) of the fill-in. -->

<!ELEMENT generic-range  ( set | sequence | num-range ) >

<!ELEMENT num-range  ( low-bound, high-bound ) >

<!ELEMENT low-bound  ( integer | real ) >

<!ELEMENT high-bound  ( integer | real ) >

<!--  These elements define two types of range constraints.  If the generic
range contains a set or sequence, then the contents of that set or sequence
become the constraints for the fillin. If the generic range contains a number
range, then the low and high bounds define the constraints for the fillin. -->

<!ELEMENT menu      ( (%link;)*, prompt, choice+ ) >
<!ATTLIST menu
          id             ID             #IMPLIED
          ref            IDREF          #IMPLIED
          select         ( single | multiple )  'single' >

<!--  This element defines how a "menu" is built for technical information. 
It consists of a "prompt" followed by one or more "choices".  The "select"
attribute allows the author to designate the number of choices that may be
selected by the user.   -->

<!ELEMENT prompt    ( %text; | %graphic; ) >
<!ATTLIST prompt
          id             ID             #IMPLIED
          ref            IDREF          #IMPLIED >

<!--  This element defines the "prompt" to be displayed to the user for the
presentation of a "fillin" or a "menu".  It allows the prompt to be either a
text string (probably in the form of a question) or a graphic (a picture which
requires an answer).  -->

<!ELEMENT choice    ( (%link;)*, ( %text; | %graphic; ),
                            ( assertion+ | %dialog;) ) >
<!ATTLIST choice
          id                 ID         #IMPLIED
          ref                IDREF      #IMPLIED
          default        ( Yes | No )   'No'  >

<!--  This element defines the choices for a menu.  A "choice" contains an
optional "link", a "text" or "graphic" element followed by an assertion or
"dialog" element.  The "link" can be used for example to reference additional
information on the "choice".  The "text" or "graphic" element will be
displayed to the user as a part of the menu.  The assertion or dialog
identifies the action to be taken if the user selects that choice.  The
default attribute provides a method of indicating whether a choice is
designated as a default for the menu.   -->

<!ELEMENT selection  ( ( (%link;)*, ( assertion+ | %dialog; ) )+,
                            ( text | table | graphic ) ) >
<!ATTLIST selection
          id             ID             #IMPLIED
          ref            IDREF          #IMPLIED >

<!--  This element provides the capability of creating a special "dialog" that
allows selection within a given picture, text string or table.  The semantics
require a 'link' for each selectable item within the text, table, or graphic
selection. Each 'link' must have at least one linkend specifying the
selectable element in the text, table, or graphic.  Each link will be paired
with an assertion or dialog specifying the action to be taken if that item is
selected.   -->

<!--********************************************************

               CONTEXT FILTERING ELEMENT DECLARATIONS

     ********************************************************

     Context dependent filtering provides the capability to present the user
with only the information that applies to his specific situation.  The
precondition and postcondition elements provide the mechanism for context
dependent filtering.  The precondition element enables the selection of the
appropriate information for presentation.  The postcondition element enables
the recording of presentation events for later filtering.

     This mechanism assumes that a state table is maintained at presentation
time to represent the current situation.   The current situation or state is
defined by a set of property-value pairs.  A property-value pair associates a
value to a property name.  It provides the capability to obtain a value by
looking up a property name in the state table.  -->

<!ELEMENT precond    ( expression ) >
<!ATTLIST precond
           id               ID                   #IMPLIED
           ref              IDREF                #IMPLIED  >

<!--  A precondition contains an expression to be evaluated at presentation
time.  The precondition is satisfied if the evaluation results in "true".  -->

<!ELEMENT postcond    ( assertion ) >
<!ATTLIST postcond
            id               ID         #IMPLIED
            ref              IDREF      #IMPLIED >

<!--  The postcondition contains an assertion which is evaluated whenever the
node containing the postcondition is traversed. After a NODE has been
presented, the assertion will be evaluated and the appropriate property-value
pairs will be asserted.  The most recent assignment will overwrite any
previous value.   -->

<!ENTITY % binop  " eq | ne | lt | gt | le | ge | and | or
                    | xor | concat | substring | append
                    | plus | minus | times | divide
                    | idivide | exponent | mod | remove
                    | union | intersect | set-diff
                    | member | subset | disjoint | add
                    | subsequence " >

<!--  The binary operation entity enumerates all of the possible binary
operators which may be used within an expression.  -->

<!ENTITY % unop  " not | empty | size | head | tail | neg
                   | remove | trunc | float | index | undef
                   | max | min" >

<!--  The unary operation entity enumerates all of the unary operators which
may be used within an expression.  -->

<!ENTITY  % value  " boolean | string | sequence | set
                     | real | integer | nil " >

<!--  This entity enumerates the legal value types which properties may
contain.    -->

<!ELEMENT expression   ( ( expression, (%binop;),expression)
                            | (( %unop;), expression )
                            | property | (%value;) ) >
<!ATTLIST expression
          id        ID        #IMPLIED
          ref       IDREF      #IMPLIED  >

<!--  The expression element contains one of four types of subexpressions: a
binary operation between two expressions, a unary operation upon an
expression, a property, or a value. If the expression contains a binary or
unary operation, the value is defined by the semantic rules specified later in
this section. If the expression contains a property, the value of the
expression is obtained by looking up the current value of the property in the
state table. If the expression contains a value, that value is returned as the
result.  -->

<!ELEMENT assertion  ( property, expression ) >
<!ATTLIST assertion
              id            ID             #IMPLIED
              ref           IDREF          #IMPLIED  >

<!--  The assertion element provides the mechanism for pairing a value with a
property.  The semantics of assertions vary from postconditions.  When an
assertion is present in a node, the presentation rules for that content
specific element will determine whether the assertion is evaluated.  -->
<!ELEMENT eq EMPTY >
<!ELEMENT ne EMPTY >
<!ELEMENT lt EMPTY >
<!ELEMENT gt EMPTY >
<!ELEMENT le EMPTY >
<!ELEMENT ge EMPTY >
<!ELEMENT and EMPTY >
<!ELEMENT or EMPTY >
<!ELEMENT xor EMPTY >
<!ELEMENT concat EMPTY >
<!ELEMENT substring EMPTY >
<!ELEMENT plus EMPTY >
<!ELEMENT minus EMPTY >
<!ELEMENT times EMPTY >
<!ELEMENT divide EMPTY >
<!ELEMENT idivide EMPTY >
<!ELEMENT exponent EMPTY >
<!ELEMENT mod EMPTY >
<!ELEMENT union EMPTY >
<!ELEMENT intersect EMPTY >
<!ELEMENT set-diff EMPTY >
<!ELEMENT member EMPTY >
<!ELEMENT subset EMPTY >
<!ELEMENT disjoint EMPTY >
<!ELEMENT append EMPTY >
<!ELEMENT subsequence EMPTY >
<!ELEMENT not EMPTY >
<!ELEMENT empty EMPTY >
<!ELEMENT size EMPTY >
<!ELEMENT head EMPTY >
<!ELEMENT tail EMPTY >
<!ELEMENT neg EMPTY >
<!ELEMENT trunc EMPTY >
<!ELEMENT float EMPTY >
<!ELEMENT undef EMPTY >
<!ELEMENT max EMPTY >
<!ELEMENT min EMPTY >

<!ELEMENT add  ( index-value )? >

<!ELEMENT remove   ( index-value, index-value? )? >

<!ELEMENT index     ( index-value, index-value? ) >

<!ELEMENT index-value    ( #PCDATA )  >

<!--  The above elements are used to identify the operators which may be
applied in an expression.  -->

<!ELEMENT property       ( #PCDATA ) >
<!ATTLIST property
          id                  ID        #IMPLIED
          ref                 IDREF     #IMPLIED
          type                CDATA     #REQUIRED
          value-type          CDATA     'general'
          dialog-ref          IDREF     #IMPLIED>

<!--  The property element contains parsable character data which represents
the property (variable) name.  The value of a property may be obtained by
finding the current value associated with the property name in the state
table.

The 'type' attribute contains a character string which may be used by the
author to identify different property classes.  The 'value-type' attribute is
used to denote the allowable data types which may be assigned to the property.
The current legal values for 'value-type' are any combination of the
following: "boolean", "integer", "real", "set", "sequence", "string", and
"general". The 'dialog-ref' attribute will hold the IDREF of a "dialog" or
"process" element which will acquire a value for the property, if "property"
is undefined (i.e., equal to "nil") at presentation time.  -->

<!ELEMENT boolean ( #PCDATA ) >
<!ELEMENT string ( #PCDATA ) >
<!ELEMENT real ( #PCDATA ) >
<!ELEMENT integer ( #PCDATA ) >

<!--  These elements define the values boolean, string, real, and integer to
be character data.  -->

<!ELEMENT set ( %value; )* >
<!ELEMENT sequence ( %value; )* >

<!--  These element are used to define a set or sequence as being zero, one or
more values.  -->

<!ELEMENT nil             EMPTY >

<!--This element signifies that the value of the associated property is
undefined. Property's of any type can take on the "nil" value.  -->

<!-- ************************************************************

                  Semantics of expression operations

     ************************************************************

Listed below are the value-types allowed in the generic layer and the valid
operators under each value-type, and the semantics of each operation including
the return value-type.

OPERATIONS WHICH APPLY TO MULTIPLE DATATYPES:

Operation:     <eq|ne>
Form:          <value><eq|ne><value>
Return Value:  <boolean>
Meaning:       If both operands are the same value-type (or both
               are numbers ) then the return value is dependent
               upon what eq|ne means for that value-type. If the
               operands are of different types, the return value
               is 'False'.

Operation:     <size>
Form:          <size><string>
               <size><sequence>
               <size><set>
Return Value:  <boolean>
Meaning:       An integer value which is the length of the
               <string> or the number of values in the
               <set|sequence>. For <set|sequence> this
               number represents the members of the
               <set|sequence>. It does not count the
               elements which are members of an included
               <set|sequence>.

Operation:     <empty>
From:          <empty><string>
               <empty><set>
               <empty><sequence>
Return Value:  <boolean>
Meaning:       True if the string, set, or sequence is
               empty.  False otherwise. Logically
               equivalent to size(<..>) = 0.

Operation:     <index>
Form:          <index><string>
               <index><sequence>
Return Value:  <string> | <sequence>
Meaning:       The index operator can have one or two
               index-values in its SGML content. An
               index-value  is a signed integer value. Its
               meaning is dependent upon its sign. A
               positive value means an index position
               counted from the beginning of the
               <string|sequence>.  A negative number means
               an index position counted back from the end
               of the <string|sequence>.  A zero means the
               end of the string.

Operation:     <add>
Form:          <set><add><value>
               <sequence><add><value>
Return Value:  <set> | <sequence>
Meaning:       For a set, add simply means make a new set which
               has all the members of the old set plus <value>.
               For a sequence the add operator shall have an
               index-value as described above for the index
               operation. The <value> will be inserted
               before the position pointed to by the
               index position.  If no index-value is given the
               <value> is added at the end of the sequence.

Operation:     <remove>
Form:          <set><remove><value>
               <sequence><remove><value>
               <remove><sequence>
               <remove><string>
Return Value:  <set> | <sequence> | <string>
Meaning:       For a <set> remove returns a <set> with <value>
               removed.  For a <sequence> using the binary
               operand form it returns a <sequence> which has
               the first instance of <value> removed.  For a
               <sequence> or <string> as a unary operator remove
               must contain an index-value which refers to the
               position from which the character in the <string>
               is to be removed or the value in the <sequence>
               is to be removed. The new string or sequence will
               be the old one up to but not including the index
               position concatenating with the old one after the
               index position.

Operation:     <member>
Form:          <value><member><set>
               <value><member><sequence>
Return Value:  <boolean>
Meaning:       True if <set|sequence> contains an member who is
               equal to <value>. False otherwise. This is not a
               recursive search on any <set|sequence> that
               might be part of the <set|sequence>.

BOOLEAN OPERATIONS:

Operation:      <or>
Form:           <boolean><or><boolean>
Return Value:   <boolean>
Meaning:        The boolean or function.

Operation:      <and>
Form:           <boolean><and><boolean>
Return Value:   <boolean>
Meaning:        The boolean and function.

Operation:      <xor>
Form:           <boolean><xor><boolean>
Return Value:   <boolean>
Meaning:        The boolean xor function.

Operation:      <not>
Form:           <not><boolean>
Return Value:   <boolean>
Meaning:        The boolean not function.

STRING OPERATIONS:

Operation:     <concat>
Form:          <string><concat><string>
Return Value:  <string>
Meaning:       The return value is a new string which is equal to
               the first string with the second string
               concatenated to the end of it.

Operation:     <empty>
Form:          <empty><string>
Return Value:  <boolean>
Meaning:       True if the string is empty ( size = 0 ). False
               otherwise.  This is equivalent to size
               ( <string> = 0 ).

Operation:     <substring>
Form:          <string><substring><string>
Return Value:  <boolean>
Meaning:       True if the first string is a substring of the
               second string. False otherwise.

SEQUENCE OPERATIONS:

Operation:     <append>
Form:          <sequence><append><sequence>
Return Value:  <sequence>
Meaning:       A new sequence equal to the first sequence
               with the second sequence appended to the
               end.

Operation:     <subsequence>
Form:          <sequence><subsequence><sequence>
Return Value:  <boolean>
Meaning:       True if the first sequence is a subsequence
               of the second.   False otherwise.

Operation:     <head>
Form:          <head><sequence>
Return Value:  <value>
Meaning:       Returns the first element in sequence.

Operation:     <tail>
Form:          <tail><sequence>
Return Value:  <sequence>
Meaning:       Returns a sequence with the first element
               removed.

SET OPERATIONS:

Operation:     <union>
Form:          <set><union><set>
Return Value:  <set>
Meaning:       A new set which is the union of the two sets.

Operation:     <intersect>
Form:          <set><intersect><set>
Return Value:  <set>
Meaning:       A new set which is the intersection of the two
               sets.

Operation:     <set-diff>
Form:          <set><set-diff><set>
Return Value:  <set>
Meaning:       A new set which is the difference of the two
               sets.

Operation:     <disjoint>
Form:          <set><disjoint><set>
Return Value:  <boolean>
Meaning:       True if the intersection of the two sets is


               empty.  False otherwise. This is equivalent to
               empty( <set1> intersect <set2>).

Operation:     <subset>
Form:          <set><subset><set>
Return Value:  <boolean>
Meaning:       True if the first set is a subset of the second.
               False otherwise.

NUMBER OPERATIONS:

Operation:     <gt>
Form:          <integer><gt><integer>
               <integer><gt><real>
               <real><gt><integer>
               <real><gt><real>
Return Value:  <boolean>
Meaning:       True if the first number is greater than the
               second.  False otherwise.

Operation:     <ge>
Form:          <integer><ge><integer>
               <integer><ge><real>
               <real><ge><integer>
               <real><ge><real>
Return Value:  <boolean>
Meaning:       True if the first number is greater than  or
               equal to the second. False otherwise.

Operation:     <lt>
Form:          <integer><lt><integer>
               <integer><lt><real>
               <real><lt><integer>
               <real><lt><real>
Return Value:  <boolean>
Meaning:       True if the first number is less than the second.
               False otherwise.

Operation:     <le>
Form:          <integer><le><integer>
               <integer><le><real>
               <real><le><integer>
               <real><le><real>
Return Value:  <boolean>
Meaning:       True if the first number is less than  or equal
               to the second. False otherwise.

Operation:     <plus>
Form:          <integer><plus><integer>
               <integer><plus><real>
               <real><plus><integer>
               <real><plus><real>
Return Value:  <integer> | <real>
Meaning:       Return the value of the first number plus the
               second number. The return value is a real unless
               both numbers are integers.

Operation:     <minus>
Form:          <integer><minus><integer>
               <integer><minus><real>
               <real><minus><integer>
               <real><minus><real>
Return Value:  <integer> | <real>
Meaning:       Return the value of the first number minus the
               second number. The return value is a real unless
               both numbers are integers.

Operation:     <times>
Form:          <integer><times><integer>
               <integer><times><real>
               <real><times><integer>
               <real><times><real>
Return Value:  <integer> | <real>
Meaning:       Return the value of the first number times the
               second number. The return value is a real unless
               both numbers are integers.

Operation:     <divide>
Form:          <integer><divide><integer>
               <integer><divide><real>
               <real><divide><integer>
               <real><divide><real>
Return Value:  <real>
Meaning:       Return the value of the first number divided by
               the second number. The return value is a real.

Operation:     <idivide>
Form:          <integer><idivide><integer>
               <integer><idivide><real>
               <real><idivide><integer>
               <real><idivide><real>
Return Value:  <integer>
Meaning:       Return the value of the first number divided by
               the second number. The return value is truncated
               to an integer.

Operation:     <exponent>
Form:          <integer><exponent><integer>
               <integer><exponent><real>
               <real><exponent><integer>
               <real><exponent><real>
Return Value:  <integer> | <real>
Meaning:       Return the value of the first number raised to
               the power of the second number. The value is a
               real unless the first number is an integer and
               the second number is a positive integer.

Operation:     <mod>
Form:          <integer><mod><integer>
Return Value:  <integer>
Meaning:       The return value is equal to the integer
               remainder after the first number is
               integer-divided by the second. ( This is the
               standard definition of the mod operator ).

Operation:     <neg>
Form:          <neg><integer>
               <neg><real>
Return Value:  <integer> | <real>
Meaning:       The return value is the negative of the number.
               It is an integer if the number is an integer, and
               real if the number is a real.

Operation:     <trunc>
Form:          <trunc><integer>
               <trunc><real>
Return Value:  <integer>
Meaning:       The return value is the number truncated to
               be an integer.

Operation:     <float>
Form:          <float><integer>
               <float><real>
Return Value:  <real>
Meaning:       The return value is the number converted to
               a real number value.
-->

