Powered by SmartDoc

Schema definition

The RELAX Schema of the Relaxer CDL is shown in List 19.1.1[RelaxerCDL.rxm].

RelaxerCDL.rxm
<?xml version="1.0"?>

<!--
<!DOCTYPE module SYSTEM "relaxCore.dtd">
-->

<module xmlns="http://www.xml.gr.jp/xmlns/relaxCore"
        relaxCoreVersion="1.0"
        targetNamespace="http://www.relaxer.org/xmlns/cdl/1.0">
<!--
http://www.relaxer.org/xmlns/idl/1.0
http://www.relaxer.org/xmlns/cdl/1.0
-->
<!--
Dec. 20, 2000
Nov. 26, 2002
-->

  <interface>
    <export label="component"/>
    <export label="interface"/>
  </interface>

  <elementRule label="component">
    <tag>
      <attribute name="name" type="token" required="true"/>
      <attribute name="namespace" type="token" required="true"/>
    </tag>
    <sequence>
<!--      <hedgeRef label="attribute" occurs="*"/> -->
      <choice occurs="*">
        <ref label="interface"/>
        <ref label="interfaceRef"/>
      </choice>
      <ref label="invariant" occurs="*"/>
      <ref label="state" occurs="?"/>
      <ref label="relaxer" occurs="?"/>
    </sequence>
  </elementRule>

  <elementRule label="interfaceRef">
    <tag name="interface">
      <attribute name="href" type="token" required="true"/>
      <attribute name="name" type="none"/>
      <attribute name="namespace" type="none"/>
      <attribute name="javaType" type="token"/>
    </tag>
    <empty/>
  </elementRule>

  <elementRule label="interface">
    <tag name="interface">
      <attribute name="name" type="token" required="true"/>
      <attribute name="namespace" type="token"/>
      <attribute name="href" type="none"/>
      <attribute name="javaType" type="token"/>
    </tag>
    <sequence>
      <choice occurs="*">
        <ref label="grammar"/>
        <ref label="module"/>
      </choice>
      <hedgeRef label="attribute" occurs="*"/>
      <ref label="operation" occurs="*"/>
      <ref label="invariant" occurs="*"/>
      <ref label="extern" occurs="?"/>
      <ref label="relaxer" occurs="?"/>
    </sequence>
  </elementRule>

  <elementRule label="grammar">
    <tag name="grammar">
      <attribute name="namespace" type="token"/>
      <attribute name="location" type="token"/>
    </tag>
    <sequence>
      <empty/>
    </sequence>
  </elementRule>

  <elementRule label="module">
    <tag name="module">
      <attribute name="namespace" type="token"/>
      <attribute name="location" type="token"/>
    </tag>
    <sequence>
      <empty/>
    </sequence>
  </elementRule>

  <hedgeRule label="attribute">
    <choice>
      <ref label="attributeType"/>
      <ref label="attributeLabel"/>
    </choice>
  </hedgeRule>

  <elementRule label="attributeType">
    <tag name="attribute">
      <ref role="attributeCommon"/>
      <attribute name="type" type="token" required="true"/>
      <attribute name="label" type="none"/>
    </tag>
    <sequence>
      <ref label="facet" occurs="*"/>
    </sequence>
<!-- <hedgeRef label="facets" occurs="*"/> -->
  </elementRule>

  <elementRule label="attributeLabel">
    <tag name="attribute">
      <ref role="attributeCommon"/>
      <attribute name="type" type="none"/>
      <attribute name="label" type="token" required="true"/>
      <attribute name="javaType" type="token"/>
    </tag>
    <empty/>
  </elementRule>

  <attPool role="attributeCommon">
    <attribute name="name" type="token" required="true"/>
    <attribute name="mode" type="token">
      <enumeration value="read-only"/>
      <enumeration value="write-only"/>
      <enumeration value="read-write"/>  <!-- default -->
    </attribute>
    <attribute name="access" type="token">
      <enumeration value="public"/>  <!-- default -->
      <enumeration value="protected"/>
      <enumeration value="private"/>
    </attribute>
    <attribute name="default" type="string"/>
  </attPool>

  <elementRule label="operation">
    <tag name="operation">
      <attribute name="name" type="token" required="true"/>
      <attribute name="query" type="boolean"/>
    </tag>
    <sequence>
      <ref label="description" occurs="?"/>
      <hedgeRef label="input" occurs="*"/>
      <hedgeRef label="output" occurs="?"/>
      <ref label="preCondition" occurs="?"/>
      <ref label="postCondition" occurs="?"/>
    </sequence>
  </elementRule>

  <elementRule label="description">
    <tag/>
    <mixed>
      <empty/>
    </mixed>
  </elementRule>

  <elementRule label="invariant">
    <tag name="invariant">
    </tag>
    <sequence>
      <hedgeRef label="constraintExpressions" occurs="*"/>
    </sequence>
  </elementRule>

  <elementRule label="preCondition">
    <tag name="preCondition">
    </tag>
    <sequence>
      <hedgeRef label="constraintExpressions" occurs="*"/>
    </sequence>
  </elementRule>

  <elementRule label="postCondition">
    <tag name="postCondition">
    </tag>
    <sequence>
      <hedgeRef label="constraintExpressions" occurs="*"/>
    </sequence>
  </elementRule>

  <hedgeRule label="input">
    <choice>
      <ref label="inLabel"/>
      <ref label="inType"/>
    </choice>
  </hedgeRule>

  <hedgeRule label="output">
    <choice>
      <ref label="outLabel"/>
      <ref label="outType"/>
    </choice>
  </hedgeRule>

  <elementRule label="inLabel">
    <tag name="in">
      <ref role="paramLabel"/>
    </tag>
    <sequence>
      <empty/>
    </sequence>
  </elementRule>

  <elementRule label="inType">
    <tag name="in">
      <ref role="paramType"/>
    </tag>
    <sequence>
      <ref label="facet" occurs="*"/>
    </sequence>
  </elementRule>

  <elementRule label="outLabel">
    <tag name="out">
      <ref role="paramLabel"/>
    </tag>
    <sequence>
      <empty/>
    </sequence>
<!--
    <sequence>
      <ref label="facet" occurs="*"/>
    </sequence>
-->
  </elementRule>

  <elementRule label="outType">
    <tag name="out">
      <ref role="paramType"/>
    </tag>
    <sequence>
      <ref label="facet" occurs="*"/>
    </sequence>
  </elementRule>

  <attPool role="paramLabel">
    <attribute name="name" type="token"/>
    <attribute name="namespace" type="token"/>
    <attribute name="label" type="token" required="true"/>
    <attribute name="type" type="none"/>
    <attribute name="javaType" type="token"/>
  </attPool>

  <attPool role="paramType">
    <attribute name="name" type="token"/>
    <attribute name="type" type="token" required="true"/>
    <attribute name="label" type="none"/>
    <attribute name="namespace" type="none"/>
    <attribute name="javaType" type="token"/>
  </attPool>

<!-- constraint -->

  <hedgeRule label="constraintExpressions">
    <choice>
      <hedgeRef label="exprHedge"/>
    </choice>
  </hedgeRule>

  <hedgeRule label="exprHedge">
    <choice>
      <ref label="fetchAttribute"/>
      <ref label="fetchOperation"/>
      <ref label="fetchParameter"/>
      <ref label="fetchResult"/>
      <ref label="value"/>
      <ref label="verifyType"/>
      <ref label="verifyLabel"/>
      <ref label="verifyExpression"/>
      <ref label="and"/>
      <ref label="or"/>
      <ref label="not"/>
      <ref label="equal"/>
      <ref label="plus"/>
      <ref label="subtract"/>
      <ref label="times"/>
      <ref label="divide"/>
      <ref label="lessThan"/>
      <ref label="greaterThan"/>
      <ref label="lessEqualThan"/>
      <ref label="greaterEqualThan"/>
    </choice>
  </hedgeRule>

  <elementRule label="fetchAttribute">
    <tag name="attribute">
      <attribute name="namespace" type="token"/>
      <attribute name="name" type="token" required="true"/>
      <attribute name="path" type="token"/>
      <attribute name="timing" type="token"/>
    </tag>
    <empty/>
  </elementRule>

  <elementRule label="fetchOperation">
    <tag name="operation">
      <attribute name="namespace" type="token"/>
      <attribute name="name" type="token" required="true"/>
      <attribute name="path" type="token"/>
      <attribute name="timing" type="token"/>
    </tag>
    <sequence>
      <ref label="foParam" occurs="*"/>
    </sequence>
  </elementRule>

  <elementRule label="foParam">
    <tag name="in">
      <attribute name="name" type="token" required="true"/>
      <attribute name="type" type="token"/>
      <attribute name="label" type="token"/>
    </tag>
    <mixed>
      <empty/> <!-- any -->
    </mixed>
  </elementRule>

  <elementRule label="fetchParameter">
    <tag name="in">
      <attribute name="name" type="token" required="true"/>
      <attribute name="path" type="token"/>
      <attribute name="timing" type="token"/>
    </tag>
    <mixed>
      <empty/> <!-- any -->
    </mixed>
  </elementRule>

  <elementRule label="fetchResult">
    <tag name="out">
      <attribute name="path" type="token"/>
    </tag>
    <mixed>
      <empty/> <!-- any -->
    </mixed>
  </elementRule>

  <elementRule label="value" type="token">
    <tag name="value">
    </tag>
  </elementRule>

  <elementRule label="verifyType">
    <tag name="verify">
      <attribute name="type" type="token" required="true"/>
      <attribute name="label" type="none"/>
    </tag>
    <sequence>
      <ref label="facet" occurs="*"/>
      <hedgeRef label="exprHedge"/>
    </sequence>
  </elementRule>

  <elementRule label="verifyLabel">
    <tag name="verify">
      <attribute name="type" type="none"/>
      <attribute name="label" type="token" required="true"/>
    </tag>
    <sequence>
      <ref label="facet" occurs="*"/>
      <hedgeRef label="exprHedge"/>
    </sequence>
  </elementRule>

  <elementRule label="verifyExpression">
    <tag name="verify">
      <attribute name="expression" type="token" required="true"/>
    </tag>
    <empty/>
  </elementRule>

  <elementRule label="and">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge" occurs="*"/>
    </sequence>
  </elementRule>

  <elementRule label="or">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge" occurs="*"/>
    </sequence>
  </elementRule>

  <elementRule label="not">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge"/>
    </sequence>
  </elementRule>

  <elementRule label="equal">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge"/>
      <hedgeRef label="exprHedge"/>
    </sequence>
  </elementRule>

  <elementRule label="plus">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge" occurs="+"/>
    </sequence>
  </elementRule>

  <elementRule label="subtract">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge" occurs="+"/>
    </sequence>
  </elementRule>

  <elementRule label="times">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge" occurs="+"/>
    </sequence>
  </elementRule>

  <elementRule label="divide">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge" occurs="+"/>
    </sequence>
  </elementRule>

  <elementRule label="lessThan">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge"/>
      <hedgeRef label="exprHedge"/>
    </sequence>
  </elementRule>

  <elementRule label="greaterThan">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge"/>
      <hedgeRef label="exprHedge"/>
    </sequence>
  </elementRule>

  <elementRule label="lessEqualThan">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge"/>
      <hedgeRef label="exprHedge"/>
    </sequence>
  </elementRule>

  <elementRule label="greaterEqualThan">
    <tag/>
    <sequence>
      <hedgeRef label="exprHedge"/>
      <hedgeRef label="exprHedge"/>
    </sequence>
  </elementRule>

<!-- -->

  <elementRule label="facet" type="token">
    <tag>
      <attribute name="name" type="token" required="true"/>
      <attribute name="uri" type="token"/>
    </tag>
  </elementRule>

<!--
  <hedgeRule label="facets">
    <choice>
      <ref label="enumeration"/>
      <ref label="minInclusion"/>
      <ref label="maxInclusion"/>
      <ref label="minExclusion"/>
      <ref label="maxExclusion"/>
    </choice>
  </hedgeRule>

  <elementRule label="enumeration">
    <tag>
      <attribute name="value" type="string" required="true"/>
    </tag>
    <empty/>
  </elementRule>

  <elementRule label="minInclusion">
    <tag>
      <attribute name="value" type="string" required="true"/>
    </tag>
    <empty/>
  </elementRule>

  <elementRule label="maxInclusion">
    <tag>
      <attribute name="value" type="string" required="true"/>
    </tag>
    <empty/>
  </elementRule>

  <elementRule label="minExclusion">
    <tag>
      <attribute name="value" type="string" required="true"/>
    </tag>
    <empty/>
  </elementRule>

  <elementRule label="maxExclusion">
    <tag>
      <attribute name="value" type="string" required="true"/>
    </tag>
    <empty/>
  </elementRule>
-->

<!-- state transition -->

  <elementRule label="stateInfo">
    <tag>
    </tag>
    <sequence>
      <empty/>
    </sequence>
  </elementRule>

  <elementRule label="state">
    <tag>
    </tag>
    <sequence>
      <empty/>
    </sequence>
  </elementRule>

<!-- -->

  <elementRule label="extern">
    <tag>
    </tag>
    <sequence>
      <choice occurs="*">
        <ref label="interface"/>
        <ref label="interfaceRef"/>
        <ref label="javaInterfaceRef"/>
      </choice>
      <ref label="resourceRef" occurs="*"/>
    </sequence>
  </elementRule>

  <elementRule label="javaInterfaceRef">
    <tag name="interface">
      <attribute name="javaType" type="token" required="true"/>
      <attribute name="name" type="none"/>
      <attribute name="href" type="none"/>
    </tag>
    <sequence>
      <empty/>
    </sequence>
  </elementRule>

  <elementRule label="resourceRef">
    <tag name="resource">
      <attribute name="namespace" type="token" required="true"/>
      <attribute name="name" type="token" required="true"/>
    </tag>
    <sequence>
      <empty/>
    </sequence>
  </elementRule>

<!-- -->

  <elementRule label="relaxer">
    <tag>
      <attribute name="package" type="token"/>
      <attribute name="classPrefix" type="token"/>
      <attribute name="jdbc" type="boolean"/>
      <attribute name="cdl.sp.package" type="token"/>
    </tag>
    <empty/>
  </elementRule>

</module>