DITA Profiling / Conditional Text
DITA offers support for conditionally profiling content by using profiling attributes. With Oxygen XML Editor, you can define values for the DITA profiling attributes and they can be easily managed to filter content in the published output. You can switch between profile sets to see how the edited content looks like before publishing. The profiling configuration can also be shared between content authors through the project file and there is no need for coding or editing configuration files.
Profiling Attributes
You can profile content elements or map elements by adding one or more of the default DITA
profiling attributes (product, platform,
audience, rev, props, and
otherprops). You can also create your own custom profiling attributes and custom profiling
condition sets. The profiling attributes may contain one or more tokens that
represent conditions to be applied to the content when a publication is built.
For example, you could define a section of a topic that would only be included for a
publication related to the Windows platform by adding the platform
profiling attribute:
<section platform="windows">
Profiling Conditions
DITA allows you to conditionally profile parts of a topic so that certain parts of the topic are displayed when certain profiling conditions are set. Profiling conditions can be set both within topics and in maps. When set in a topic, they allow you to suppress an element (such as paragraph), step in a procedure, item in a list, or even a phrase within a sentence. When set in a map, they allow you to suppress an entire topic or group of topics. You can then create a variety of publications from a single map by applying profiling conditions to the build.
Apply Profiling to DITA Content
To apply a profiling attribute to DITA content, highlight the content and select Edit Profiling Attributes from the contextual menu. To profile specific elements in a topic or map, right-click inside the element and select Edit Profiling Attributes. The Edit Profiling Attributes dialog box is displayed, allowing you to check each of the profiling tokens that apply for each attribute.
Figure: Edit Profiling Attributes Dialog Box
The profiling attributes, and their potential values, that appear in this dialog box depend
on what has been configured in Oxygen XML Editor. If you have a large list of profiling
attributes, you can use the text filter field to search for attributes or values, and you
can expand or collapse attributes by using the
Expand All/
Collapse All buttons to the right of the text filter or the arrow button to
the left of the profiling attribute name.
The content of the dialog box is determined as follows:
- If your root DITA map references a DITA subject scheme map that defines values for the profiling attributes, those values are used. In the image above (taken from the Oxygen XML Editor documentation project), values are defined for eight products, but none for other profiling attributes. Thus, the others are omitted from the dialog box.
- If your project defines project-level configuration values for the profiling attributes, those values are used.
- If Oxygen XML Editor defines global-level configuration values for the profiling attributes, they are used.
- Otherwise, a basic default set of profiling attributes and values are available.
Visualizing Profiled Content
Profiling/Conditional Text drop-down menu that is located on the
DITA Maps Manager toolbar. You can select which profiles to show,
or apply colors to text that is profiled in various ways, as shown in the following image:Figure: Example: Profiled Content
To watch our video demonstration about DITA profiling, go to http://oxygenxml.com/demo/DITA_Profiling.html.