<val>
The <val>
element is the root element of a DITAVAL
document.
Processing expectations
For information about processing DITAVAL documents, including how to filter or flag elements with multiple property attributes or multiple properties within a single attribute, see Conditional processing.
Example
This section is non-normative.
This section contains examples of DITAVAL documents and how they can be used.
The following code sample shows a DITAVAL document that excludes certain content, flags certain content, flags certain revisions, and provides a background color for when there are style conflicts:
<val>
<style-conflict background-conflict-color="red"/>
<prop action="exclude" att="audience" val="internal-test"/>
<prop action="flag" att="product" val="YourProd" backcolor="purple"/>
<prop action="flag" att="product" backcolor="blue"
color="yellow" style="underline" val="MyProd">
<startflag imageref="startflag.jpg">
<alt-text>This is the start of my product info</alt-text>
</startflag>
<endflag imageref="endflag.jpg">
<alt-text>This is the end of my product info</alt-text>
</endflag>
</prop>
<revprop action="flag" val="1.2"/>
</val>
- Elements that specify
audience="internal-test"
are excluded. - Elements that specify
product="YourProd"
are rendered with a background color of purple. - Elements with
product="MyProd"
get the following actions:- The image startflag.jpg is placed at the start of the element.
- The image endflag.jpg is placed at the end of the element.
- The element is rendered with a background color of blue.
- The text in the element is rendered in yellow, and the text is underlined.
- Elements marked with
rev="1.2"
are flagged with the default revision flags, which are implementation dependent. - When there are conflicts, for example, if an element is
marked with
product="MyProd YourProd"
, it will be flagged with a background color of red.
The following code sample shows a DITAVAL document that sets a
default value of exclude for every
conditional-processing attribute. That default value is then
overriden by the <prop>
elements with a
value of include.
<val>
<prop action="exclude"/>
<prop action="include" att="audience" val="everybody"/>
<prop action="include" att="audience" val="novice"/>
<prop action="include" att="product" val="productA"/>
<prop action="include" att="product" val="productB"/>
</val>
- The first
<prop>
element does not specify an attribute, which sets a default action of exclude for every conditional-processing attribute. This means that, by default, any property value not otherwise defined in this document evaluates to exclude. Note that this same behavior can be limited to a single attribute. The following<prop>
element sets a default action of exclude for all properties specified on the@platform
attribute:<prop action="exclude" att="platform"/>
- The second and third
<prop>
elements set an action of include for two values on the@audience
attribute. All other values on the@audience
attribute still evaluate to exclude. - The fourth and fifth
<prop>
elements set an action of include for two values on the@product
attribute. All other values on the@product
attribute still evaluate to exclude.