For example, here is a rule set that combines a Males18-24 rule set and a Females18-24 rule set which have been defined elsewhere, and sorts the results according to the sorting criteria dynamically specified by the user. In this example, Males18-24.ruleSet and Females18-24.ruleSet refer to rule sets that you have defined elsewhere, and sortby is a property of the UserPreferences component that can be generated dynamically.

<ruleset>
  <includes>
    <ruleset src="/atg/rules/Males18-24.ruleSet"></ruleset>
    <ruleset src="/atg/rules/Females18-24.ruleSet"></ruleset>
  </includes>
  <sortby src="/atg/rules/UserPreferences.sortby"></sortby>
</ruleset>

If you don’t want to include the entire rule set into your rules, use the <rule src="..."> tag to include only a particular rule. The <rule src="..."> tag can appear anywhere within the accepts or rejects block of your rule set, not just the top level. For example:

<accepts>
  <rule op=and>
    <rule src="IsMale.rules"></rule>
    <rule op=eq>
      <valueof target="gender">
      <valueof constant="male">
    </rule>
  </rule>
</accepts>