Documentation Center

Aspect property hierarchy

Aspect properties of type Boolean (also called a context segment) can be organized in a hierarchy by defining their semantic relationships using the requires and implies attributes of the property elements.

A hierarchy of context segments consists of interdependencies between Boolean aspect properties, to be resolved at runtime. These interdependecies can be as follows:
  • One Boolean aspect property may require one or more other Boolean aspect properties to be defined and resolve to true. For example, an aspect property that says that the user uses Internet Explorer 9 may require that another aspect property, which says that the user uses Internet Explorer, is true.
  • One Boolean aspect property being true may imply that one or more other defined Boolean aspect properties also resolve to true. For example, an aspect property that says that the user's display screen is at least 640 pixels wide implies that it is also at least 320 pixels wide.
To define these relationships, use the requires and implies attributes of the property element, respectively:
<aspect name="ui">
  <properties>
    <property name="ie" type="boolean" expression="browser.model == 'IE'"/>
    <property name="ie9" type="boolean" expression="browser.version.major eq 9" requires="ui.ie"/>
    <property name="640ormore" type="boolean" expression="browser.displayWidth ge 640"
      implies="ui.320ormore" />
    <property name="320ormore" type="boolean" expression="browser.displayWidth ge 320"/>
  </properties>
</aspect>
If the value of implies or of requires contains more than one aspect property, the properties must be separated by commas:
<property name="640ormore" type="boolean" expression="browser.displayWidth ge 640" implies="ui.320ormore,ui.240ormore" />

The Context Engine ignores the implies attribute of any property element that also has its requires attribute set to a value.