What is the purpose of the @collection-type attribute in DITA maps?

The @collection-type attribute in DITA maps serves the purpose of specifying the type of collection that a DITA map represents. DITA maps are used to organize and structure content, including topics, across documentation projects. The @collection-type attribute helps define the nature of this collection, providing essential information for processing and rendering the map and its associated content.

Types of Collection

There are several predefined values for the @collection-type attribute, each representing a different type of collection. These types include:

  • bookmap: Indicates that the DITA map represents a book or manual, typically used for long-form documentation where sequential reading is expected.
  • map: Represents a standard DITA map used for organizing topics in a hierarchical or structured manner. This is a common type used for various documentation projects.
  • booklist: Specifies a list of bookmap references, allowing for the creation of a list of books or manuals.
  • glossarymap: Used for glossary-related content, such as definitions and term references.
  • <!– You can add more collection types here as needed –>

Example:

Here’s an example of how the @collection-type attribute is used in a DITA map:


<map title="User Guide" id="user_guide" @collection-type="bookmap">
  <topicref href="chapter1.dita" />
  <topicref href="chapter2.dita" />
  <topicref href="chapter3.dita" />
  <!-- Additional topicrefs for chapters go here -->
</map>

In this example, the @collection-type attribute is set to bookmap, indicating that this DITA map represents a user guide or manual composed of multiple chapters.