Table of Contents
User Guide
Conditional Processing
Conditional Processing Overview
Conditional Processing is a powerful capability in DITA that enables you to identify content that should only appear in certain outputs, depending on your publishing parameters.
Conditionalizing Elements in a Topic
Use the Topic Editor to set values and conditionalize elements in a topic for conditional publishing.
Conditionalizing Entire Topics or Sections of a Map
Use the Map Editor to set Conditional Processing Attribute values and conditionalize entire topics or sections of a map for conditional publishing. 
Previewing Conditionalized Output 
Use the Topic Editor to preview and modify the view settings of conditionalized output.
Conditional Processing Overview

Conditional Processing is a powerful capability in DITA that enables you to identify content that should only appear in certain outputs, depending on your publishing parameters.

Conditionalize your content by setting Conditional Processing Attributes on elements in topics or maps. This way, you can control what content is included or excluded at publish based on the output format.

Let’s look at some examples of when to use conditionalization:
  • You’re documenting a software package that has different features or functionality for the Windows and Linux platforms.
  • You’re creating an electronic document output that hides complex technical information from basic users but displays it to advanced users.
  • Your company produces vehicles with the driver controls on the right for some markets and on the left for others.
Instead of keeping two separate document sets for the content, you can set Conditional Processing Attributes on elements to include or exclude the content during output.
DITA provides several built-in Conditional Processing Attributes, including: Audience, Platform, Product, and Other Properties. These are predefined attributes in DITA that you can set to any value. For instance, you can set the Audience attribute to “Novice” or the Platform attribute to “Windows”. The values you choose are entirely up to you.
Once you’ve set your values for the Conditional Processing Attributes, you’ll need to create a DITAVal file. A DITAVal file contains “rules” for which Conditional Processing Attributes and values to include or exclude. Then at publish, you can select the DITAVal file you want to use for conditional processing. So, only the content included based on the DITAVal file will publish.
section

Conditionalizing at the Element Level

You can filter elements in a topic using the Properties Pane in the Topic Editor . For example, you can select an unordered list and modify the Audience to “Novice”, so the unordered list will only appear in the output if the Novice Audience is configured to be included.
section

Conditionalizing Entire Topics or Sections of a Map

You can also conditionalize an element in a map using the Edit Properties window in the Map Editor . To access the Edit Properties window, right-click an element in the map and select Edit Element Attributes .
For example, in the element’s properties, you can modify the Product to “Mobile”, so the topic will only appear in the output if Mobile Products are configured to be included.
Conditionalizing Elements in a Topic

Use the Topic Editor to set values and conditionalize elements in a topic for conditional publishing.
context
Note:The default Conditional Processing Attributes are: audience, rev, platform, product, props, and otherprops.

  1. In the Content Manager , open a topic and place your cursor in the element you want to set Conditional Processing Attribute values for.

    Step Information
    Note:It is a best practice to profile entire elements, not just individual words or phrases. This is especially important when localizing the content, since a complete sentence is required to provide sufficient context for accurate translation memory and machine translation matching. This is true even if some text is duplicated across alternative elements for different conditions. 

  2. Click Properties .

    Expected Result
    The Properties Pane displays.

  3. Navigate to the Conditional Processing Attribute that you want to define. 

    Step Information

    Conditional Processing Attribute

  4. Enter the values for each Conditional Processing Attribute that defines the condition in which the element will be displayed. 

    Example
    In this example, we set the Audience field to Novice for the first item in the list. The list item will be published only when Audience=Novice and Action=Include in the DITAVal used at publish.

  5. Click Save .
result

The Conditional Processing Attribute values are set for the selected element.

Note:Depending on the action defined for a specific value at publish time, content is either flagged, excluded, or included. If no action is specified for a specific value, the default is to include the content (unless your publishing profile sets the default to exclude).

Conditionalizing Entire Topics or Sections of a Map

Use the Map Editor to set Conditional Processing Attribute values and conditionalize entire topics or sections of a map for conditional publishing. 
context
Note:The default Conditional Processing Attributes are: audience, rev, platform, product, props, and otherprops.
  1. In the Map Editor , right-click the element you want to set the Conditional Processing Attributes for and select Edit Element Attributes .

    Step Information

    Expected Result
    The Edit Properties window displays.

  2. Enter the values for each Conditional Processing Attribute that defines the condition in which the element will be displayed. 

    Example
    If the topic is only intended for administrators, in the Audience field enter Administrator.

    Step Information
    Note:To add multiple values for Conditional Processing Attributes, insert a space between each value.

  3. Click Save .
result
The Conditional Processing Attributes values are set for the element.
Note:Depending on the action defined for a specific value at publish time, content is either flagged, excluded, or included. If no action is specified for a specific value, the default is to include the content (unless your publishing profile sets the default to exclude).

Previewing Conditionalized Output 

Use the Topic Editor to preview and modify the view settings of conditionalized output.
  1. In the Content Manager , open a topic and navigate to an element with a Conditional Processing Attribute value set.

    Step Information

    Any document with defined values for Conditional Processing Attributes will display in a label in the margin of the Topic Editor . The label shows the value or values that have been defined for that element.

  2. Click on a label.

    Step Information
    Expected Result
    The Conditional View Settings window displays.
  3. For each Conditional Processing Attribute value, do any of the following:

    • To show the conditionalized output, check Shows.
    • To grey the conditionalized output, check Greyed.
    • To hide the conditionalized output, check Hidden.
  4. Click Apply.

    Expected Result
    If Shows was selected, conditionalized output displays alongside unconditionalized content:
    If Greyed was selected, conditionalized output is greyed:
    If Hidden was selected, conditionalized output is hidden:
result

The view settings of conditionalized elements are modified.