Authoring Source Documents » DITA - XML » Using Ditaval files in DITA
Using Ditaval files in DITA
For conditional text, DITA uses filtering to determine the user or audience that will be viewing the help content. Using a file called a “ditaval” file, you can control the filtering of the content that will be generated as output. You can place ditaval files next to ditamap files using the name of the DITA map files that they are to be applied to similar to this:
<ditamap name>.ditaval
With ePublisher you have 3 additional ways to handle ditaval files. The ditaval definitions are looked for in the following order.
*Per Target: Targets\<Target Name>\Adapters\xml\scripts\dita\default.ditaval
*Per Format: Formats\<Format Name>\Adapters\xml\scripts\dita\default.ditaval
*Entire project: Formats\Adapters\xml\scripts\dita\default.ditaval
The following example shows an example of how filtering works with the ditaval markup:
<val>
  <prop att="audience" val="web" action="exclude" />
</val>
 
The attributes within prop determine the action and who sees the material that is defined in the output.
action
include - Includes the content in output. This is the default behavior unless otherwise set.
exclude - Excludes the content from output (if all values in the particular attribute are excluded).
passthrough - Include the content in output, and preserve the attribute value as part of the output stream for further processing by a runtime engine, for example runtime filtering based on individual user settings
flag - include and flag the content on output (if the content has not been excluded).
att
The attribute to be acted. This must be one of props, audience, platform, product, otherprops, or a specialization of props. If the att attribute is absent, then the prop element declares a default behavior for any conditional processing attribute.
val
The value to be acted upon. If the val attribute is absent, then the prop element declares a default behavior for any value in the specified attribute.
Was this helpful?
Last modified date: 02/10/2023