<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:include schemaLocation="http://stepmom.wicourts.gov/xsd/dnr_common0_07.xsd"/>

  <xs:element name="dnrCase">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="timestampSent" type="DNRTimestampT" default="0001-01-01-00.00.00.000000"/>
        <xs:element name="codeVersion" type="xs:string" />      
        <xs:element name="countyNumber" type="countyNoT" />
        <xs:element name="countyName" type="xs:string" />
        <xs:element name="caseNumber" type="caseNoT" />
        <xs:element name="party" type="partyT" maxOccurs="unbounded" />
        <xs:element name="charge" type="chargeT" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  
  <xs:complexType name="partyT">
    <xs:sequence>
      <xs:element name="nameF" type="firstNameT" minOccurs="0" />
      <xs:element name="nameM" type="middleNameT" minOccurs="0" />
      <xs:element name="nameL" type="lastNameT" />
      <xs:element name="nameSuffix" type="nameSuffixT" minOccurs="0" />
      <xs:element name="addressOne" type="addressOneT" minOccurs="0" />
      <xs:element name="addressTwo" type="addressTwoT" minOccurs="0" />
      <xs:element name="city" type="cityT" minOccurs="0" />
      <xs:element name="state" type="DNRTerritoryT" minOccurs="0" />
      <xs:element name="zip" type="postalCodeT" minOccurs="0" />
      <xs:element name="country" type="countryT" minOccurs="0" />
      <xs:element name="dateOfBirth" type="moDayYearDateT" minOccurs="0" />
      <xs:element name="sex" type="DNRSexTypeCodeT" minOccurs="0" />
      <xs:element name="demographics" type="demographicsT" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
  
  <xs:complexType name="demographicsT">
    <xs:sequence>
      <xs:element name="dnrCustomerNumber" type="DNRCustomerNoT" minOccurs="0" />    
      <xs:element name="socSecNo" type="string25T" minOccurs="0" />
	  <xs:element name="telephone" type="string12T" minOccurs="0"/>
	  <xs:element name="raceCode" type="raceCodeT" minOccurs="0"/>
	  <xs:element name="hairColorCode" type="hairColorCodeT" minOccurs="0"/>
	  <xs:element name="eyeColorCode" type="DNREyeColorCodeT" minOccurs="0"/>
      <xs:element name="heightFeet" type="heightFeetT" minOccurs="0"/>
	  <xs:element name="heightInches" type="heightInchesT" minOccurs="0"/>
	  <xs:element name="weight" type="int5EmptyT" minOccurs="0"/>
	</xs:sequence>
  </xs:complexType>
  
  <xs:complexType name="chargeT">
    <xs:sequence>
      <xs:element name="chargeNumber" type="xs:positiveInteger" />
      <xs:element name="ordStatFlag" type="ordStatuteFlagT" />
      <xs:element name="offenseDate" type="moDayYearDateT" minOccurs="0" />
      <xs:element name="offenseDateRange" type="string100T" minOccurs="0" />
      <xs:element name="issuingAgencyNo" type="int5EmptyT" minOccurs="0" />
      <xs:element name="issuingAgencyName" type="string50T" minOccurs="0" />
      <xs:element name="bookingOri" type="string9T" minOccurs="0" />
      <xs:element name="plntfAgencyNo" type="int5EmptyT" />
      <xs:element name="statuteCite" type="statuteCiteT" />
      <xs:element name="description" type="string100T" />
      <xs:element name="statuteSevSeqNo" type="int5EmptyT" minOccurs="0" />
      <xs:element name="pleaCode" type="string4T" minOccurs="0" />
      <xs:element name="isPartyTo" type="trueOrFalseT" />
      <xs:element name="formInfo" type="formInfoT" minOccurs="0" maxOccurs="1" />
      <xs:element name="citation" type="citationT" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="modifier" type="modifierT" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="judgment" type="judgmentT" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="chargeSeqNo" type="seqNoT" use="required" />
  </xs:complexType>        
        
  <xs:complexType name="citationT">
    <xs:sequence>
      <xs:element name="citationType" type="citnTypeT" />
      <xs:element name="envelopeNo" type="int9EmptyT" minOccurs="0" />
      <xs:element name="mandatoryAppear" type="trueOrFalseT" />
      <xs:element name="appearanceDate" type="moDayYearDateT" />
      <xs:element name="appearanceTime" type="timeT" />
      <xs:element name="appearanceCourtNumber" type="appearanceCourtNumberT" minOccurs="0" />
      <xs:element name="fineForfAmt" type="moneyEmptyT" minOccurs="0" />
      <xs:element name="wildAmimalSurcharge" type="moneyEmptyT" minOccurs="0" />  
      <xs:element name="depositType" type="string1T" />
      <xs:element name="ordStatFlag" type="ordStatuteFlagT" minOccurs="0" />
      <xs:element name="statuteCite" type="statuteCiteT" />  
      <xs:element name="statuteSevSeqNo" type="int5EmptyT" minOccurs="0" />
      <xs:element name="statuteDescr" type="string100T" />       
      <xs:element name="isWildlifeViolComp" type="trueOrFalseT" />
      <xs:element name="maxPenaltyAmt" type="moneyEmptyT" minOccurs="0" />
      <xs:element name="individualType" type="individualTypeT" />
      <xs:element name="operLicNo" type="string25T" minOccurs="0" />
      <xs:element name="operLicState" type="DNRTerritoryT" minOccurs="0" />
      <xs:element name="operLicExpYear" type="int5EmptyT" minOccurs="0" />
      <xs:element name="citnVin" type="string21T" minOccurs="0" />
      <xs:element name="vehicleIdNo" type="string20T" minOccurs="0" />
      <xs:element name="vehLicYear" type="int10EmptyT" minOccurs="0" />
      <xs:element name="vehLicType" type="string3T" minOccurs="0" />
      <xs:element name="vehLicTypeDescr" type="string100T" minOccurs="0" />
      <xs:element name="vehModYear" type="int10EmptyT" minOccurs="0" />
      <xs:element name="vehMakeCode" type="string4T" minOccurs="0" />
      <xs:element name="vehMakeCodeDescr" type="string100T" minOccurs="0" />
      <xs:element name="vehStyleCode" type="DNRCitVehicleStyleTypeCodeT" minOccurs="0" />
      <xs:element name="vehStyleCodeDescr" type="string40T" minOccurs="0" />
      <xs:element name="vehColorCode" type="DNRVehicleColorTypeCodeT" minOccurs="0" />
      <xs:element name="vehColorCodeDescr" type="string30T" minOccurs="0" />
      <xs:element name="vehLicState" type="DNRTerritoryT" minOccurs="0" />
      <xs:element name="issuingNCICNo" type="DNRNcicNbT" minOccurs="0" />
      <xs:element name="officerId" type="string10T" minOccurs="0" />
      <xs:element name="officerNameF" type="firstNameT" minOccurs="0" />
      <xs:element name="officerNameM" type="middleNameT" minOccurs="0" />
      <xs:element name="officerNameL" type="lastNameT" minOccurs="0" />
      <xs:element name="officerNameSuffix" type="nameSuffixT" minOccurs="0" />      
      <xs:element name="locationCode" type="DNRPlantiffCommunityCodeT" />
      <xs:element name="weekDayCode" type="DNRWeekdayCodeT" minOccurs="0" />
      <xs:element name="offenseDate" type="moDayYearDateT" />
      <xs:element name="violationTime" type="timeT" minOccurs="0" />
      <xs:element name="probableCauseText" type="textT" minOccurs="0" />
      <xs:element name="servedDate" type="moDayYearDateT" minOccurs="0" />
      <xs:element name="deliveryType" type="deliveryTypeT" minOccurs="0" />
      <xs:element name="issuingName" type="string50T" minOccurs="0" />
    </xs:sequence>
    <xs:attribute name="citnNo" type="string16T" use="required" />
  </xs:complexType>
  
  <xs:complexType name="modifierT">
    <xs:sequence>
	  <xs:element name="statuteCite" type="statuteCiteT"/>
	  <xs:element name="description" type="string100T"/>
	</xs:sequence>
	<xs:attribute name="chargeModSeqNo" type="seqNoT" use="required"/>
  </xs:complexType>  
	
  <xs:complexType name="judgmentT">
    <xs:sequence>
      <xs:element name="jdgmtDispoDate" type="moDayYearDateT" minOccurs="0"/>
      <xs:element name="orderDate" type="moDayYearDateT" minOccurs="0"/>
      <xs:element name="dispositionCode" type="string5T" />
      <xs:element name="dispoText" type="textT" minOccurs="0"/>
      <xs:element name="sentence" type="sentenceT" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="assessment" type="assessmentT" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="timeCondition" type="timeConditionT" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="miscCondition" type="miscConditionT" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="superTimeCondition" type="timeConditionT" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="superMiscCondition" type="miscConditionT" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="judgmentSeqNo" type="seqNoT" use="required"/>
  </xs:complexType>
  	
  <xs:complexType name="sentenceT">
    <xs:sequence>
      <xs:element name="sentenceCode" type="sentCodeT" />
      <xs:element name="dnrLicenseCode" type="DNRLicenseTypeCodeT" minOccurs="0" />
      <xs:element name="lengthOne" type="int5EmptyT" minOccurs="0" />
      <xs:element name="periodOne" type="periodCodeT" minOccurs="0" />
      <xs:element name="lengthTwo" type="int5EmptyT" minOccurs="0" />
      <xs:element name="periodTwo" type="periodCodeT" minOccurs="0" />
      <xs:element name="sentenceDate" type="moDayYearDateT" minOccurs="0" />
      <xs:element name="sentenceText" type="textT" minOccurs="0" />
      <xs:element name="beginDate" type="moDayYearDateT" minOccurs="0" />
      <xs:element name="beginTime" type="timeT" minOccurs="0" />
    </xs:sequence>
    <xs:attribute name="sentenceSeqNo" type="seqNoT" use="required"/>
  </xs:complexType>
    	
  <xs:complexType name="assessmentT">
    <xs:sequence>
      <xs:element name="scheduleCode" type="string5T" />
      <xs:element name="totalAmountDue" type="moneyEmptyT" />
      <xs:element name="paidToDate" type="moneyEmptyT" />
      <xs:element name="totalAdjustments" type="moneyEmptyT" />
      <xs:element name="probAmt" type="moneyEmptyT" />
      <xs:element name="daysToPay" type="xs:nonNegativeInteger" minOccurs="0" />
      <xs:element name="dueDate" type="moDayYearDateT" minOccurs="0" />
      <xs:element name="enfmtActionCode" type="string2T" minOccurs="0" />
      <xs:element name="ftpStartDate" type="moDayYearDateT" minOccurs="0" />
      <xs:element name="ftpActionTime" type="int5EmptyT" minOccurs="0" />
      <xs:element name="ftpActionPeriod" type="periodCodeT" minOccurs="0" />
      <xs:element name="assessmentDetail" type="assessmentDetailT" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="assessmentNo" type="string12T" use="required"/>
    <xs:attribute name="void" type="trueOrFalseT"/>
  </xs:complexType>
  
  <xs:complexType name="assessmentDetailT">
    <xs:sequence>
      <xs:element name="acctType" type="string3T" />
      <xs:element name="balDue" type="moneyEmptyT" />
    </xs:sequence>
    <xs:attribute name="acctCode" type="string5T" use="required"/>
  </xs:complexType>
  
  <xs:complexType name="timeConditionT">
    <xs:sequence>
      <xs:element name="groupCode" type="string4T" minOccurs="0"/>
      <xs:element name="conditionCode" type="string4T" minOccurs="0"/>
      <xs:element name="beginDate" type="moDayYearDateT" minOccurs="0"/>
      <xs:element name="beginTime" type="timeT" minOccurs="0"/>
      <xs:element name="lengthOne" type="int5EmptyT" minOccurs="0"/>
      <xs:element name="periodOne" type="periodCodeT" minOccurs="0"/>
      <xs:element name="lengthTwo" type="int5EmptyT" minOccurs="0"/>
      <xs:element name="periodTwo" type="periodCodeT" minOccurs="0"/>
      <xs:element name="timeServed" type="int5EmptyT" minOccurs="0"/>
      <xs:element name="conditionText" type="textT" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="timeConditionSeqNo" type="seqNoT" use="required"/>
  </xs:complexType>
  
  <xs:complexType name="miscConditionT">
    <xs:sequence>
      <xs:element name="conditionCode" type="string4T" minOccurs="0"/>
      <xs:element name="groupCode" type="string4T" minOccurs="0"/>
      <xs:element name="conditionText" type="textT" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="miscConditionSeqNo" type="seqNoT" use="required"/>
  </xs:complexType>
  
  <!--  these are values entered on the GF forms  -->
  <xs:complexType name="formInfoT">
    <xs:sequence>
      <xs:element name="courtDirective" type="DNRCitationCodeT" minOccurs="0" />
      <xs:element name="courtAction" type="DNRActionCodeT" minOccurs="0" />
      <xs:element name="totalAmountDue" type="moneyEmptyT" minOccurs="0" />
      <xs:element name="datePaid" type="moDayYearDateT" minOccurs="0" />
      <xs:element name="specialInstructions" type="textT" minOccurs="0" />
      <xs:element name="ftpRevocationType" type="DNRLicenseTypeCodeT" minOccurs="0" />
      <xs:element name="sentenceDetails" type="textT" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
	
  <xs:simpleType name="DNRCitationCodeT">
	<xs:restriction base="xs:string">
	  <xs:enumeration value="A" id="CITATION_CODE_ADMINISTRATIVE"/>
	  <xs:enumeration value="C" id="CITATION_CODE_COURT_ORDERED"/>
	  <xs:enumeration value=""/>
	</xs:restriction>
  </xs:simpleType>
	
  <xs:simpleType name="DNRActionCodeT">
	<xs:restriction base="xs:string">
	  <xs:enumeration value="P" id="CITATION_ACTION_PAYMENT"/>
	  <xs:enumeration value="F" id="CITATION_ACTION_FAILURE_TO_PAY"/>
	  <xs:enumeration value="R" id="CITATION_ACTION_REVOCATION"/>
	  <xs:enumeration value="A" id="CITATION_ACTION_AMENDED"/>
	  <xs:enumeration value="V" id="CITATION_ACTION_VACATE"/>
  	  <xs:enumeration value="T" id="CITATION_ACTION_STAY"/>
	  <xs:enumeration value="D" id="CITATION_ACTION_DISMISSED"/>
	  <xs:enumeration value="L" id="CITATION_ACTION_LIFTED"/>
	  <xs:enumeration value="W" id="CITATION_ACTION_WARRANT"/>
	  <xs:enumeration value="S" id="CITATION_ACTION_SUMMONS"/>
	  <xs:enumeration value=""/>
	</xs:restriction>
  </xs:simpleType>
	
  <xs:simpleType name="DNRLicenseTypeCodeT">
	<xs:restriction base="xs:string">
	  <xs:enumeration value="100" id="ALL"/>
	  <xs:enumeration value="130" id="ATV_EDUCATION_CERTIFICATE"/>
	  <xs:enumeration value="150" id="BEAR_CLASS_A"/>
	  <xs:enumeration value="180" id="BOATING_EDUCATION_CERTIFICATE"/>
	  <xs:enumeration value="200" id="CHAPTER_169"/>
	  <xs:enumeration value="210" id="COMMERCIAL_OCCUPATIONAL"/>
	  <xs:enumeration value="280" id="FISHING_COMMERCIAL"/>
	  <xs:enumeration value="290" id="FISHING_RECREATIONAL"/>
	  <xs:enumeration value="330" id="GINSENG"/>
	  <xs:enumeration value="340" id="GUIDE"/>
	  <xs:enumeration value="350" id="HUNTER_EDUCATION_CERTIFICATE"/>
	  <xs:enumeration value="360" id="HUNTING"/>
      <xs:enumeration value="370" id="HUNTING_FISHING"/>	  
	  <xs:enumeration value="400" id="RECREATIONAL_VEHICLE_OPERATION"/>
	  <xs:enumeration value="420" id="SNOWMOBILE_EDUCATION_CERTIFICATE"/>
	  <xs:enumeration value="430" id="SPORT_TROLLING_CHARTER"/>
	  <xs:enumeration value="450" id="TRAPPER_EDUCATION_CERTIFICATE"/>
	  <xs:enumeration value="460" id="TRAPPING"/>
	  <xs:enumeration value="500" id="WILD_RICE"/>
	  <xs:enumeration value="510" id="WOLF_TRAPPER_EDUCATION_CERTIFICATE"/>
	  <xs:enumeration value=""/>	  
	</xs:restriction>
  </xs:simpleType>  
	
</xs:schema>
