Can you generate multiple versions of a publication using conditional processing in DITA maps?
Conditional processing in DITA maps represents a potent capability allowing the production of diverse publication versions from a sole source by employing conditional attributes to content. These attributes permit content authors to designate specific topics, sections, or elements as either “include” or “exclude” under diverse conditions, such as audience, product version, or delivery format, resulting in custom content output for distinct scenarios.
Conditional processing within DITA maps embodies a sophisticated mechanism empowering content creators to yield multiple publication versions without content duplication. This process involves conditional attributes, processing profiles, and output variations.
Conditional Attributes:
In DITA, authors can affix conditional attributes, including “audience,” “product,” or “delivery format,” to topics or elements within a map. These attributes serve as markers signifying when and where specific content should be encompassed or omitted.
Conditional processing involves having include and exclude inspections.
- Include Condition: When content is tagged with an “include” condition, it becomes part of the output for that specific condition.
- Exclude Condition: Conversely, content marked with an “exclude” condition is purposefully excluded from output corresponding to the given condition. This proves valuable for content that may lack relevance for specific audiences or delivery formats.
Processing Profiles:
Conditional processing hinges on the notion of processing profiles. These profiles delineate which conditions should be operative during the publishing process. For example, processing profiles might be configured for distinct products, each activating pertinent conditional attributes.
Output Variations:
Through the manipulation of processing profiles, one can produce multiple publication versions. For example, one can fashion separate outputs for diverse audience segments, each replete with content crafted to meet their precise requirements. Correspondingly, one can create permutations for varying product versions or delivery formats, all sourced from identical content.
Example:
Documentation is being fashioned for a software product encompassing both desktop and mobile variants. The objective is to furnish discrete documentation for each. Within the DITA map, there exist topics addressing shared features and elements between the two versions. To differentiate the content, conditional attributes such as “product” are employed, yielding the following representation:
<map>
<title>Software Documentation</title>
<topicref href="common_features.dita"/>
<topicref href="desktop_features.dita">
<props product="desktop"/>
</topicref>
<topicref href="mobile_features.dita">
<props product="mobile"/>
</topicref>
</map>
In the realm of processing profiles, two profiles are delineated: one designated for the “desktop” product and the other tailored for the “mobile” product. When generating output for the “desktop” profile, solely content marked with the “product” attribute set to “desktop” is incorporated, thereby yielding documentation tailored to the desktop software version. The same principle applies to the “mobile” profile, guaranteeing that generated output is designed to cater to the mobile software version. This approach facilitates the efficient creation of distinct documentation for various products or conditions while preserving a single content source.