使用 BallotSelection 标识竞赛中的选票选择,例如将候选人和政党与其得票数相关联时。
本文档讨论了 BallotSelection 及其子实体:
BallotSelectionCandidateSelectionPartySelectionBallotMeasureSelectionSpecialBallotSelection
选择以下一种 Feed 类型,详细了解如何将 BallotSelection 及其固有元素与该类型的 Feed 搭配使用。
BallotSelection
BallotSelection 是一个抽象元素,具有三种类型,具体使用哪种类型取决于竞赛的类型:
CandidateSelection:当竞赛面向一位或多位候选人时,请使用此type的BallotSelection。它会将 选票选择与Candidate元素相关联。PartySelection:当竞赛类型面向Party(例如政党比例竞赛)时,请使用此type的BallotSelection。BallotMeasureSelection:使用此类型的BallotSelection表示BallotMeasureContest中的可能选择。SpecialBallotSelection:此类型的BallotSelection用于得票数汇总(例如,将 多位候选人汇总到“其他”)和不同类型的非投票(即 空白选票、无效或废弃选票,以及“以上皆非”投票)。
属性
下表介绍了 BallotSelection 的属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
objectId
|
必需 | ID |
其他元素用于引用此元素的唯一内部标识符 。 |
元素
下表介绍了 BallotSelection 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
SequenceOrder |
0 或 1 | integer |
指定选票选择的默认顺序,以供显示 。 如果 Feed 中没有 |
CandidateSelection
使用 CandidateSelection 标识候选人竞赛中的选票选择,包括填写候选人。
CandidateSelection 继承了 BallotSelection 的属性和元素。如有必要,可以添加对多个
Candidate元素的引用,例如,当选票选择是针对多位
候选人的选票时。
当为一张选票引用多位候选人时,有时需要保留候选人的顺序。在这种情况下,我们希望生成应用根据现有的排序方案在
CandidateIds中列出对
Candidate元素的引用。例如,
候选人的顺序需要与
Office元素引用在
OfficeIds中Contest类型的
CandidateContest的顺序一致。
如果引用了多个 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="cs-10861" xsi:type="CandidateSelection"> <CandidateIds>can-10861a can-10861b</CandidateIds> </BallotSelection>
PartySelection
使用 PartySelection 标识涉及政党的选票选择,例如选票上的政党名单选择。
PartySelection 继承了 BallotSelection 的属性和元素。
PartySelection 的 XML 语法如下:
<BallotSelection xsi:type="PartySelection" ... />。
元素
下表介绍了 PartySelection 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
IncludedInAggregation |
0 或 1 | boolean |
选择项的得票数是否包含在竞赛的
AggregateBallotSelection 中。如果未指定,则假定为
false。
|
PartyIds |
1 | IDREFS |
一个或多个
Party
元素的唯一标识符。用于将一个或多个政党与政党
选择相关联。 |
示例
XML
<BallotSelection objectId="ps-150" xsi:type="PartySelection"> <PartyIds>par-100</PartyIds> </BallotSelection>
BallotMeasureSelection
使用 BallotMeasureSelection 标识涉及投票议案的选票选择,例如公民投票。
BallotMeasureSelection 继承了 BallotSelection 的属性和元素。BallotMeasureSelection 的 XML 语法如下:
<BallotSelection xsi:type="BallotMeasureSelection" ... />。
元素
下表介绍了 BallotMeasureSelection 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
ExternalIdentifiers |
0 或 1 | ExternalIdentifiers |
将 ID 与投票议案选择相关联。必须提供 稳定的标识符 。 |
Selection |
1 | InternationalizedText |
为选票提供可用选项,例如 Yes
或 No。 |
示例
XML
<BallotSelection objectId="bms-00" xsi:type="BallotMeasureSelection"> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>bms-00-yes</Value> </ExternalIdentifier> </ExternalIdentifiers> <Selection> <Text language="en">Yes</Text> </Selection> </BallotSelection>
XML
<BallotSelection objectId="bms-00" xsi:type="BallotMeasureSelection"> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>bms-00-yes</Value> </ExternalIdentifier> </ExternalIdentifiers> <Selection> <Text language="en">Yes</Text> </Selection> </BallotSelection>
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="sbs-3"> <Selection> <Text language="en">Other Candidates</Text> </Selection> <ExternalIdentifiers> <ExternalIdentifier> <Type>other</Type> <OtherType>stable</OtherType> <Value>sbs-3</Value> </ExternalIdentifier> </ExternalIdentifiers> </AggregateBallotSelection> <!-- Counts of ballots left blank --> <BlankBallotSelection objectId="sbs-4"> <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>sbs-4</Value> </ExternalIdentifier> </ExternalIdentifiers> </BlankBallotSelection> <!-- Votes for "None of the above" option on the ballot --> <NoneOfTheAboveBallotSelection objectId="sbs-5"> <!-- 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>sbs-5</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="sbs-6"> <!-- 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>sbs-6</Value> </ExternalIdentifier> </ExternalIdentifiers> </NullBallotSelection>