DITA: Conditional profiling
DITA offers a set of standard attributes that you can apply to most elements. The general attributes are as follows:
You set the values you want for each attribute. You can't change the names of the attributes
(because they're part of the DITA schema), but you can edit their values. (The
otherprops are meant to be generic to adapt to any
To set up your attributes and values in OxygenXML, enter the Author view and click the Profiling Attributes button . Then select Profiling Settings.
Alternatively, go to.
In the Profiling Attributes section, edit the values for each of the attributes.
Creating Profiling Condition Sets
While you're on the Profiling Attributes screen, move to the next section below: Profiling Condition Sets. Here you can define the combinations of the profiling attributes you want for your various transformation scenarios.
Now configure your transformation scenarios with the right condition sets:
- Click the Transform Scenarios button .
- Select New.
- Select DITA OT Transformation.
- Select Webhelp and click OK.
- Name the transformation scenario.
- Click the Filters tab.
- Select the profiling condition set you configured. Then click OK. (You may need to toggle the radio button to another selection and then come back to select Use profiling condition set — not sure if that's a UI quirk.)
- Select the transform scenario you just created and click Apply
For example, if you selected a condition set with
platform="mac", only the topics with
platform="mac"would be included. Any elements with
platform="pc"or other attribute values would be excluded.
Without Oxygen, you would need create a DITAVAL file that explains what should be excluded. See DITA: Ditaval files (filtering attributes from your transforms) for more details.
In the DITAVAL file method, you identify the attribute and value and then apply an exclude action. (You don't apply an include, just exclude.) You can still use DITAVAL files with Oxygen if you want.
With Oxygen, however, the conditional profiling works more intuitively. In Oxygen, when you create a condition set that includes certain values, other values not selected from that same attribute are excluded. However, if you don't apply any attribute to content, everything is included.
Applying attributes to elements
Now you can start using these attributes almost any DITA element. Suppose you want to apply an attribute to your map so that you can use the same map for each product. You might apply the attributes like this:
Or to a
Or to pretty much any other element. If you want to be even more granular, you can surround a word with
ph tags (for phrase). The tags can be applied to any word or phrase, so if the element you want doesn't allow you to apply these general attributes (such as with the
entry element in a table), you can just put
ph tags inside the element.
When adding multiple values to an attribute, just separate the values with a space.
Viewing conditions in the Author mode
When you're in the Author mode, you can switch to the condition set that you want to see. If you switch to Trek 7.3 FX, only the content that meets that condition set appears in the Author view.
You can also set it so that the content not included is semi-transparent. This mode makes it easy to edit content that has conditional profiling. Here's an example. The content with the attribute for gary_fisher is transparent because I've selected to only see the trek content.
About Tom Johnson
I'm an API technical writer based in the Seattle area. On this blog, I write about topics related to technical writing and communication — such as software documentation, API documentation, AI, information architecture, content strategy, writing processes, plain language, tech comm careers, and more. Check out my API documentation course if you're looking for more info about documenting APIs. Or see my posts on AI and AI course section for more on the latest in AI and tech comm.
If you're a technical writer and want to keep on top of the latest trends in the tech comm, be sure to subscribe to email updates below. You can also learn more about me or contact me. Finally, note that the opinions I express on my blog are my own points of view, not that of my employer.