Conditional processing means you apply attribute values to certain elements of your text. These values are then entered into a separate DITAVAL (DITA values) file in which you write rules that specify whether elements with those values need to be included, excluded (filtering) or flagged (highlighting). While generating output, the rules in this DITAVAL file are applied to the end-result. Below, the three main steps in conditional processing are described.
Before worrying about applying conditions, you should first establish a scheme and define exactly what you need to create conditions for. This way you can plan out which attributes you need and which values to assign to each of them. To do this, define your:
Each of the items you define should receive a unique value in an attribute. Do not re-use value names in different attributes as this will lead to confusion for your writers.
Example: You want to teach your users how to save their files using Microsoft Word, but you know there are several version of Word on the market. As your documents only deal with Word 2003 and Word 2007, you plan your conditional attributes and values accordingly:
|Only for Word 2003||@platform||2003|
|Only for Word 2007||@platform||2007|
Once you have specified which values you need and in which circumstances you will need them, you can start applying them as you write. Applying them while writing is far easier than having to hunt through your documentation afterwards to find the elements that are product/audience specific.
You can apply conditional attribute values in:
|Topics||Include, exclude or flag specific elements|
|DITA maps||Include or exclude whole topics|
Note: It is recommended to apply attributes to the topic references in the DITA map, and not to the <topic> element within the topic in question.