<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="lista" type="lista"/>

  <xs:element name="sezione" type="jaxbRisultatoSezione"/>

  <xs:element name="spoglio" type="jaxbSpoglio"/>

  <xs:complexType name="jaxbSpoglio">
    <xs:sequence>
      <xs:element name="id" type="xs:int"/>
      <xs:element name="anno" type="xs:int"/>
      <xs:element name="descrizione" type="xs:string"/>
      <xs:element name="lastUpdate" type="xs:dateTime"/>
      <xs:element name="totaleVotanti" type="xs:int"/>
      <xs:element name="totaleIscritti" type="xs:int"/>
      <xs:element name="totaleValide" type="xs:int"/>
      <xs:element name="totaleBianche" type="xs:int"/>
      <xs:element name="totaleNulle" type="xs:int"/>
      <xs:element name="totaleVotiNulli" type="xs:int"/>
      <xs:element name="totaleContestate" type="xs:int"/>
      <xs:element name="totaleSoloIntestatario" type="xs:int"/>
      <xs:element name="sezioniScrutinate" type="xs:int"/>
      <xs:element name="sezioniTotali" type="xs:int"/>
      <xs:element name="risultati" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="lista" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="sezioni" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="sezione" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="lista">
    <xs:sequence>
      <xs:element name="id" type="xs:int"/>
      <xs:element name="descrizione" type="xs:string" minOccurs="0"/>
      <xs:element name="voti" type="xs:int"/>
      <xs:element name="percentuale" type="xs:string" minOccurs="0"/>
      <xs:element name="candidati" type="candidato" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="candidato">
    <xs:sequence>
      <xs:element name="nome" type="xs:string" minOccurs="0"/>
      <xs:element name="numero" type="xs:int"/>
      <xs:element name="voti" type="xs:int"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="jaxbRisultatoSezione">
    <xs:sequence>
      <xs:element name="numero" type="xs:int"/>
      <xs:element name="pervenuta" type="xs:boolean" minOccurs="0"/>
      <xs:element name="liste" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="lista" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="votiContestati" type="xs:int"/>
      <xs:element name="votiSoloIntestatario" type="xs:int"/>
      <xs:element name="votiValidi" type="xs:int"/>
      <xs:element name="schedeBianche" type="xs:int"/>
      <xs:element name="schedeNulle" type="xs:int"/>
      <xs:element name="votiNulli" type="xs:int"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

