Can conditional processing be controlled at the map level in DITA?

Controlling conditional processing at the map level in DITA XML provides a powerful mechanism for delivering tailored content to your audience. With map-level conditions, you can determine which topics or sections are included or excluded from the final output based on specific criteria. This allows you to create versatile documentation that caters to different users, contexts, or output formats.

Conditional Attributes

In DITA XML, conditional processing is achieved through conditional attributes, which you can set at both the topic and map levels. The primary conditional attributes are “audience,” “platform,” and “product.” By using these attributes, you can specify conditions that determine when content should be included or excluded. For example, you may create content that is specific to different audiences, such as end-users and administrators, and use conditional attributes to control which content each audience sees. This fine-grained control enhances the usability and relevance of your documentation.

Map-Level Control

At the map level, you can set default conditions that apply to all topics within the map. This default setting can be overridden at the topic level if you need specific topics to behave differently. By controlling conditional processing at the map level, you can ensure consistency and efficiency across your documentation projects, as it allows you to manage conditions for multiple topics from a central location.

Example:

Here’s an example of how conditional processing is controlled at the map level in DITA XML:


<map>
  <title>Documentation Map</title>
  <props>
    <prop key="args.audience" val="admin" />
    <prop key="args.platform" val="windows" />
  </props>
  <topicref href="introduction.dita" />
  <topicref href="user-manual.dita" />
  <topicref href="admin-manual.dita">
    <props>
      <prop key="args.audience" val="admin" />
    </props>
  </topicref>
</map>

In this example, the map-level conditions are set for the entire documentation map, specifying the target audience as “admin” and the platform as “windows.” You can see how the “args.audience” and “args.platform” attributes are used to control conditional processing at the map level, providing tailored content for administrators using Windows.