Can specialized DITA topic types inherit from standard types?

Yes, specialized DITA topic types can inherit from standard topic types. This inheritance allows organizations to create custom topic types that build upon the structure and elements of standard DITA topic types. It’s a way to extend the functionality of standard topics while maintaining consistency and reusing common structures.

In DITA, topic types are defined using Document Type Definitions (DTDs) or XML Schema Definitions (XSDs). Standard DITA topic types, such as concept, task, and reference, come with predefined structures and elements.

Specialized topic types can be created to address specific documentation needs by inheriting from standard topic types. Inheritance means that a specialized topic type retains the elements and structures of the standard topic type it inherits from and can add or modify elements as needed.

To create a specialized topic type, a new DTD or XSD is defined that includes the standard DITA topic type as a base. The new specialized topic type can then introduce additional elements or attributes that are specific to the organization’s needs. Specialized topic types inherit all the elements and attributes of the base topic type, allowing for consistent documentation practices.

Example:

An organization needs to create a custom DITA topic type for documenting software error messages. They want this specialized topic type to include standard error message elements but also require additional information like error codes and troubleshooting steps. They choose to define a custom DITA topic type called “errormessage” that inherits from the standard “reference” topic.


        <!-- Custom DITA Topic Type: errormessage -->
        <!ELEMENT errormessage (title, shortdesc?, refbody)>
        <!ATTLIST errormessage
                   %univ-atts;
                   %select-atts;
                   %id-atts;
                   %base-atts;>

        <!ELEMENT title (#PCDATA)>
        <!ELEMENT shortdesc (#PCDATA)>
        <!ELEMENT refbody (abstract, conbody?, troubleshooting?)>

        <!ELEMENT abstract (#PCDATA)>
        <!ELEMENT conbody (#PCDATA)>
        <!ELEMENT troubleshooting (#PCDATA)>
        <!ELEMENT errorcode (#PCDATA)>
        <!ELEMENT step (#PCDATA)>
    

In this example:

  • The “errormessage” topic type inherits from the standard “reference” topic type.
  • It adds specific elements like “errorcode” and “troubleshooting” to capture additional information.
  • Authors can use the “errormessage” topic type to document software error messages, benefiting from the standard “reference” structure while incorporating custom elements.