Can elements be conditionally processed when reused in DITA?

In DITA, elements can be conditionally processed when reused. This feature allows control over the inclusion or exclusion of specific content based on predefined conditions, making it a versatile method for managing variable content in technical documentation.

Conditional Attributes:

DITA elements suitable for conditional processing can be tagged with conditional attributes. The most common conditional attribute is @props or @audience. These attributes specify conditions that determine when the content should be included or excluded. Conditions can be applied at the topic, element, or attribute level.


        <p props="draft">This content is in draft status and should not be included in the final document.</p>
    

Conditional Processing Profiles:

DITA enables the definition of conditional processing profiles. These profiles determine which conditions are active or inactive for a particular output. By selecting the appropriate processing profile, control can be exercised over which variations of content are included when generating output. This is especially useful for producing different versions of documentation for diverse audiences or purposes.


        <!-- Conditional processing profile for a user guide -->
        <props-draft>exclude</props-draft>
        <props-review>include</props-review>
    

DITAVAL Files:

DITAVAL (DITA Validation) files are used to manage conditional processing. These files allow specification of which conditions are active or inactive for a given output. By referencing a specific DITAVAL file during the publishing process, it becomes easy to switch between different sets of conditions to customize the output to specific needs.


        <?xml version="1.0" encoding="UTF-8"?>
        <val>
          <prop action="exclude" att="props" val="draft"/>
          <prop action="include" att="props" val="review"/>
        </val>