XML technologies / DITA / Flexible extensibility / Flexible extensibility with DITA

(Excerpt from “DITA - Der neue Standard für Technische Dokumentation” by Johannes Hentrich)

DITA’s flexible architecture rests on two foundations:

These two properties of DITA’s architecture allow information structures to be expanded or reduced through specialization.

The following section first introduces DITA’s information structures individually. Maximum modularity is sought to make the information structures themselves reusable.

It then presents rules for specializing topics, maps and domains. In particular, a specialized DITA information structure must itself generate a DITA-compliant information structure.

The penultimate section discusses what specialization means for production processes running through the DITA Open Toolkit.

Finally, the last section shows the new directions DITA is taking beyond software documentation.

Information structures in DITA

DITA’s information structures are not contained in a single DTD but in numerous DTDs, module files and entity files.

Every DITA DTD has a module file defining its elements. For example, the task.mod file defines the task topic type’s elements, which can be created using task.dtd. DTDs define topic and map types.

Semantic markup grouped thematically into domains is referenced in a module file and defined in a corresponding entity file. For example, the uiDomain.mod file contains entity references to user interface domain elements defined in the entity file uiDomain.ent.

DITA 1.1 provides the following files for defining information structures:

  • topic.dtd: shell DTD for the generic topic.

  • topic.mod: defines the generic topic’s elements.

  • topicDefn.ent: contains the generic topic’s entities.

  • concept.dtd: shell DTD for the concept topic type.

  • concept.mod: defines the concept topic type’s elements.

  • task.dtd: shell DTD for the task topic type.

  • task.mod: defines the task topic type’s elements.

  • reference.dtd: shell DTD for the reference topic type.

  • reference.mod: defines the reference topic type’s elements.

  • glossary.dtd: shell DTD for the glossary topic type.

  • glossary.mod: defines the glossary topic type’s elements.

  • map.dtd: shell DTD for a map.

  • map.mod: defines the elements of a map.

  • mapGroup.mod: defines elements for grouping topics in a map.

  • mapGroup.ent: contains entity declarations for the elements grouping topics in a map.

  • bookmap.dtd: shell DTD for a bookmap.

  • bookmap.mod: defines the bookmap’s elements.

  • ditabase.dtd: shell DTD for all topic types and domains.

  • commonElements.mod: defines elements usable in all topic types.

  • commonElements.ent: contains parameter entities for the elements defined in the commonElements.ent file.

  • highlightDomain.mod: defines the highlighting domain’s elements.

  • highlightDomain.ent: contains the highlighting domain’s parameter entities.

  • indexing.mod: defines the indexing domain’s elements.

  • indexing.ent: contains the indexing domain’s parameter entities.

  • programmingDomain.mod: defines the programming domain’s elements.

  • programmingDomain.ent: contains the programming domain’s parameter entities.

  • softwareDomain.mod: defines the software domain’s elements.

  • softwareDomain.ent: contains the software domain’s parameter entities.

  • uiDomain.mod: defines the user interface domain’s elements.

  • uiDomain.ent: contains the user interface domain’s parameter entities.

  • utilitiesDomain.mod: defines the utilities domain’s elements.

  • utilitiesDomain.ent: contains the utilities domain’s parameter entities.

  • xnalDomain.mod: defines the xNAL domain’s elements.

  • xnalDomain.ent: contains the xNAL domain’s parameter entities.

Specializing topics and maps

When new information types are needed, topic or map types are specialized. DITA’s basic specialization principle requires every specialized information type to be reducible to its original structure. This requires the specialized structure’s content model to be more restrictive than the original. It ensures that the specialized structures can still be processed by the toolkit’s XSLT stylesheets.

The following table lists every permitted specialization of possible content types within a content model. For clarity, the parent element is named allgemein and the specialized element is named speziell.

Inhaltstyp

Erlaubte Spezialisierung

Beispiel

erforderlich

nur umbenennen

<!ELEMENT allgemein (a) > <!ELEMENT speziell (a.1) >

optional (?)

umbenennen, erforderlich sein, löschen

<!ELEMENT allgemein (a?) >

<!ELEMENT speziell (a.1?) > <!ELEMENT speziell (a.1) > <!ELEMENT speziell EMPTY >

beliebig häufig (ausschließlich einmal) (+)

umbenennen, erforderlich sein, teilen in ein erfordliches Element und weitere Elemente, teilen in ein oder mehrere Elemente und weitere Elemente

<!ELEMENT allgemein (a+) >

<!ELEMENT speziell (a.1+) > <!ELEMENT speziell (a.1) > <!ELEMENT speziell (a.1,a.2,a.3+,a.4*) > <!ELEMENT speziell (a.1+,a.2,a.3+) >

beliebig häufig (einschließlich keinmal) (*)

umbenennen, erforderlich sein, optional sein, teilen in ein erforderliches Element und weitere Elemente, teilen in ein optionales Element und weitere Elemente, teilen ein oder mehrere Elemente und weitere Elemente, teilen in kein oder mehrere Elemente und weitere Elemente, löschen

<!ELEMENT allgemein (a+) >

<!ELEMENT speziell (a.1+) > <!ELEMENT speziell (a.1) >

<!ELEMENT speziell (a.1?) >

<!ELEMENT speziell (a.1,a.2,a.3+,a.4*) >

<!ELEMENT speziell (a.1?,a.2,a.3+,a.4*) >

<!ELEMENT speziell (a.1+,a.2,a.3*) >

<!ELEMENT speziell (a.1+,a.2?,a.3*) > <!ELEMENT speziell EMPTY >

Auswahl (entweder-oder) (|)

umbenennen eines auswählen

<!ELEMENT allgemein (a|b) >

<!ELEMENT speziell (a.1|b.1) > <!ELEMENT speziell (a.1) >

Table: Rules for specializing content types

A key component of topic and map specialization is the class attribute. When a specialized element is defined, its class attribute specifies the mapping from the specialized element to its parent.

The <reference> element illustrates the structure of the class attribute. The reference topic type specializes the generic topic type. The <topic> element was specialized into the <reference> element. The class attribute for the <reference> element is then defined as follows:

<!ATTLIST reference class CDATA "- topic/topic reference/reference ">

The declaration <!ATTLIST reference> defines the attributes of the <reference> element. The attribute name is class with datatype CDATA. The value of the class attribute is between the quotation marks. It begins with a minus sign (–), indicating that a class attribute is being defined for a topic. A space follows, then the parent information structure’s topic type name and element name separated by a slash (/). The parent structure of the reference topic type is the generic topic, whose topic type name is topic. The element is also named topic, naming the generic topic’s root element being specialized. After a space come the specialized structure’s topic type name and element name. The topic type name is reference and the element specialized from the <topic> element is named reference. Another space follows the completed mapping definition. It must not be forgotten.

The values of the class attribute are used in XSLT stylesheets’ match attributes to process elements and their specializations.

Content-model specialization rules and class attribute definitions do not yet explain the practical procedure for specialization. The following approach is recommended:

  1. Create a sample document that can later be created using the specialized topic type.

  2. Decide which existing elements the new ones should specialize. Later derive the class attribute values from this. Only existing elements may be specialized into new ones. If elements cannot be specialized from known elements, the resulting DTDs are no longer DITA DTDs processable by the DITA Open Toolkit. Knowledge of specialization often raises hopes of escaping DITA’s topic-based structure and establishing custom structures based on DITA but not quite DITA. Specialization cannot do this. Its result is always a DITA-compliant information structure.

  3. Define the new topic type’s content model according to the rules in this section.

  4. Perform the “mechanical” part of specialization: create the DTD and module file as described in “Specialization”.

  5. Test your sample document with the specialized DTD.

In practice, the first three steps take the most time. Designing a suitable sample document usually takes far longer than creating the specialized DTD and module file.

DITA’s built-in content model is generally far too extensive for software documentation. Many offered elements are unnecessary in daily work and become a burden. Specialization can help here by reducing existing structures rather than creating new ones. This can make technical writers’ work considerably easier.

Specializing domains

Domains group elements thematically for semantic and typographic markup of content. Domains exist independently of individual topic types.

Some domain elements also have content models. Their specialization follows the same content-model rules as topic or map elements, described in the previous section.

Like topic and map elements, domain elements have a class attribute. Here, however, a minus sign (–) is replaced by a plus sign (+) to indicate that the class attribute belongs to a domain element.

The following example defines the class attribute for the <api-name> element, where the <apiname> element specializes the <keyword> element:

<!ATTLIST apiname class CDATA "+ topic/keyword pr-d/apiname">

The value of the class attribute begins with a plus sign (+) followed by a space. The hierarchy is then defined using the domain-name/element-name pattern. Note the definition topic/keyword, since topic is intended to mean the topic domain. Strictly speaking, no topic domain exists. However, DITA has semantic markup elements such as the <keyword> element, that belong to none of the familiar domains. The <keyword> element and others are defined in the commonElements.mod file associated with the generic topic. They are therefore said to belong to the topic domain.

The value pr-d/apiname denotes the <apiname> element in the programming domain. Once domain/element mappings are defined, another space must follow; it must not be forgotten here either.

New domains must be integrated into a DTD before content can use their elements. A DITA DTD specifies both the available domains and the module files defining topic-type elements to use. A DTD assembling domains and module files is called a shell DTD. Assembly is also called “integration”. For instructions on creating a shell DTD, see “Specialization”.

Extending production processes

The DITA Open Toolkit can process specialized elements even without instructions for them in the XSLT stylesheets. This results from the elements’ class attributes.

There is therefore no immediate need to modify XSLT stylesheets when topic types or domains are specialized. If adaptation is nevertheless necessary, a specific method is provided.

Compared with the method for adapting DTDs and module files, adapting XSLT stylesheets seems cumbersome and confusing.

Specializing DTDs and module files uses the original DITA information structures as templates. Existing element definitions serve as templates for specialized element definitions.

Processing follows the same idea: XSLT templates in the stylesheets can serve as templates and, after adaptation, process specialized elements. In practice this is very laborious. First, it is not immediately clear which of the toolkit’s many XSLT stylesheets contains the desired XSLT template. Second, finding the template processing the element to be specialized can be very difficult. The many stylesheets for different output media and their different customization mechanisms make the search still harder.

The DITA Open Toolkit lacks a uniform approach here. This shortcoming is most apparent in XSLT stylesheets producing PDF files. A unified strategy like that available for specializing DTDs and module files is absent from the XSLT stylesheets.

DITA is a very active standard, so work on a solution is already underway. Hopefully the XSLT stylesheets for other output media will also benefit from the new findings.

  

 

 

 

back to top