<?xml version="1.0" encoding="utf-8"?>
<!--
  EML 110 Schema - Election Event

  History: 4.0 Edited by Paul Spencer (Boynings Consulting) 2005/2006
                - major release revision

           5.0 Edited by David RR Webber 2007-02-06
            - made proposer repeatable
            - added endorsement (per NIST issue with straight party vote)
           6.0 Edited by David RR Webber 2008-11-13 and 2009-04-13
           - added Source element from EML 120 to EMLcore
           - added OfficialStatusDetail
  -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:oasis:names:tc:evs:schema:eml" targetNamespace="urn:oasis:names:tc:evs:schema:eml" elementFormDefault="qualified" attributeFormDefault="unqualified" version="6.0" id="eml-230">
 <xs:annotation>
    <xs:documentation> 
      Specification Name: OASIS EML TC - Election Markup Language (EML) 
      Description: This schema here is a member of a library of the XML schemas used in EML. The XML schemas define the formal structures of the election data that can be processed.
      Produced by: OASIS Election Technical Committee
      URL: http://www.oasis-open.org/committees/election
      Version: 6.0  
      Status: Committee Draft 
      Copyright: 2001-09, OASIS, http://www.oasis-open.org
      Conformance: This is a base implementation schema - actual localization schema for use may be derived from this schema - but may not contradict the structure definitions provided here.
    </xs:documentation>
  </xs:annotation>
	<xs:include schemaLocation="emlcore-v6-0.xsd"/>
	<xs:element name="EML">
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="EMLstructure">
					<xs:sequence>
						<xs:element ref="CandidateList"/>
					</xs:sequence>
					<xs:attribute name="Id" fixed="230" use="required"></xs:attribute>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
		<xs:unique name="DisplayOrder">
			<xs:selector xpath=".//*"/>
			<xs:field xpath="@DisplayOrder"/>
		</xs:unique>
	</xs:element>
	<xs:element name="CandidateList">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="EventIdentifier" minOccurs="0"/>
				<xs:element name="EventDate" type="SimpleDateRangeStructure" minOccurs="0"/>
				<xs:element name="ListDate" type="DateType" minOccurs="0"/>
				<xs:element ref="OfficialStatusDetail"  minOccurs="0"/>
				<xs:element ref="PollingDistrict" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="Election" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element ref="ElectionIdentifier"/>
							<xs:element name="Contest" maxOccurs="unbounded">
								<xs:complexType>
									<xs:sequence>
										<xs:element ref="ContestIdentifier"/>
										<xs:element name="Description" type="MessagesStructure" minOccurs="0"/>
										<xs:choice maxOccurs="unbounded">
											<xs:element ref="Candidate"/>
											<xs:element name="Affiliation">
												<xs:complexType>
													<xs:complexContent>
														<xs:extension base="AffiliationStructure">
															<xs:sequence>
																<xs:element ref="Candidate" minOccurs="0" maxOccurs="unbounded"/>
																<xs:element ref="Proposer" minOccurs="0" maxOccurs="unbounded"/>
																<xs:element ref="Endorsement" minOccurs="0" maxOccurs="unbounded"/>
															</xs:sequence>
														</xs:extension>
													</xs:complexContent>
												</xs:complexType>
											</xs:element>
										</xs:choice>
										<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

