<?xml version="1.0" encoding="UTF-8"??>
<xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.w3schools.com"
            xmlns="http://www.w3schools.com"
            elementFormDefault="qualified">

   <xs:simpleType name="SQLBoolean">
      <xs:restriction base="xs:byte">
         <xs:enumeration value="0"/>
         <xs:enumeration value="1"/>
      </xs:restriction>
   </xs:simpleType>

   <xs:complexType name="AddressType">
      <xs:sequence>
         <xs:element name="address"          type="xs:string"/>
         <xs:element name="city"             type="xs:string"/>
         <xs:element name="state"            type="xs:string"     default="PA"/>
         <xs:element name="majorzip"         type="xs:string"/>
         <xs:element name="minorzip"         type="xs:string"/>
         <xs:element name="precinct"         type="xs:integer"/>
         <xs:element name="resident"         type="SQLBoolean"     default="1"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="ContactType">
      <xs:sequence>
         <xs:element name="PrimaryEmail"     type="xs:string"/>
         <xs:element name="PrimaryPhone"     type="xs:string"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="GrassrootsType">
      <xs:sequence>
         <xs:element name="Party"            type="SQLBoolean"     default="0"/>
         <xs:element name="Registration"     type="SQLBoolean"     default="1"/>
         <xs:element name="Absentee"         type="SQLBoolean"     default="1"/>
         <xs:element name="Rally"            type="SQLBoolean"     default="1"/>
         <xs:element name="Yardsign"         type="SQLBoolean"     default="1"/>
         <xs:element name="Donate"           type="SQLBoolean"     default="1"/>
         <xs:element name="Literaturedrop"   type="SQLBoolean"     default="1"/>
         <xs:element name="Fundraiser"       type="SQLBoolean"     default="1"/>
         <xs:element name="LTE"              type="SQLBoolean"     default="1"/>
         <xs:element name="Blog"             type="SQLBoolean"     default="1"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="PersonType">
      <xs:sequence>
         <xs:element name="title"      type="xs:string"/>
         <xs:element name="firstname"  type="xs:string"/>
         <xs:element name="lastname"   type="xs:string"/>
      </xs:sequence>
   </xs:complexType>

   <xs:element name="contact">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="Person"           type="PersonType"/>
            <xs:element name="Address"          type="AddressType"/>
            <xs:element name="ContactInfo"      type="ContactType"/>
            <xs:element name="Grassroots"       type="GrassrootsType"/>
            <xs:element name="DateAdded"        type="xs:date" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>