OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cam message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: CAM template for EML 530 example


Team,
 
I'm just developing this for use with the new OASIS EML election statistics reporting transaction.
 
Attached sample CAM template to go with the sample 530.
 
Allows you to check a few more things that the schema does not - and also provides a structure model for the style of XML required.
 
Still experimenting to get everything working 100%.  I'm looking to check the different data models associated with the CountMetric element - using the @Id to figure out what metric - and then apply the correct data content model...
 
DW

"The way to be is to do" - Confucius (551-472 B.C.)
<?xml version="1.0" encoding="UTF-8"?>
<as:CAM xmlns:as="http://www.oasis-open.org/committees/cam"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:asm1="urn:oasis:names:tc:evs:schema:eml" CAMlevel="1" version="1.0">
  <as:Header>
    <as:Description>OASIS EML 530 Statistics Use Template</as:Description>
    <as:Owner>Election Markup Language TC</as:Owner>
    <as:Version>0.5</as:Version>
    <as:DateTime>2007-06-30T21:50:04</as:DateTime>
  </as:Header>
  <as:AssemblyStructure>
    <as:Structure ID="EML530 Stats" taxonomy="XML" reference="">
      <asm1:EML Id="530" SchemaVersion="5.0">
        <asm1:TransactionId>%23%</asm1:TransactionId>
        <asm1:MessageLanguage>%en-US%</asm1:MessageLanguage>
        <asm1:IssueDate>%2006-12-14T20:06:12.003%</asm1:IssueDate>
        <asm1:Statistics>
          <asm1:EventIdentifier Id="%2006_Sample_General_Election%" />
          <asm1:Election>
            <asm1:ElectionIdentifier Id="%20061107%" />
            <asm1:Contests>
              <asm1:Contest ReportType="%F%">
                <asm1:ContestIdentifier Id="%001%">
                  <asm1:ContestName>%County Statistics%</asm1:ContestName>
                </asm1:ContestIdentifier>
                <asm1:TotalVotes>
                  <asm1:CountMetric Id="%PR%" Type="%Precincts Reporting%">%25090%</asm1:CountMetric>
                </asm1:TotalVotes>
                <asm1:ReportingUnitVotes ReportType="%F%">
                  <asm1:ReportingUnitIdentifier Id="%01%">%County Name #1%</asm1:ReportingUnitIdentifier>
                  <asm1:CountMetric Id="%PR%" Type="%Precincts Reporting%">%1219%</asm1:CountMetric>
                </asm1:ReportingUnitVotes>
              </asm1:Contest>
            </asm1:Contests>
          </asm1:Election>
        </asm1:Statistics>
      </asm1:EML>
    </as:Structure>
  </as:AssemblyStructure>
  <as:BusinessUseContext>
    <as:Rules>
      <as:default>
        <as:context>
          <as:constraint action="restrictValues(//asm1:EML/asm1:MessageLanguage,'en-US')" />
          <as:constraint action="setDateMask(//asm1:EML/asm1:IssueDate,YYYY-MM-DD'T'HH:MI:SS.SSS)" />
          <as:constraint action="makeRepeatable(//asm1:ReportingUnitVotes/asm1:CountMetric)" />
          <as:constraint action="restrictValues(//asm1:CountMetric/@Id,'PR'|     'TP'|     'PP'|     'VT'|     'TV'|     'VP'|     'FD'|     'FT'|     'LD'|     'LT')" />
          <as:constraint action="makeOptional(//asm1:Contest/@ReportType)" />
          <as:constraint action="makeOptional(//asm1:ReportingUnitVotes/@ReportType)" />
          <as:constraint action="restrictValues(//@ReportType,'F'|       'I'|       'S')" />
          <as:constraint action="makeRepeatable(//asm1:Contest/asm1:ReportingUnitVotes)" />
          <as:constraint action="makeRepeatable(//asm1:TotalVotes/asm1:CountMetric)" />
          <as:context condition="//asm1:CountMetric/@Type='FD'">
            <as:constraint action="setNumberMask(//asm1:CountMetric,##)" />
            <as:constraint action="setNumberRange(//asm1:CountMetric,1-31)" />
          </as:context>
          <as:context condition="//asm1:CountMetric/@Type='LD'">
            <as:constraint action="setNumberMask(//asm1:CountMetric,##)" />
            <as:constraint action="setNumberRange(//asm1:CountMetric,1-31)" />
          </as:context>
        </as:context>
      </as:default>
    </as:Rules>
  </as:BusinessUseContext>
</as:CAM>

<EML xmlns="urn:oasis:names:tc:evs:schema:eml"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 Id="530"
 SchemaVersion="5.0">
  <TransactionId>23</TransactionId>
  <MessageLanguage>en-US</MessageLanguage>
  <IssueDate>2006-12-14T20:06:12.003</IssueDate>
  <Statistics>
    <EventIdentifier Id="2006_Sample_General_Election" />
    <Election>
      <ElectionIdentifier Id="20061107" />
      <Contests>
        <Contest ReportType="F">
        <ContestIdentifier Id="001">
          <ContestName>County Statistics</ContestName>
        </ContestIdentifier>
        <TotalVotes>
            <CountMetric Id="PR" Type="Precincts Reporting">25090</CountMetric>
            <CountMetric Id="TP" Type="Total Precincts">25090</CountMetric>
            <CountMetric Id="PP" Type="Precincts Reporting Percentage">100.0</CountMetric>
            <CountMetric Id="VT" Type="Voter Turnout">8897376</CountMetric>
            <CountMetric Id="TV" Type="Total Registered Voters">15837108</CountMetric>
            <CountMetric Id="VP" Type="Voter Turnout Percentage">56.2</CountMetric>
            <CountMetric Id="FD" Type="First Report Day ">7</CountMetric>
            <CountMetric Id="FT" Type="First Report Time">8:01 PM</CountMetric>
            <CountMetric Id="LD" Type="Last Report Day ">14</CountMetric>
            <CountMetric Id="LT" Type="Last Report Time">2:44 PM</CountMetric>
          </TotalVotes>

        <ReportingUnitVotes ReportType="F">
          <ReportingUnitIdentifier Id="01">County Name #1</ReportingUnitIdentifier>
           <CountMetric Id="PR" Type="Precincts Reporting">1219</CountMetric>
           <CountMetric Id="TP" Type="Total Precincts">1219</CountMetric>
           <CountMetric Id="PP" Type="Precincts Reporting Percentage">100.0</CountMetric>
           <CountMetric Id="VT" Type="Voter Turnout">415638</CountMetric>
           <CountMetric Id="TV" Type="Total Registered Voters">678765</CountMetric>
           <CountMetric Id="VP" Type="Voter Turnout Percentage">61.2</CountMetric>
           <CountMetric Id="FD" Type="First Report Day ">7</CountMetric>
           <CountMetric Id="FT" Type="First Report Time">9:49 PM</CountMetric>
           <CountMetric Id="LD" Type="Last Report Day ">13</CountMetric>
           <CountMetric Id="LT" Type="Last Report Time">9:52 AM</CountMetric>
        </ReportingUnitVotes>
        <ReportingUnitVotes ReportType="F">
          <ReportingUnitIdentifier Id="02">County Name #2</ReportingUnitIdentifier>
          <CountMetric Id="PR" Type="Precincts Reporting">5</CountMetric>
          <CountMetric Id="TP" Type="Total Precincts">5</CountMetric>
          <CountMetric Id="PP" Type="Precincts Reporting Percentage">100.0</CountMetric>
          <CountMetric Id="VT" Type="Voter Turnout">556</CountMetric>
          <CountMetric Id="TV" Type="Total Registered Voters">775</CountMetric>
          <CountMetric Id="VP" Type="Voter Turnout Percentage">71.7</CountMetric>
          <CountMetric Id="FD" Type="First Report Day ">7</CountMetric>
          <CountMetric Id="FT" Type="First Report Time">9:17 PM</CountMetric>
          <CountMetric Id="LD" Type="Last Report Day ">5</CountMetric>
          <CountMetric Id="LT" Type="Last Report Time">9:12 AM</CountMetric>
        </ReportingUnitVotes>
        </Contest>
      </Contests>
    </Election>
  </Statistics>
</EML>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]