This scenario shows how a DITAVAL file and a subject scheme map interact to flag content in a publication.
The content development team for a software application uses the @product
attribute to identify content that is associated with specific releases of the product. The values for the @product
attribute are controlled values that are set in a subject scheme map, as shown in the following code sample:
<subjectScheme>
<subjectdef keys="product-releases">
<!-- ... -->
<subjectdef keys="5.0">
<subjectdef keys="5.1"/>
<subjectdef keys="5.2"/>
<subjectdef keys="5.3"/>
</subjectdef>
</subjectdef>
<!-- ... -->
<enumerationdef>
<attributedef name="product"/>
<subjectdef keyref="product-releases"/>
</enumerationdef>
</subjectScheme>
For the product documentation that is included in the automated development builds of the application, the team wants all content that is associated with version 5.0 to be flagged with a yellow background. This is accomplished by using the following DITAVAL file:
<val>
<!-- ... -->
<prop action="flag" att="product" val="5.0" backcolor="yellow"/>
<!-- ... -->
</val>
Because the subject scheme map is referenced in the publication map, the above DITAVAL file ensures that content that is specified with any of the following name and value pairs is rendered with a background color of yellow:
product="5.0"
product="5.1"
product="5.2"
product="5.3"
The explicit hierarchy of controlled values that is defined in the subject scheme map makes it possible for the DITAVAL file to contain fewer <prop>
elements. If the subject scheme map was not used, the DITAVAL file would need to contain the following logic:
<val>
<!-- ... -->
<prop action="flag" att="product" val="5.0" backcolor="yellow"/>
<prop action="flag" att="product" val="5.1" backcolor="yellow"/>
<prop action="flag" att="product" val="5.2" backcolor="yellow"/>
<prop action="flag" att="product" val="5.3" backcolor="yellow"/>
<!-- ... -->
</val>