#### 9.2.4 Including or excluding content based on attribute values

For any of the attributes listed in §9.2.1 Understanding the syntax of conditional action settings, you can override the default conditional action for specified values, to include or exclude content.

Overriding excluded attribute values

To specify a list of attribute values that should cause an element to be included when the conditional default for the attribute is exclude (see §9.2.3 Specifying default conditions for inclusion or exclusion):

    [ConditionalInclude]
    ; attribute name = list of values to include, effective when the
    ; conditional default for the attribute is exclude.
    attribute = value1 value2 ...

If no value for an attribute on an element is included, the element is excluded; otherwise, it is included.

For example:

    [ConditionalDefaults]
    audience = exclude

    [ConditionalInclude]
    audience = beginner

In this example, of those elements that have an audience attribute, only those with the value beginner would be included, because the default action for audience is to exclude. The result would be output oriented for beginners.

Overriding included attribute values

To specify a list of attribute values that should cause an element to be excluded when the conditional default for the attribute is include (continuing the same example):

    [ConditionalExclude]
    ; attribute name = list of values to exclude, effective when the
    ; conditional default for the attribute is include.
    attribute = value1 value2 ...

If all values for any attribute on an element are excluded, the element is excluded; otherwise, it is included.

For example:

    [ConditionalDefaults]
    audience = exclude

    [ConditionalExclude]
    audience = advanced
    platform = linux

Elements with audience="advanced" would be excluded (redundant, because the default action for audience is to exclude) and so would elements with platform="linux". The result would be output oriented to all but advanced audiences, working on any platform except Linux. Because the default is include for platform, only elements that have the single value linux for platform would be excluded; an element with platform="linux mac" would be included.

Previous Topic: 9.2.3 Specifying default conditions for inclusion or exclusion

Next Topic: 9.2.5 Passing attribute values through in output

Parent Topic: 9.2 Defining conditional actions

Sibling Topics:

9.2.1 Understanding the syntax of conditional action settings

9.2.2 Flagging content for special treatment in output

9.2.3 Specifying default conditions for inclusion or exclusion

9.2.5 Passing attribute values through in output

Table of Contents • Index