使用 ElectionReport
做為根實體。定義報表的狀態、格式和產生時間。
ElectionReport
包含下列主要元素:
與 Election
一樣,ElectionReport
會在容器元素中「包裝」元素的出現次數 (Election
除外)。這樣一來,您就能更輕鬆地在 XML 檢視器和編輯器中操作例項檔案。
有時,你可能需要保留特定項目的排序架構,例如辦公室或政黨。在這種情況下,我們希望產生應用程式能根據已建立的任何排序配置定義這些元素。
元素
下表列出 ElectionReport
的元素:
元素 | 多重性 | 類型 | 說明 |
---|---|---|---|
CommitteeCollection |
0 或 1 | 無 | Committee 定義的包裝函式元素。詳情請參閱集合實體。 |
Election |
0 個以上 | Election |
將選舉與報表相關聯。 |
ElectoralCommissionCollection |
0 或 1 | 無 | ElectoralCommission 定義的包裝函式元素。詳情請參閱集合實體。 |
ExternalIdentifiers |
0 或 1 | ExternalIdentifiers |
將 ID 與報表建立關聯。 |
Format |
1 | ReportDetailLevel |
提供報表的詳細程度,例如是否為競賽摘要或選區層級結果。 |
GeneratedDate |
1 | dateTime |
指出選舉報表產生的日期和時間。 |
GpUnitCollection |
0 或 1 | 無 | GpUnit 定義的包裝函式元素。詳情請參閱集合實體。 |
Issuer |
1 | string |
檢舉人資訊。 |
IssuerAbbreviation |
1 | string |
報表發布者的縮寫,例如報表結果所屬州或選區的縮寫。 |
IsTest |
0 或 1 | boolean |
指出報表是否為測試報告。如果沒有這個元素,預設值為 false 。 |
Notes |
0 或 1 | string |
用於在報表中加入任意訊息。 |
OfficeCollection |
0 或 1 | 無 | Office 定義的包裝函式元素。詳情請參閱集合實體。 |
GovernmentBodyCollection |
0 或 1 | 無 | GovernmentBody 定義的包裝函式元素。詳情請參閱集合實體。 |
PartyCollection |
0 或 1 | 無 | Party 定義的包裝函式元素。詳情請參閱集合實體。 |
PersonCollection |
0 或 1 | 無 | Person 定義的包裝函式元素。詳情請參閱收藏品實體。 |
SequenceStart |
1 | integer |
報表的編號,是報表序列的一部分。這個元素會與 SequenceEnd 搭配使用,以便讀取為「1 of 1」、「1 of 2」或「2 of 2」等。開頭為 1 。 |
SequenceEnd |
1 | integer |
報表序列的上限。舉例來說,如果只有一則報表,則為 1 ;如果序列中有兩則報表,則為 2 。 |
Status |
1 | ResultsStatus |
選舉報告的狀態,例如選舉前或非官方。 |
TestType |
0 或 1 | string |
測試類型的說明,例如預選或邏輯和準確度。 |
VendorApplicationID |
1 | string |
產生選舉報表的供應商應用程式 ID。例如 X-EMS version 3.1.a 。 |
VoterInformationCollection |
0 或 1 | 無 | VoterInformation 定義的包裝函式元素。詳情請參閱集合實體。 |
範例
XML
<ElectionReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Election>…</Election> <GpUnitCollection> <GpUnit objectId="ru-gpu0">…</GpUnit> <GpUnit objectId="ru-gpu1">…</GpUnit> </GpUnitCollection> <OfficeCollection> <Office objectId="off0001a">…</Office> </OfficeCollection> <GovernmentBodyCollection> <GovernmentBody objectId="gov0001a">…</GovernmentBody> </GovernmentBodyCollection> <PartyCollection> <Party objectId="par001">…</Party> <Party objectId="par002">…</Party> </PartyCollection> <PersonCollection> <Person objectId="per001">…</Person> <Person objectId="per002">…</Person> </PersonCollection> <Issuer>Example Data Provider</Issuer> <IssuerAbbreviation>EDP</IssuerAbbreviation> <Format>summary-contest</Format> <GeneratedDate>2013-11-05T14:25:28</GeneratedDate> <Status>unofficial-partial</Status> <VendorApplicationId>Hand-Generated v0.1</VendorApplicationId> <SequenceStart>1</SequenceStart> <SequenceEnd>1</SequenceEnd> </ElectionReport>
JSON
{ "@type": "ElectionReport", "Election": [ ... ], "GpUnitCollection": { "GpUnit": [ {...}, {...} ] }, "OfficeCollection": { "Office": [ { "objectId": "off0001a", ... } ] }, "PartyCollection": { "Party": [ { "objectId": "par001", ... }, { "objectId": "par002", ... } ] }, "PersonCollection": { "Person": [ { "objectId": "per001", ... }, { "objectId": "per002", ... } ] }, "Issuer": "Example Data Provider", "IssuerAbbreviation": "EDP", "Format": "summary-contest", 'GeneratedDate": "2013-11-05T14:25:28", "Status": "unofficial-partial", "VendorApplicationId": "Hand-Generated v0.1", "SequenceStart": 1, "SequenceEnd": 1 }