使用 BallotSelection 来标识竞选中的选票选择,例如将候选人和政党与其得票数相关联时。
本文档讨论了 BallotSelection 及其子实体:
BallotSelectionCandidateSelectionPartySelectionBallotMeasureSelection
选择以下任一 Feed 类型,详细了解如何将 BallotSelection 及其固有元素与该类型的 Feed 搭配使用。
BallotSelection
BallotSelection 是一个抽象元素,具有三种类型,具体使用哪种类型取决于竞赛类型:
CandidateSelection:当竞赛面向一位或多位候选人时,请使用此BallotSelection的type。它将选票选择与Candidate元素相关联。PartySelection:当竞赛类型为Party时,请使用此BallotSelection的type,例如对于政党比例制竞赛。BallotMeasureSelection:使用此类型的BallotSelection来表示BallotMeasureContest中的可能选择。
属性
下表介绍了 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 实体的唯一标识符。
这表示一种安排,即政党在选票上列出同一位候选人。 |
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 的元素:
| 元素 | 多样性 | 类型 | 说明 |
|---|---|---|---|
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 |
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" } ] } } ]