XML technologies / DocBook / Customizing DocBook / DocBook 4 structure / DocBook Parameter entities

(Excerpt from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" by Thomas Schraitle)

DocBook 4 makes extensive use of parameter entities. This lets you change the DTD without modifying the original modules themselves. These parameter entities follow a naming scheme. In the following table, the asterisk (*) can stand for an element or attribute name, or an abstract description.

Table: DocBook 4 parameter entity conventions

P. E. for

Description

Class

%*.class;
Class of similar elements, for example navigation aids (table of contents, list of figures, etc.).

Collection

%*.mix;
contains collections of classes; the content model of para is defined by the parameter entity %para.mix;. It contains lists of classes, line-specific elements, and more. However, not every element has a corresponding %*.mix; entity.

Module

%*.module;
controls a so-called Module, which contains declarations for an element and its attributes.
The parameter entity %chapter.module; therefore controls the element chapter and its attributes. To remove or redefine this element, including its attributes, you must set %chapter.module; to IGNORE. See the example below the table, “Parameter entities in the chapter module”.

Element

%*.element;
controls the declaration of an element using the keywords INCLUDE and IGNORE.
This parameter entity determines whether elements are declared. To remove or redefine a particular element, assign the parameter entity %*.element; the value IGNORE.

Attribute list

%*.attlist;
controls declaration of an element’s Attribute list using the INCLUDE/IGNORE mechanism.
As with %*.element;. Assigning IGNORE to the parameter entity %*.attlist; removes an element’s attributes.

Multiple
Attributes

%*.attrib;
identifies one or more attributes; for example, the parameter entity %common.attrib; groups the most common attributes; local extensions, if any, are made under %local.*.attrib;.

Local
Extension

%local.*;
contains local extensions defined by the user; by default, these are declared empty in the DocBook DTD. These parameter entities let you extend an element or attribute. For example, declaring %local.chapter.class; adds further elements to the element chapter.

To illustrate how these parameter entities work together, the following example shows the chapter module:

 

Example: Parameter entities in the chapter module

<!ENTITY % chapter.module "INCLUDE">
<![%chapter.module;[
  <!ENTITY % local.chapter.attrib "">
  <!ENTITY % chapter.role.attrib "%role.attrib;">
  <!ENTITY % chapter.element "INCLUDE">
  <![%chapter.element;[
    <!--doc:A chapter, as of a book.-->
    <!ELEMENT chapter %ho; (beginpage?,
                    chapterinfo?,
                    (%bookcomponent.title.content;),
                    (%nav.class;)*,
                    tocchap?,
                    (%bookcomponent.content;),
                    (%nav.class;)*)
                %ubiq.inclusion;>
  <!--end of chapter.element-->]]>
  <!ENTITY % chapter.attlist "INCLUDE">
  <![%chapter.attlist;[
    <!ATTLIST chapter
                %label.attrib;
                %status.attrib;
                %common.attrib;
                %chapter.role.attrib;
                %local.chapter.attrib;>
  <!--end of chapter.attlist-->]]>
<!--end of chapter.module-->]]>

  

back to top