Beispiel

Das folgende Beispiel zeigt ein CER-Regelwerk, das ein anderes Regelwerk enthält:

<?xml version="1.0" encoding="UTF-8"?>
<RuleSet name="Example_Include"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation=
"http://www.curamsoftware.com/CreoleRulesSchema.xsd">

  <!-- This rule class is defined directly in this rule set -->
  <Class name="Person">
    <Attribute name="firstName">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>
  </Class>

  <!-- Include a rule set defined in another file.

       When assembled into a single rule set, the
       names of all the rule classes must be unique. -->
  <Include>
    <RelativePath value="./HelloWorld.xml"/>
  </Include>

</RuleSet>

Im Folgenden ist dasselbe Regelwerk nach der Konsolidierung dargestellt:

<?xml version="1.0" encoding="UTF-8"?><RuleSet
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 name="Example_Include" xsi:noNamespaceSchemaLocation=
"http://www.curamsoftware.com/CreoleRulesSchema.xsd">

  <!-- This rule class is defined directly in this rule set -->
  <Class name="Person">
    <Attribute name="firstName">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>
  </Class>

  <!-- Include a rule set defined in another file.

       When assembled into a single rule set, the
       names of all the rule classes must be unique. -->

<!--Start inclusion of ./HelloWorld.xml-->
<Class name="HelloWorld">

    <Attribute name="greeting">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <String value="Hello, world!"/>
      </derivation>
    </Attribute>

  </Class>
<!--End inclusion of ./HelloWorld.xml-->


</RuleSet>