<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema id="Fatca20" xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <!-- 
            Sķšast breytt: 3.11.2020 - Nż stašsetning į rsktypes
        -->
        <xs:include schemaLocation="https://vefur.rsk.is/ws/schema/rsktypes.xsd"/> 
					
        <xs:element name="Vidskiptastofnun">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="Framtalsar" type="TegNum_4"/>
                    <xs:element name="Audkennisnumer" type="TegString_4"/>
                    <xs:element name="AudkennislykillRSK" type="TegString_1_12"/>
                    <xs:element name="KennitalaStofnunar" type="TegKennitala"/>
                    <xs:element name="DocTypeIndic" type="FatcaDocTypeIndic_EnumType"/>
		    						<xs:element name="Giin" type="TegString_19" minOccurs="0"/>
		    						<xs:element name="FilerCategory" type="FatcaFilerCategory_EnumType" minOccurs="0"/>
		    						<xs:element name="Tolvupostfang" type="TegString_1_200" minOccurs="1"/>
                    <xs:element name="Athugasemdir" type="TegString_1_200" maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element name="Sponsor" type="typOrganisationParty" maxOccurs="1" minOccurs="0"/>
                    <xs:element name="Intermediary" type="typOrganisationParty" maxOccurs="1" minOccurs="0"/>   
                    <xs:element name="AccountHolder" type="typAccountHolder" maxOccurs="unbounded" minOccurs="0"/>        
                </xs:sequence>
            </xs:complexType>
        </xs:element>
				<xs:complexType name="typAccountHolder">
                <xs:sequence>
                    <xs:element type="TegKennitala" name="Kennitala" minOccurs="0"/>
	            			<xs:element type="TegTegundAdila" name="TegundAdila"/>
	            			<xs:element type="TegLandKodi" name="ResCountryCode"/>
		    						<xs:element name="Tin" type="TegString_1_20"  minOccurs="0"/>
		    						<xs:element name="TinLand" type="TegLandKodi"  minOccurs="0"/>
		    						<xs:element name="Nafn" type="TegString_1_200"/>
                    <xs:element name="Gata" type="TegString_1_200" />
                    <xs:element name="Borg" type="TegString_1_200"/>
                    <xs:element name="Fylki" type="TegString_1_200" minOccurs="0"/>
                    <xs:element name="Land" type="TegLandKodi" minOccurs="0"/>
		    						<xs:element name="BirthDate" type="xs:date" minOccurs="0"/>
		    						<xs:element name="BirthCountry" type="TegLandKodi" minOccurs="0"/>
		    						<xs:element name="AcctHolderType" type="FatcaAcctHolderType_EnumType" minOccurs="0"/>
	            			<xs:element name="Account" type="typAccount" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
        </xs:complexType>
				<xs:complexType name="typAccount">
                <xs:sequence>
                    <xs:element name="DocRefId" type="typDocRefId"/>
                    <xs:element name="CorrDocRefId" type="typDocRefId" minOccurs="0"/>
                    <xs:element name="AccountNumber" type="TegString_1_200"/>
		    						<xs:element name="AcctNumberType" type="AcctNumberType_EnumType" minOccurs="0"/>
                    <xs:element name="AccountClosed" type="xs:boolean" minOccurs="0"/>
		    						<xs:element name="CurrCode" type="TegMyntKodi"/>
                    <xs:element name="AccountBalance" type="TegUpphaed"/>
                    <xs:element name="SubstantialOwner" type="typSubstantialOwner" maxOccurs="unbounded" minOccurs="0"/>   
		    						<xs:element name="Payment" type="typPayment" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:complexType>
						<xs:complexType name="typPayment">
                    <xs:sequence>
                        <xs:element name="Type" type="FatcaPaymentType_EnumType"/>
                        <xs:element name="CurrCode" type="TegMyntKodi"/>
                        <xs:element name="PaymentAmnt" type="TegUpphaed"/>
                    </xs:sequence>
                </xs:complexType>       		
        <xs:complexType name="typSubstantialOwner">
                <xs:sequence>
                    <xs:element type="TegKennitala" name="Kennitala" minOccurs="0"/>
	            			<xs:element type="TegTegundAdila" name="TegundAdila"/>
	            			<xs:element type="TegLandKodi" name="ResCountryCode"/>
		    						<xs:element name="Tin" type="TegString_1_20"  minOccurs="0"/>
		    						<xs:element name="TinLand" type="TegLandKodi"  minOccurs="0"/>
		    						<xs:element name="Nafn" type="TegString_1_200"/>
                    <xs:element name="Gata" type="TegString_1_200" />
                    <xs:element name="Borg" type="TegString_1_200"/>
                    <xs:element name="Fylki" type="TegString_1_200" minOccurs="0"/>
                    <xs:element name="Land" type="TegLandKodi" minOccurs="0"/>
		    						<xs:element type="xs:date" name="BirthDate" minOccurs="0"/>
		    						<xs:element type="TegLandKodi" name="BirthCountry" minOccurs="0"/>
                </xs:sequence>
        </xs:complexType>
        
         <xs:simpleType name="typDocRefId">
					<xs:restriction base="xs:string">
					<xs:minLength value="19"/>
					<xs:maxLength value="160"/>
					<xs:pattern value="[A-Z,a-z,0-9,\-,.,:]*"/>
					</xs:restriction>
			</xs:simpleType>
			
			<xs:complexType name="typOrganisationParty">
                <xs:sequence>
                    <xs:element type="TegKennitala" name="Kennitala" minOccurs="1"/>
	            			<xs:element type="TegLandKodi" name="ResCountryCode"/>
		    						<xs:element name="Tin" type="TegString_1_20"  minOccurs="0"/>
		    						<xs:element name="TinLand" type="TegLandKodi"  minOccurs="0"/>
		    						<xs:element name="Nafn" type="TegString_1_200"/>
                    <xs:element name="Gata" type="TegString_1_200" />
                    <xs:element name="Borg" type="TegString_1_200"/>
                    <xs:element name="Fylki" type="TegString_1_200" minOccurs="0"/>
                    <xs:element name="Land" type="TegLandKodi" minOccurs="0"/>
	            			<xs:element name="FilerCategory" type="FatcaFilerCategory_EnumType" minOccurs="0"/>
                </xs:sequence>
        </xs:complexType>
        
        <!-- Schema types copied from the FATCA schema -->
  <xs:simpleType name="FatcaDocTypeIndic_EnumType">
		<xs:annotation>
			<xs:documentation xml:lang="en">The element applies only to the document part in which it is included. In the case of repeated or 
				corrected data elements CorrMessageRefId and CorrDocRefId must contain the identifiers MessageRefId and DocRefId respectively for the data referred to. 
				In the case of a correction the unchanged elements shall be transmitted again - except for the element DocRefId.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="FATCA1">
				<xs:annotation>
					<xs:documentation>New Data</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA2">
				<xs:annotation>
					<xs:documentation>Corrected Data</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA3">
				<xs:annotation>
					<xs:documentation>Void Data</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA4">
				<xs:annotation>
					<xs:documentation>Amended Data</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA11">
				<xs:annotation>
					<xs:documentation>New Test Data</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA12">
				<xs:annotation>
					<xs:documentation>Corrected Test Data</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA13">
				<xs:annotation>
					<xs:documentation>Void Test Data</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA14">
				<xs:annotation>
					<xs:documentation>Amended Test Data</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<!-- Reporting FI Type - 6 -->
	<xs:simpleType name="FatcaFilerCategory_EnumType">
		<xs:annotation>
			<xs:documentation xml:lang="en">Filer Category</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="FATCA601">
				<xs:annotation>
					<xs:documentation>PFFI (other than a Reporting Model 2 FFI and including a U.S. branch of a PFFI not treated as a U.S. person)</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA602">
				<xs:annotation>
					<xs:documentation>RDC FFI</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA603">
				<xs:annotation>
					<xs:documentation>Limited Branch or Limited FFI</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA604">
				<xs:annotation>
					<xs:documentation>Reporting Model 2 FFI</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA605">
				<xs:annotation>
					<xs:documentation>QI, WP, or WT</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA606">
				<xs:annotation>
					<xs:documentation>Direct Reporting NFFE</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA607">
				<xs:annotation>
					<xs:documentation>Sponsoring Entity of a Sponsored FFI</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA608">
				<xs:annotation>
					<xs:documentation>Sponsoring Entity of a Sponsored Direct Reporting NFFE</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA609">
				<xs:annotation>
					<xs:documentation>Trustee of a Trustee-Documented Trust</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA610">
				<xs:annotation>
					<xs:documentation>Withholding Agent (including a U.S. branch of a PFFI, Reporting Model 1 FFI, Reporting Model 2 FFI, 
						or RDC FFI treated as a U.S. person and a U.S. branch of a Reporting Model 1 FFI (including any other RDC FFI) or 
						Limited FFI that is not treated as a U.S. person)</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA611">
				<xs:annotation>
					<xs:documentation>Territory Financial Institution treated as a U.S. person</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<!--  -->
     <!-- Account Holder Type - 1 -->
	<xs:simpleType name="FatcaAcctHolderType_EnumType">
		<xs:annotation>
			<xs:documentation xml:lang="en">Account Holder Type</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="FATCA101">
				<xs:annotation>
					<xs:documentation>Owner-Documented FFI with specified U.S. owner(s)</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA102">
				<xs:annotation>
					<xs:documentation>Passive NFFE with substantial U.S. owner(s)</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA103">
				<xs:annotation>
					<xs:documentation>Non-Participating FFI</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA104">
				<xs:annotation>
					<xs:documentation>Specified U.S. Person</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA105">
				<xs:annotation>
					<xs:documentation>Direct Reporting NFFE</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA106">
				<xs:annotation>
					<xs:documentation>For U.S. Government Use Only (Attention to FIs and HCTAs: Restricted, Do Not Use)</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<!-- FATCA Payment Type - 5 -->
	<xs:simpleType name="FatcaPaymentType_EnumType">
		<xs:annotation>
			<xs:documentation xml:lang="en">The code describing the nature of the payments used in FATCA</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="FATCA501">
				<xs:annotation>
					<xs:documentation>Dividends</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA502">
				<xs:annotation>
					<xs:documentation>Interest</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA503">
				<xs:annotation>
					<xs:documentation>Gross Proceeds/Redemptions</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FATCA504">
				<xs:annotation>
					<xs:documentation>Other</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<!--  -->
	<!-- Account Number Type - 6 -->
	<xs:simpleType name="AcctNumberType_EnumType">
		<xs:annotation>
			<xs:documentation xml:lang="en">Account Number Type</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="OECD601">
				<xs:annotation>
					<xs:documentation>IBAN</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="OECD602">
				<xs:annotation>
					<xs:documentation>OBAN</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="OECD603">
				<xs:annotation>
					<xs:documentation>ISIN</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="OECD604">
				<xs:annotation>
					<xs:documentation>OSIN</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="OECD605">
				<xs:annotation>
					<xs:documentation>Other</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
    </xs:schema>