7.1 DSSSL Document Architecture
The DSSSL document architecture is defined by the following meta-DTD.
<!-- DSSSL Document Architecture -->

<!ENTITY % declarations
 "features | baseset-encoding | literal-described-char | add-name-chars
  | add-separator-chars | standard-chars | other-chars
  | combine-char | map-sdata-entity | char-repertoire | sgml-grove-plan"
>

<!element dsssl-specification - O
          ((%declarations;)*,
           (style-specification | transformation-specification
            | external-specification)+)>
<!attlist dsssl-specification
          dsssl NAME dsssl-specification
          version CDATA #FIXED "ISO/IEC 10179:1996"
>

<!element transformation-specification - O
          ((%declarations;)*, transformation-specification-body*)>
<!attlist transformation-specification
          dsssl NAME transformation-specification
          id ID #IMPLIED
          desc CDATA #IMPLIED
          -- human readable description of specification --

          partial (partial | complete) complete
          -- is the specification complete is or is it just a fragment
             to be used in other specifications? --

          use
          -- reftype(transformation-specification|external-specification) --
              IDREFS #IMPLIED -- Default: none --

          entities
          -- entities available to be specified as DTD for validation
             of result document --
              ENTITIES #IMPLIED -- Default: none --
>

<!element style-specification - O
          ((%declarations;)*, style-specification-body*)>
<!attlist style-specification
          dsssl NAME style-specification
          id ID #IMPLIED
          desc CDATA #IMPLIED
          -- human readable description of specification --

          partial (partial | complete) complete
          -- is the specification complete is or is it just a fragment
             to be used in other specifications? --

          use   -- reftype(style-specification|external-specification) --
             IDREFS #IMPLIED -- Default: none --
>

<!-- Assign a local ID to a specification in another document. -->
<!element external-specification - O EMPTY>
<!attlist external-specification
          dsssl NAME external-specification
          id ID #REQUIRED
          document -- document containing spec --
                  ENTITY #REQUIRED
          specid -- id of spec in document --
                  NAME #IMPLIED -- Default: first spec in document --
>

<!-- Declares features used by specification. -->

<!element features - O (#PCDATA)
  -- lextype(featurename*) -->
<!attlist features
          dsssl NAME features
>

<!-- Map character numbers in a base character set to character names;
not needed when system knows a character set, and all characters
in character set have universal code. -->
<!element baseset-encoding - O (#PCDATA)
  -- lextype((number, charname)*) -->
<!attlist baseset-encoding
          dsssl NAME baseset-encoding
          name CDATA #REQUIRED -- public identifier of baseset --
>

<!-- Map a character described in the SGML declaration with a minimum literal
to a character name. -->
<!element literal-described-char - O (#PCDATA)
  -- lextype(charname) -->
<!attlist literal-described-char
          dsssl NAME literal-described-char
          desc CDATA #REQUIRED -- the literal description --
>

<!-- Declare additional characters allowed in name within DSSSL notation. -->
<!element add-name-chars - O (#PCDATA)
  -- lextype(charname*) -->
<!attlist add-name-chars
          dsssl NAME add-name-chars
>

<!-- Declare additional characters allowed as separators within
     DSSSL notation. -->
<!element add-separator-chars - O (#PCDATA)
  -- lextype(charname*) -->
<!attlist add-separator-chars
          dsssl NAME add-separator-chars
>

<!-- Define characters associating names with universal codes. -->

<!element standard-chars - O (#PCDATA)
  -- lextype((charname, number))*) -->
<!attlist standard-chars
          dsssl NAME standard-chars
>

<!-- Define characters with no universal codes. -->

<!element other-chars - O (#PCDATA)
  -- lextype(charname*) -->
<!attlist other-chars
          dsssl NAME other-chars
>

<!-- Map an SDATA entity onto a character. -->

<!element map-sdata-entity - O (#PCDATA)
  -- lextype(charname) -->
<!attlist map-sdata-entity
         dsssl NAME map-sdata-entity
         name CDATA #IMPLIED -- Default: mapping uses replacement text only --
         text CDATA #IMPLIED -- Default: mapping uses name only --
>

<!-- Declare character combining. -->

<!element combine-char - O (#PCDATA)
  -- lextype(charname, charname, charname+) -->
<!attlist combine-char
          dsssl NAME combine-char
>

<!-- Declare a character repertoire. -->
<!element char-repertoire - O EMPTY>
<!attlist char-repertoire
          dsssl NAME char-repertoire
          name -- public identifier for repertoire --
               CDATA #REQUIRED
>
<!-- Declare the grove plan for the SGML property set. -->
<!element sgml-grove-plan - O EMPTY>
<!attlist sgml-grove-plan
          dsssl NAME sgml-grove-plan
          modadd -- names of modules to be added to default grove plan --
               NAMES #IMPLIED -- Default: none added --
>

<!element style-specification-body - - CDATA
  -- content uses notation of DSSSL style language -->
<!attlist style-specification-body
          dsssl NAME style-specification-body
          content ENTITY #CONREF -- Default: syntactic content --
>

<!element transformation-specification-body - - CDATA
  -- content uses notation of DSSSL transformation language -->
<!attlist transformation-specification-body
          dsssl NAME transformation-specification-body
          content ENTITY #CONREF -- Default: syntactic content --
>
The element type form dsssl-specification is a container for one or more process specification element type forms. Declaration elements in a dsssl-specification element apply to all the process specification elements in the dsssl-specification element.
There are two types of process specification element type forms.  The element type form transformation-specification specifies a transformation process.  The element type form style-specification specifies a formatting process.  Instances of these element type forms are called process specification elements. Each process specification element may be self-contained, or it may make use of other process specification elements of the same type. Process specification elements are identified by an SGML unique identifier.  A process specification element in one SGML document may use a process specification element in another SGML document by using the external-specification element type form to assign a local unique identifier to the process specification element in the other document.  The combination of a process specification element with the process specification elements that it uses is a process specification.
A user specifies processing of an SGML document by identifying a process specification element. The manner in which these elements are identified is system-dependent.

NOTE 4

A system may identify a process specification element with a system identifier for the document and an optional unique identifier for the element within the document, with the first process specification element in a document being used if no unique identifier is specified.
Each process specification element may contain elements, called body elements, whose content specifies processing in a process-specific notation.  For a transformation-specification, this notation is the DSSSL transformation language; for a style-specification, this notation is the DSSSL style language.  In addition, each process specification element may contain declaration elements that contain information needed to parse these notations.
The process specification described by a sequence of process specification elements is considered as a sequence of parts, where each part consists of declarations expressed using element type forms, and a specification in the process-specific notation, called the body of the part.  The parts from a sequence of process specification elements consist of the sequence of parts from the first process specification element, followed by the sequence of parts from the next process specification element, and so on.  The sequence of parts from a single process specification element consists of a part constructed from the content of the process specification element followed by the sequence of parts from the sequence of process specification elements that it uses.  The declarations in the first part comprise the declarations contained in the process specification element together with those contained in the dsssl-specification element that contains the process specification element.  The body of the first part consists of the concatenation of the body elements contained in the process specification element.
A process specification shall be processed by first processing the declarations of all of the parts, and then processing the bodies of all of the parts in order.  Within a single part, there shall not be conflicting declarations; when two declarations in different parts conflict, the declaration in the earlier part shall take precedence. Similarly, within the body of a single part, there shall not be conflicting specifications, but when two specifications in the bodies of different parts conflict, the specification in the earlier part shall take precedence.
The declarations of a process specification shall specify how each bit combination occurring in the bodies of the parts of the specification and in all the SGML input documents are to be converted to characters. Declarations may occur in any order. In particular, character names may be used before they are declared.
Every character name used either in declarations or in body elements shall be declared using either a standard-chars element type form, an other-chars element type form, or a char-repertoire element type form.
All declaration element type forms other than the char-repertoire, features, and sgml-grove-plan  element type forms require the charset feature.