<val>

The <val> element is the root element of a DITAVAL file.

For information about processing DITAVAL files, including how to filter or flag elements with multiple property attributes or multiple properties within a single attribute, see Conditional processing (profiling).

Contains

style-conflict (optional) then (prop or revprop) (any number)

Example

Sample DITAVAL file

<val>
   <style-conflict background-conflict-color="red"/>
   <prop action="include" att="audience" val="everybody"/>
   <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>

This sample DITAVAL file performs the following actions:

  • Elements with audience="everybody" are included without change.
  • Elements with product="YourProd" get 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 gets a background color of blue.
    • The text in the element appears in yellow; the text is underlined.
  • Elements marked with 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.

DITAVAL file that overrides the default "include" action

<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>

This simple DITAVAL file performs the following actions:

  • The first <prop> element does not specify an attribute, which sets a default action of "exclude" for every prop value. This means that, by default, any property value not otherwise defined in this file 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".

DITAVAL with conditions for groups

<val>
   <prop action="exclude" att="product" val="appserver"/>
   <prop action="include" att="product" val="mySERVER"/>
   <prop action="include" att="database" val="dbFIRST"/>
   <prop action="include" att="database" val="dbSECOND"/>
   <prop action="exclude" att="database" val="newDB"/>
</val>

Assume that "database" and "appserver" are used as group names within the @product attribute. In that case, the sample DITAVAL above performs the following actions:

  • The first <prop> element excludes the value "appserver" when used within the @product attribute. It also sets a default of "exclude" for values within any appserver() group inside of the @product attribute.
  • The second <prop> element sets "mySERVER" to include; this applies whether "mySERVER" appears alone in the @product attribute (product="mySERVER") or inside of any group (product="appserver(mySERVER)" or product="otherGroup(mySERVER)").
  • The third and fourth <prop> elements set the database values "dbFIRST" and "dbSECOND" to include. If those values appear inside of a "database" group, they are explicitly set to "include". If they appear elsewhere in a conditional attribute (such as product="dbFIRST" or platform="dbSECOND"), this rule does not apply.
  • The final <prop> element sets the database value "newDB" to exclude. If that value appears inside of a database group, it is explicitly set to "exclude". If it appears in any other group or attribute, this rule does not apply.

Remember that with groups, if all values inside of a single group evaluate to "exclude", that is equivalent to an entire attribute evaluating to "exclude", which results in the removal of the content. Using the above sample DITAVAL:

  • <p product="appserver"> is filtered out, because this value is excluded.
  • <p product="appserver(A B)"> is filtered out, because there is no explicit rule for A or B, and values in the "appserver" group inside of @product default to exclude.
  • <p product="appserver(A B mySERVER)"> is included, because product="mySERVER" evaluates to "include", which means the entire group evaluates to "include".
  • <p product="newDB"> is included, because no rule in the DITAVAL applies, so the "newDB" token defaults to "include".
  • <p product="database(newDB)"> is filtered out, because the token "newDB" is excluded when found in the database group.
  • <p product="database(dbFIRST dbSECOND newDB)"> is included, because both "dbFIRST" and "dbSECOND" are included, so the group evaluates to include.
  • <p product="database(newDB) appserver(mySERVER)"> is filtered out, because the token "newDB" is excluded when found in the database group. The entire "database" group on this paragraph evaluates to "exclude", so the element is excluded, regardless of how the "appserver" group evaluates.

Note

If two groups with the same name exist on different attributes, each group will evaluate the same way. For example, rules for the database group in this sample would evaluate the same whether the group is used within @product or @platform. See Conditional processing (profiling) for suggestions on how to handle similar groups on different attributes.

Attributes

This element does not define any attributes.

Was this helpful?