How can conditional processing be applied to reused topics in DITA?
Conditional formatting is a feature used across DITA, including in reused topics. They allow the tailoring of content of reused topics to specific conditions or output requirements. This enables organizations to maintain a single source of content while generating different variations based on conditions, such as audience, product versions, or delivery formats.
Conditional Formatting Components
Conditional formatting makes use of conditional attributes, specialization, and DITAVAL files.
Conditional Attributes:
DITA provides a mechanism to associate conditional attributes with elements or entire topics. These attributes act as markers to indicate when a specific piece of content should be included or excluded. Common conditional attributes include platform, audience, product, and deliveryTarget.
Specialization:
Specialized versions of reused topics can be created by defining different conditions. Specialized topics may include variations that are specific to particular audiences, products, or output formats. These specialized topics reference the same base content but provide conditional content that overrides or supplements the base.
DITAVAL Files:
To manage conditional processing, DITAVAL (DITA Valiation) files are typically used. A DITAVAL file specifies the conditions under which specific content should be included or excluded. It provides a way to manage and share conditional settings across different documents and projects.
Conditional Processing Tools
DITA authoring tools, publishing engines, and content management systems support conditional processing. These tools use DITAVAL files and conditional attributes to generate customized outputs based on the defined conditions. Authors can apply conditions directly in the authoring environment.
Example:
A software documentation project uses the same user manual shared among different products. However, each product has specific features relevant only to its audience, requiring conditional processing.
Base Topic: Create a base topic that includes common content shared by all products.
Specialized Topics: For each product, create a specialized topic that includes content unique to that product. These topics reference the base topic and override the relevant sections with product-specific information.
Conditional Attributes: Use conditional attributes like product to define the conditions under which each specialized topic should be included. For example, <topicref href="common.dita" format="dita" product="productA"/>
specifies that the specialized topic for “productA” should be included when generating content for that product.
DITAVAL File: Create a DITAVAL file that defines the conditions for different product variations. It specifies which specialized topics should be included for each product.