Option Rules

Syntax: <yyyy rule="value" label="legend-label"/>

Example: <border rule="@contract='Symbian_Affiliate'" type="box-clipRB" label="Common Replace&#xad;able"/>

Use: Defines a presentation option to use when the item matches some specified criteria.

An option matches if the rule attribute evaluates to true for the elements in the XPath location specified in the parent’s match attribute. For example, consider the following group:

<xxxx match="block|collection">
<yyyy rule="self::block and count(descendant::component[@deprecated])=count(descendant::component)">…</yyyy>
<yyyy rule="component[@deprecated] and not(component[not(@deprecated)])">…</yyyy>
<yyyy rule="descendant::component[@plugin='Y']">…</yyyy>

In the first will apply to any <block> that has all components in it deprecated. If that does not match, it checks the second option’s rule . The second rule applies to any <collection> that has all its components deprecated (only a <collection> can have a <component> as a child). The third rule will match a <collection> or <block> that has a plug-in component.

Note: The order is important. In the above example, a fully-deprecated collection will match, even if it has a plug-in component.

<block …>… <!-- matches first rule -->
    <collection …>… <!-- matches second rule -->
        <component deprecated="9.3" plugin="Y" …/>…
        <component deprecated="7.0s" …/>…
        <component deprecated="8.0" …/>…
    </collection>
    <collection …>…<!-- matches second rule -->
        <component deprecated="9.2" …/>…
        <component deprecated="8.1"  …/>…
    </collection>
</block>
<block>    <!-- matches third rule -->
    <collection …>…   <!-- matches third rule -->
        <component plugin="Y" …/>…
        <component …/>…
        <component plugin="Y" …/>…
    </collection>
</block>