使用 BallotSelection 可在比赛中标识选票选择,例如将候选人和政党与其得票数相关联时。
本文档讨论了 BallotSelection 及其子实体:
BallotSelectionCandidateSelectionPartySelectionBallotMeasureSelectionSpecialBallotSelection
选择以下任一 Feed 类型,详细了解如何将 BallotSelection 及其固有元素与该类型的 Feed 搭配使用。
BallotSelection
BallotSelection 是一个抽象元素,具有三种类型,具体使用哪种类型取决于竞赛类型:
CandidateSelection:当竞选涉及一位或多位候选人时,请使用此BallotSelection的type。它将选票选择与Candidate元素相关联。PartySelection:当竞赛类型为Party时,请使用此BallotSelection的type,例如对于政党比例制竞赛。BallotMeasureSelection:使用此类型的BallotSelection来表示BallotMeasureContest中的可能选择。SpecialBallotSelection:这种类型的BallotSelection用于选票统计汇总(例如,将多位候选人汇总为“其他”)和不同类型的非选票(即空白选票、无效选票和“以上皆不选”选票)。
属性
下表介绍了 BallotSelection 的属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
objectId
|
必需 | ID |
供其他元素引用此元素的唯一内部标识符。 |
元素
下表介绍了 BallotSelection 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
SequenceOrder |
0 或 1 | integer |
指定选票选择的默认顺序,以用于显示。 如果 Feed 中不存在 |
CandidateSelection
使用 CandidateSelection 可识别候选人竞选中的选票选择,包括自行填写的候选人。
CandidateSelection 继承 BallotSelection 的属性和元素。如果需要,可以包含对多个 Candidate 元素的引用,例如,当选票选择的是包含多位候选人的选票时。
当一张工单引用多个候选对象时,有时需要保留候选对象的顺序。在这些情况下,我们希望生成应用根据现有的排序方案列出 CandidateIds 中对 Candidate 元素的引用。例如,候选对象的顺序需要与 CandidateContest 类型的 Contest 中 OfficeIds 内的 Office 元素引用的顺序一致。
如果引用了多个 Candidate 对象,系统会按以下顺序向用户显示这些对象:
- 所有将
IsTopTicket设置为true的候选对象都排在没有IsTopTicket值的候选对象之前。这些候选对象会排在所有将IsTopTicket设置为false的候选对象之前。理想情况下,选择应设置为以下任一值:一个没有IsTopTicket值的候选对象;或一对候选对象,其中一个的IsTopTicket设置为true。如果不满足这些条件,则会发生以下情况:- 所有将
IsTopTicket设置为true的候选对象都以未定义的顺序呈现。 - 所有未提供
IsTopTicket的候选对象都以未定义的顺序呈现。 - 所有将
IsTopTicket设置为false的候选对象都以未定义的顺序呈现。
- 所有将
CandidateSelection 的 XML 语法如下:<BallotSelection xsi:type="CandidateSelection">。
元素
下表介绍了 CandidateSelection 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
CandidateIds |
1 | IDREFS |
一个或多个 Candidate 元素的唯一标识符。用于将候选人与选票上的候选人选择相关联。当选票选择涉及多位候选人时(例如同时选择总统和副总统的选票),此属性也很有用。 |
EndorsementPartyIds |
0 个或更多 | IDREFS |
两个或多个 Party 实体的唯一标识符。
这表示一种安排,即政党在选票上列出同一位候选人。 |
IncludedInAggregation |
0 或 1 | boolean |
相应选项的票数是否计入比赛的 AggregateBallotSelection。如果未指定,则假定为 false。
|
IsWriteIn |
0 或 1 | boolean |
指明候选人是否为临时候选人。默认值为 false。 |
示例
XML
<BallotSelection objectId="cs10861" xsi:type="CandidateSelection"> <CandidateIds>can10861a can10861b</CandidateIds> </BallotSelection>
JSON
"BallotSelection": [ { "@type": "CandidateSelection", "objectId": "cs10861", "CandidateIds": [ "can10861a", "can10861b" ] } ]
PartySelection
使用 PartySelection 来标识涉及政党的选票选择,例如选票上的政党名单选择。
PartySelection 会继承 BallotSelection 的属性和元素。PartySelection 的 XML 语法如下:<BallotSelection xsi:type="PartySelection" ... />。
元素
下表介绍了 PartySelection 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
IncludedInAggregation |
0 或 1 | boolean |
相应选项的票数是否计入比赛的 AggregateBallotSelection。如果未指定,则假定为 false。
|
PartyIds |
1 | IDREFS |
一个或多个 Party 元素的唯一标识符。用于将一个或多个当事人与当事人选择相关联。 |
示例
XML
<BallotSelection objectId="ps150" xsi:type="PartySelection"> <PartyIds>par100</PartyIds> </BallotSelection>
JSON
"BallotSelection": [ { "@type": "PartySelection", "objectId": "ps150", "PartyIds": [ "par100" ] } ]
BallotMeasureSelection
使用 BallotMeasureSelection 标识涉及投票表决的选票选择,例如全民公投。
BallotMeasureSelection 会继承 BallotSelection 的属性和元素。BallotMeasureSelection 的 XML 语法如下:<BallotSelection xsi:type="BallotMeasureSelection" ... />。
元素
下表介绍了 BallotMeasureSelection 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
ExternalIdentifiers |
0 或 1 | ExternalIdentifiers |
将 ID 与公投议案选择相关联。必须提供稳定标识符。 |
Selection |
1 | InternationalizedText |
为选票提供可供选择的选项,例如 Yes 或 No。 |
示例
XML
<BallotSelection objectId="bms00" xsi:type="BallotMeasureSelection"> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>bmc0_yes</Value> </ExternalIdentifier> </ExternalIdentifiers> <Selection> <Text language="en">Yes</Text> </Selection> </BallotSelection>
JSON
"BallotSelection": [ { "@type": "BallotMeasureSelection", "objectId": "bms00", "ExternalIdentifiers": { "ExternalIdentifier" : [ { "Type": "other", "OtherType": "stable", "Value": "bmc0_yes" } ] }, "Selection": { "Text": [ { "value": "Yes", "language": "en" } ] } } ]
XML
<BallotSelection objectId="bms00" xsi:type="BallotMeasureSelection"> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>bmc0_yes</Value> </ExternalIdentifier> </ExternalIdentifiers> <Selection> <Text language="en">Yes</Text> </Selection> </BallotSelection>
JSON
"BallotSelection": [ { "@type": "BallotMeasureSelection", "objectId": "bms00", "ExternalIdentifiers": { "ExternalIdentifier" : [ { "Type": "other", "OtherType": "stable", "Value": "bmc0_yes" } ] }, "Selection": { "Text": [ { "value": "Yes", "language": "en" } ] } } ]
SpecialBallotSelection
这种类型的 BallotSelection 用于选票统计汇总(例如,将多位候选人汇总为“其他”)和不同类型的无效选票(即空白选票、无效选票和“以上皆不选”选票)。
SpecialBallotSelection 不应在 Contest 的常规 BallotSelection 子元素中使用,而应在 Contest 上使用其自己的不同字段,即 AggregateBallotSelection、BlankBallotSelection、NoneOfTheAboveBallotSelection 和 NullBallotSelection。如需了解详情,请参阅 Contest 元素。
元素
下表介绍了 SpecialBallotSelection 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
CountedInTotal |
0 或 1 | boolean |
实体选择的票数是否计入被认为值得注意的总票数。如果未指定,则假定为 true。
|
ExternalIdentifiers |
0 或 1 | ExternalIdentifiers |
将 ID 与公投议案选择相关联。必须提供稳定标识符。 |
Selection |
1 | InternationalizedText |
为此选票选项提供名称,例如“其他”或“以上皆无”。 |
示例
XML
<AggregateBallotSelection objectId="selection3"> <Selection> <Text language="en">Other Candidates</Text> </Selection> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>selection3</Value> </ExternalIdentifier> </ExternalIdentifiers> </AggregateBallotSelection> <!-- Counts of ballots left blank --> <BlankBallotSelection objectId="selection4"> <Selection> <Text language="en">Blank ballots</Text> </Selection> <!-- These ballots count in the total and can affect majorities --> <CountedInTotal>true</CountedInTotal> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>selection4</Value> </ExternalIdentifier> </ExternalIdentifiers> </BlankBallotSelection> <!-- Votes for "None of the above" option on the ballot --> <NoneOfTheAboveBallotSelection objectId="selection5"> <!-- The NOTA selection optiona as it appears on the ballot, often "None of the above", "None", or "Uncommitted" --> <Selection> <Text language="en">None</Text> </Selection> <!-- These ballots count in the total and can affect majorities --> <CountedInTotal>true</CountedInTotal> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>selection5</Value> </ExternalIdentifier> </ExternalIdentifiers> </NoneOfTheAboveBallotSelection> <!-- Counts of null or spoiled ballots, i.e. ballots that have been marked in a way that the vote cannot be counted --> <NullBallotSelection objectId="selection5"> <!-- How these ballots are often called in a given country, often "null" or "spoiled" --> <Selection> <Text language="en">Spoiled ballots</Text> </Selection> <!-- These ballots do count in the total and are treated as the same as if this vote did not happen at all --> <CountedInTotal>false</CountedInTotal> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>selection5</Value> </ExternalIdentifier> </ExternalIdentifiers> </NullBallotSelection>
JSON
"AggregateBallotSelection": { "objectId": "selection3", "Selection": { "Text": { "@language": "en", "#text": "Other Candidates" } }, "ExternalIdentifiers": { "ExternalIdentifier": { "Type": "other", "OtherType": "stable", "Value": "selection3" } }, }, "BlankBallotSelection": { "objectId": "selection4", "Selection": { "Text": { "@language": "en", "#text": "Blank Ballots" } }, "CountedInTotal": true, "ExternalIdentifiers": { "ExternalIdentifier": { "Type": "other", "OtherType": "stable", "Value": "selection4" } } }, "NoneOfTheAboveBallotSelection": { "objectId": "selection5", "Selection": { "Text": { "@language": "en", "#text": "None" } }, "CountedInTotal": true, "ExternalIdentifiers": { "ExternalIdentifier": { "Type": "other", "OtherType": "stable", "Value": "selection5" } } }, "NullBallotSelection": { "objectId": "selection5", "Selection": { "Text": { "@language": "en", "#text": "Spoiled ballots" } }, "CountedInTotal": false, "ExternalIdentifiers": { "ExternalIdentifier": { "Type": "other", "OtherType": "stable", "Value": "selection5" } } }