<?xml version="1.0" encoding="utf-8"?>
<as:CAM CAMlevel="1" version="0.13" 
xmlns:as="http://www.oasis-open.org/committees/cam" 
xmlns:t="http://www.oasis-open.org/committees/cam/test" 
xmlns:r="http://www.oasis-open.org/committees/cam/test/root">
 <as:Header>
  <as:Description>A test CAM Template</as:Description>
  <as:Owner>Martin Roberts</as:Owner>
  <as:Version>0.1</as:Version>
  <as:DateTime>2003-05-20T17:00:00</as:DateTime>
  <as:Parameters>
   <as:Parameter name="test" values="One|Two|Three" use="local" default="One"/>
   <as:Parameter name="variable" values="One|Two|Three" xpath="//t:variable" use="local"/>
  </as:Parameters>
 </as:Header>
 <as:AssemblyStructure>
 <as:Structure ID="first" taxonomy="XML">
  <r:root xmlns:r="http://www.oasis-open.org/committees/cam/test/root">
  <t:Test xmlns:t="http://www.oasis-open.org/committees/cam/test">
   <t:maskTests>
   <t:time>%%</t:time>
   </t:maskTests>
   <t:choices>
   <t:choiceOne>
    <t:one>%%</t:one>
   </t:choiceOne>
   <t:choiceTwo>
    <t:two>%%</t:two>
   </t:choiceTwo>
   <t:choiceThree>
    <t:three>%%</t:three>
   </t:choiceThree>
   </t:choices>
   <t:choices1>
   <t:choiceOne>
    <t:one>%%</t:one>
   </t:choiceOne>
   <t:choiceTwo>
    <t:two>%%</t:two>
   </t:choiceTwo>
   <t:choiceThree>
    <t:three>%%</t:three>
   </t:choiceThree>
   </t:choices1>
   <t:choices2>
   <t:choiceOne>
    <t:one>%%</t:one>
   </t:choiceOne>
   <t:choiceTwo>
    <t:two>%%</t:two>
   </t:choiceTwo>
   <t:choiceThree>
    <t:three>%%</t:three>
   </t:choiceThree>
   </t:choices2>
   <t:choices3>
   <t:choiceOne>
    <t:one>%%</t:one>
   </t:choiceOne>
   <t:choiceTwo>
    <t:two>%%</t:two>
   </t:choiceTwo>
   <t:choiceThree>
    <t:three>%%</t:three>
   </t:choiceThree>
   </t:choices3>
   <t:mandatoryField>%%</t:mandatoryField>
   <t:fixedValueField>fixed</t:fixedValueField>
   <t:optionalField>%%</t:optionalField>
   <t:optionalField2>%%</t:optionalField2>
   <!-- left out of test input file-->
   <t:restrictValuesField>%%</t:restrictValuesField>
   <!--allowed values A|B|C-->
   <t:setValueField>%%</t:setValueField>
   <t:setLengthField>%%</t:setLengthField>
   <t:setIDField>%%</t:setIDField>
   <t:masks>
   <t:dateMask>%%</t:dateMask>
   <t:numberMask>%%</t:numberMask>
   <t:stringMask>%%</t:stringMask>
   </t:masks>
   <t:Repeatable>
   <t:repeatUnlimited>%%</t:repeatUnlimited>
   </t:Repeatable>
   <t:RepeatableButLimited>
   <t:repeatLimited>%%</t:repeatLimited>
   </t:RepeatableButLimited>
   <t:ComplexRepeatable>
   <t:repeatUnlimited>%%</t:repeatUnlimited>
   <t:repeatLimited>%%</t:repeatLimited>
   </t:ComplexRepeatable>
   <t:RepeatableWithVariable>
   <t:repeatSection test="%%">
    <t:variable>%%</t:variable>
    <t:choicesR>
    <t:choiceOne>%%</t:choiceOne>
    <t:choiceTwo>%%</t:choiceTwo>
    <t:choiceThree>%%</t:choiceThree>
    </t:choicesR>
   </t:repeatSection>
   </t:RepeatableWithVariable>
   <t:toBeExcludedasElement>
   <t:excluded>%%</t:excluded>
   </t:toBeExcludedasElement>
   <t:toBeExcludedasTree>
   <t:tree>
    <t:branch>
    <t:leaf>%%</t:leaf>
    </t:branch>
   </t:tree>
   </t:toBeExcludedasTree>
   <t:toBeUsedasElement>
   <t:used>%%</t:used>
   <t:notUsed>%%</t:notUsed>
   </t:toBeUsedasElement>
   <t:toBeUsedasTree>
   <t:useTree>
    <t:useBranch>
    <t:useLeaf>%%</t:useLeaf>
    </t:useBranch>
   </t:useTree>
   <t:doNotUseTree>
    <t:useBranch>
    <t:useLeaf>%%</t:useLeaf>
    </t:useBranch>
   </t:doNotUseTree>
   </t:toBeUsedasTree>
   <t:useChoice>
   <t:chosen>%%</t:chosen>
   <t:notChosen>%%</t:notChosen>
   <t:alsoNotChosen>%%</t:alsoNotChosen>
   </t:useChoice>
   <t:attributeTests>
   <t:occursTests mandatory="%%" optional="%%"/>
   <t:contentTests value="%%" fixed="fixedValue" options="%%" length="%%"/>
   <t:attributeUsage toBeExcluded="%%" toBeUsed="%%"/>
   <t:maskTests date="%%" dateTime="%%" time="%%" integer="%%" float="%%" string="%%"/>
   </t:attributeTests>
   <t:wrongNamespace>%%</t:wrongNamespace>
  </t:Test>
  </r:root>
 </as:Structure>
 <as:Structure ID="test" taxonomy="XML">
  <r:ID>test</r:ID>
 </as:Structure>
 </as:AssemblyStructure>
 <as:BusinessUseContext>
 <as:Rules>
  <as:default>
  <as:context>
   <as:constraint action="setDateMask(//t:maskTests/t:time,'HH MI SS')"/>
   <as:constraint action="setChoice(//t:choices/*)"/>
   <as:constraint action="setChoice(//t:choices1/*)"/>
   <as:constraint action="setChoice(//t:choices2/*)"/>
   <as:constraint action="setChoice(//t:choices3/*)"/>
   <as:constraint action="makeMandatory(//t:mandatoryField)"/>
   <as:constraint action="makeOptional(//t:optionalField)"/>
   <as:constraint action="makeOptional(//t:optionalField2)"/>
   <!-- special case of needing single quotes around the the values-->
   <as:constraint action="restrictValues(//t:restrictValuesField,'A'|'B'|'C')"/>
   <as:constraint action="setValue(//t:setValueField,Value)"/>
   <as:constraint action="setLength(//t:setLengthField,10)"/>
   <as:constraint action="setID(//t:setIDField,'IDfield')"/>
   <as:constraint action="setDateMask(//t:dateMask,'YYYY-MM-DDTHH:MI:SS-HH:MI')"/>
   <as:constraint action="setNumberMask(//t:numberMask,'####')"/>
   <as:constraint action="setStringMask(//t:stringMask,'XXXXXX')"/>
   <as:constraint action="makeRepeatable(//t:repeatUnlimited)"/>
   <as:constraint action="makeRepeatable(//t:repeatLimited)"/>
   <as:constraint action="setLimit(//t:repeatLimited,3)"/>
   <as:constraint action="makeRepeatable(//t:repeatSection)"/>
   <as:constraint action="excludeElement(//t:excluded)"/>
   <as:constraint action="excludeTree(//t:toBeExcludedasTree/t:tree)"/>
   <as:constraint action="useElement(//t:toBeUsedasElement/t:used)"/>
   <as:constraint action="useTree(//t:toBeUsedasTree/t:useTree)"/>
   <as:constraint action="useChoice(//t:useChoice/t:chosen)"/>
   <as:constraint action="makeMandatory(//t:occursTests/@mandatory)"/>
   <as:constraint action="makeOptional(//t:occursTests/@optional)"/>
   <as:constraint action="setValue(//t:contentTests/@value,'requiredValue')"/>
   <as:constraint action="restrictValues(//t:contentTests/@options,'one'|'two')"/>
   <as:constraint action="setLength(//t:contentTests/@options,5)"/>
   <as:constraint action="excludeAttribute(//t:attributeUsage/@toBeExcluded)"/>
   <as:constraint action="useAttribute(//t:attributeUsage/@toBeUsed)"/>
   <as:constraint action="setDateMask(//t:maskTests/@date,'DD-MM-YYYY')"/>
   <as:constraint action="setDateMask(//t:maskTests/@dateTime,'YYYYMMDDTHH:MI:SS')"/>
   <as:constraint action="setDateMask(//t:maskTests/@time,'HH:MI:SS')"/>
   <as:constraint action="setNumberMask(//t:maskTests/@integer,'#8')"/>
   <as:constraint action="setNumberMask(//t:maskTests/@float,'####.00')"/>
   <as:constraint action="setStringMask(//t:maskTests/@string,'UU0# 0UU')"/>
  </as:context>
  </as:default>
  <!-- the default context is optional however context specific is not -->
  <as:context condition="$test='One'">
  <as:constraint action="useChoice(//t:choices/t:choiceOne)"/>
  <as:constraint action="setLength(//t:mandatoryField,10)"/>
  <as:constraint action="useChoice(//t:choices2/t:choiceTwo)"/>
  <as:constraint action="useChoice(//t:choices3/t:choiceThree)"/>
  </as:context>
  
  <as:context condition="$variable='One'" scope="//t:repeatSection">
  <as:constraint action="useChoice(t:choicesR/t:choiceOne)"/>
  </as:context>
  <as:context condition="$variable='Two'" scope="//t:repeatSection">
  <as:constraint action="useChoice(t:choicesR/t:choiceTwo)"/>
  </as:context>
  <as:context condition="$variable='Three'" scope="//t:repeatSection">
  <as:constraint action="useChoice(t:choicesR/t:choiceThree)"/>
  </as:context>
 </as:Rules>
 </as:BusinessUseContext>
 <as:ContentReference>
 <as:Addressing>
  <as:registry name="btXML" access="http://localhost/jcam/testDatadictionary.xml" method="Other" methodOther="tML"
  description="An XML file in a tml format that contains the details of the items"/>
 </as:Addressing>
 </as:ContentReference>
</as:CAM>