<?xml version="1.0" encoding="UTF-8" ?>

<!--
XML Schema Rec
Generated by X-Meta 
Tue Oct 28 16:55:51 GMT 2003
  -->
<xsd:schema version='2.0.1' elementFormDefault='qualified' attributeFormDefault='unqualified' id='core' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
  <xsd:annotation>
    <xsd:documentation>Inland Revenue core XML datatypes for incoming forms</xsd:documentation>
    <xsd:appinfo>
      <gt:KeyWords xmlns:gt='http://www.govtalk.gov.uk/CM/core'>taxation, FBI, File By Internet, Inland Revenue, core, types</gt:KeyWords>
      <gms:Metadata xmlns:gms='http://www.govtalk.gov.uk/CM/gms-xs'>
        <gms:Audience>schema designers</gms:Audience>
        <gms:Contributor>alphaXML Ltd</gms:Contributor>
        <gms:Contributor>DecisionSoft Ltd</gms:Contributor>
        <gms:Creator>Inland Revenue</gms:Creator>
        <gms:Date>
          <gms:Created>2001-06-11</gms:Created>
        </gms:Date>
        <gms:Date>
          <gms:Modified>2003-03-10</gms:Modified>
        </gms:Date>
        <gms:Format>
          <gms:MediaType>text/xml</gms:MediaType>
          <gms:Syntax>http://www.w3.org/2001/XMLSchema</gms:Syntax>
          <gms:Description>XML Schema, W3C Recommendation 2001</gms:Description>
        </gms:Format>
        <gms:Identifier>{no-namespace}IRcore</gms:Identifier>
        <gms:Language>[ISO 639-2/B] ENG</gms:Language>
        <gms:Publisher>Inland Revenue</gms:Publisher>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRheader</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>Contains</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>ContactDetailsStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>EmailStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>EmailType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>GenderType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRdecimalType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRmonetaryStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRnonNegativeMonetaryType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRnonNegativeMonetaryStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRwholeUnitsMonetaryType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRwholeUnitsMonetaryStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRnonNegativeWholeUnitsMonetaryType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRnonNegativeWholeUnitsMonetaryStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRnonNegativeDecimalType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRofficeNamedStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRofficeReferenceType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRofficeStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>ISOcurrencyType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>InternationalAddressStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>NameStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRheaderStringType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>TelephoneNumberType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>TelephoneStructure</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>WorkHomeType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>WorksNumberType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>YesNoType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>PAYEaddressLineType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>CTaddressLineType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>SAaddressLineType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>NTCaddressLineType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>PAYEnameType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>CTnameType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>SAnameType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>NTCnameType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>PAYEstringType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>CTstringType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>SAstringType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>NTCstringType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>UTRtype</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRtaxDistrictType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>SortCodeType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>AccountNumberType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>AccountNameType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>BuildingSocietyReferenceType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>NINOtype</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>IRNINOtype</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Relation>
          <gms:ProvidesDefinitionOf>PostCodeType</gms:ProvidesDefinitionOf>
        </gms:Relation>
        <gms:Rights>
          <gms:Copyright>(C) Crown Copyright 2001-2003</gms:Copyright>
        </gms:Rights>
        <gms:Subject>
          <gms:Category>Economics and Finance - Tax</gms:Category>
        </gms:Subject>
        <gms:Subject>
          <gms:Project>On-line Tax Return filing</gms:Project>
        </gms:Subject>
        <gms:Title>IR Core data types Schema</gms:Title>
        <gms:Type>architectural</gms:Type>
      </gms:Metadata>
    </xsd:appinfo>
  </xsd:annotation>
  <xsd:element name='IRheader'>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name='TestMessage' minOccurs='0' maxOccurs='1'>
          <xsd:simpleType>
            <xsd:restriction base='xsd:int'>
              <xsd:maxInclusive value='9' />
              <xsd:minInclusive value='0' />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
        <xsd:element name='Keys' minOccurs='0' maxOccurs='1'>
          <xsd:annotation>
            <xsd:documentation>This element contains identifiers for the sender of the message. Each identifier is contained within a &lt;Key&gt; element. Each &lt;Key&gt; element also contains a 'Type' attribute which describes the identifier type (e.g. &lt;Key Type='UTR'&gt;, &lt;Key Type='Tax Office Number'&gt;, &lt;Key Type='Tax Office Reference'&gt;).</xsd:documentation>
          </xsd:annotation>
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name='Key' minOccurs='1' maxOccurs='unbounded'>
                <xsd:complexType>
                  <xsd:simpleContent>
                    <xsd:extension base='IRheaderStringType'>
                      <xsd:attribute name='Type' type='IRheaderStringType' use='optional' />
                    </xsd:extension>
                  </xsd:simpleContent>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name='PeriodEnd' type='xsd:date' minOccurs='1' maxOccurs='1' />
        <xsd:element name='Principal' minOccurs='0' maxOccurs='1'>
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name='Contact' type='ContactDetailsStructure' minOccurs='1' maxOccurs='1' />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name='Agent' minOccurs='0' maxOccurs='1'>
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name='AgentID' minOccurs='0' maxOccurs='1'>
                <xsd:annotation>
                  <xsd:documentation>This identifier is for the agent's own reference and is not the same as any agent's credentials that might be used to identify the agent to the Government Gateway.</xsd:documentation>
                </xsd:annotation>
                <xsd:simpleType>
                  <xsd:restriction base='IRheaderStringType'>
                    <xsd:minLength value='1' />
                    <xsd:maxLength value='35' />
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element name='Company' minOccurs='0' maxOccurs='1'>
                <xsd:simpleType>
                  <xsd:restriction base='IRheaderStringType'>
                    <xsd:minLength value='1' />
                    <xsd:maxLength value='35' />
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element name='Address' type='InternationalAddressStructure' minOccurs='0' maxOccurs='1' />
              <xsd:element name='Contact' type='ContactDetailsStructure' minOccurs='0' maxOccurs='1' />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name='DefaultCurrency' minOccurs='0' maxOccurs='1'>
          <xsd:simpleType>
            <xsd:restriction base='ISOcurrencyType'>
              <xsd:enumeration value='GBP' />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
        <xsd:element name='Manifest' minOccurs='0' maxOccurs='1'>
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element minOccurs='1' maxOccurs='1' ref='Contains' />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name='IRmark' minOccurs='0' maxOccurs='1'>
          <xsd:complexType>
            <xsd:simpleContent>
              <xsd:extension base='xsd:string'>
                <xsd:attribute name='Type' use='required'>
                  <xsd:simpleType>
                    <xsd:restriction base='IRheaderStringType'>
                      <xsd:enumeration value='SAonly' />
                      <xsd:enumeration value='generic' />
                    </xsd:restriction>
                  </xsd:simpleType>
                </xsd:attribute>
              </xsd:extension>
            </xsd:simpleContent>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name='Sender' minOccurs='1' maxOccurs='1'>
          <xsd:simpleType>
            <xsd:restriction base='xsd:string'>
              <xsd:enumeration value='Individual' />
              <xsd:enumeration value='Company' />
              <xsd:enumeration value='Agent' />
              <xsd:enumeration value='Bureau' />
              <xsd:enumeration value='Partnership' />
              <xsd:enumeration value='Trust' />
              <xsd:enumeration value='Employer' />
              <xsd:enumeration value='Government' />
              <xsd:enumeration value='Acting in Capacity' />
              <xsd:enumeration value='Other' />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name='Contains'>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name='Reference' minOccurs='1' maxOccurs='unbounded'>
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name='Namespace' type='xsd:anyURI' minOccurs='1' maxOccurs='1' />
              <xsd:element name='SchemaVersion' minOccurs='1' maxOccurs='1'>
                <xsd:simpleType>
                  <xsd:restriction base='IRheaderStringType'>
                    <xsd:maxLength value='13' />
                    <xsd:pattern value='[0-9]{4}\-v[0-9]{1,3}\.[0-9]{1,3}(\.[0-9]{1,3})?' />
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element name='TopElementName' type='xsd:NCName' minOccurs='1' maxOccurs='1' />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name='ContactDetailsStructure'>
    <xsd:sequence>
      <xsd:element name='Name' type='NameStructure' minOccurs='0' maxOccurs='1' />
      <xsd:element name='Email' type='EmailStructure' minOccurs='0' maxOccurs='unbounded' />
      <xsd:element name='Telephone' type='TelephoneStructure' minOccurs='0' maxOccurs='unbounded' />
      <xsd:element name='Fax' type='TelephoneStructure' minOccurs='0' maxOccurs='unbounded' />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name='EmailStructure'>
    <xsd:simpleContent>
      <xsd:extension base='EmailType'>
        <xsd:attribute name='Type' type='WorkHomeType' use='optional' />
        <xsd:attribute name='Preferred' type='YesNoType' use='optional' />
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
  <xsd:simpleType name='EmailType'>
    <xsd:restriction base='xsd:string'>
      <xsd:minLength value='3' />
      <xsd:maxLength value='254' />
      <xsd:pattern value='[^@&apos;&lt;&gt;&quot;]+@[^@&apos;&lt;&gt;&quot;]+' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='GenderType'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='female' />
      <xsd:enumeration value='male' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='IRdecimalType'>
    <xsd:restriction base='xsd:decimal'>
      <xsd:pattern value='-?(([1-9][0-9]*)|0)\.[0-9]{2}' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name='IRmonetaryStructure'>
    <xsd:simpleContent>
      <xsd:extension base='IRdecimalType'>
        <xsd:attribute name='Currency' type='ISOcurrencyType' use='optional' />
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
  <xsd:simpleType name='IRnonNegativeMonetaryType'>
    <xsd:restriction base='IRdecimalType'>
      <xsd:minInclusive value='0.00' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name='IRnonNegativeMonetaryStructure'>
    <xsd:simpleContent>
      <xsd:extension base='IRnonNegativeMonetaryType'>
        <xsd:attribute name='Currency' type='ISOcurrencyType' use='optional' />
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
  <xsd:simpleType name='IRwholeUnitsMonetaryType'>
    <xsd:restriction base='IRdecimalType'>
      <xsd:pattern value='.*\.00' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name='IRwholeUnitsMonetaryStructure'>
    <xsd:simpleContent>
      <xsd:extension base='IRwholeUnitsMonetaryType'>
        <xsd:attribute name='Currency' type='ISOcurrencyType' use='optional' />
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
  <xsd:simpleType name='IRnonNegativeWholeUnitsMonetaryType'>
    <xsd:restriction base='IRnonNegativeDecimalType'>
      <xsd:pattern value='.*\.00' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name='IRnonNegativeWholeUnitsMonetaryStructure'>
    <xsd:simpleContent>
      <xsd:extension base='IRnonNegativeWholeUnitsMonetaryType'>
        <xsd:attribute name='Currency' type='ISOcurrencyType' use='optional' />
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
  <xsd:simpleType name='IRnonNegativeDecimalType'>
    <xsd:restriction base='IRdecimalType'>
      <xsd:minInclusive value='0.00' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name='IRofficeNamedStructure'>
    <xsd:complexContent>
      <xsd:extension base='IRofficeStructure'>
        <xsd:sequence>
          <xsd:element name='Name' minOccurs='0' maxOccurs='1'>
            <xsd:simpleType>
              <xsd:restriction base='xsd:string'>
                <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:simpleType name='IRofficeReferenceType'>
    <xsd:restriction base='xsd:string'>
      <xsd:minLength value='1' />
      <xsd:maxLength value='10' />
      <xsd:pattern value='[A-Za-z0-9][A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name='IRofficeStructure'>
    <xsd:sequence>
      <xsd:element name='Number' type='IRtaxDistrictType' minOccurs='1' maxOccurs='1' />
      <xsd:element name='Reference' type='IRofficeReferenceType' minOccurs='1' maxOccurs='1' />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:simpleType name='ISOcurrencyType'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='EUR' />
      <xsd:enumeration value='GBP' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name='InternationalAddressStructure'>
    <xsd:sequence>
      <xsd:element name='Line' minOccurs='1' maxOccurs='4'>
        <xsd:simpleType>
          <xsd:restriction base='xsd:string'>
            <xsd:minLength value='1' />
            <xsd:maxLength value='35' />
            <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name='PostCode' minOccurs='0' maxOccurs='1'>
        <xsd:simpleType>
          <xsd:restriction base='xsd:string'>
            <xsd:minLength value='1' />
            <xsd:maxLength value='8' />
            <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name='Country' minOccurs='0' maxOccurs='1'>
        <xsd:simpleType>
          <xsd:restriction base='xsd:string'>
            <xsd:minLength value='1' />
            <xsd:maxLength value='35' />
            <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name='NameStructure'>
    <xsd:sequence>
      <xsd:element name='Ttl' minOccurs='0' maxOccurs='1'>
        <xsd:simpleType>
          <xsd:restriction base='xsd:string'>
            <xsd:minLength value='1' />
            <xsd:maxLength value='4' />
            <xsd:pattern value='[A-Za-z][A-Za-z&apos;\-]*' />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name='Fore' minOccurs='1' maxOccurs='2'>
        <xsd:simpleType>
          <xsd:restriction base='xsd:string'>
            <xsd:minLength value='1' />
            <xsd:maxLength value='35' />
            <xsd:pattern value='[A-Za-z][A-Za-z&apos;\-]*' />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name='Sur' minOccurs='1' maxOccurs='1'>
        <xsd:simpleType>
          <xsd:restriction base='xsd:string'>
            <xsd:minLength value='1' />
            <xsd:maxLength value='35' />
            <xsd:pattern value='[A-Za-z0-9 ,\.\(\)/&amp;\-&apos;]+' />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:simpleType name='IRheaderStringType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 &amp;&apos;\(\)\*,\-\./]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='TelephoneNumberType'>
    <xsd:restriction base='xsd:string'>
      <xsd:minLength value='1' />
      <xsd:maxLength value='35' />
      <xsd:pattern value='[0-9\(\)\-\s]{1,35}' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name='TelephoneStructure'>
    <xsd:sequence>
      <xsd:element name='Number' type='TelephoneNumberType' minOccurs='1' maxOccurs='1' />
      <xsd:element name='Extension' minOccurs='0' maxOccurs='1'>
        <xsd:simpleType>
          <xsd:restriction base='xsd:string'>
            <xsd:minLength value='1' />
            <xsd:maxLength value='6' />
            <xsd:pattern value='[0-9]{1,6}' />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name='Type' type='WorkHomeType' use='optional' />
    <xsd:attribute name='Mobile' type='YesNoType' use='optional' />
    <xsd:attribute name='Preferred' type='YesNoType' use='optional' />
  </xsd:complexType>
  <xsd:simpleType name='WorkHomeType'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='home' />
      <xsd:enumeration value='work' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='WorksNumberType'>
    <xsd:restriction base='xsd:string'>
      <xsd:minLength value='1' />
      <xsd:maxLength value='20' />
      <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='YesNoType'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='no' />
      <xsd:enumeration value='yes' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='PAYEaddressLineType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='CTaddressLineType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ,\.\(\)/&amp;&apos;\-&quot;!%\*_\+:@&lt;&gt;\?=;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='SAaddressLineType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 &amp;&apos;\(\)\*,\-\./]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='NTCaddressLineType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='PAYEnameType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='CTnameType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ,\.\(\)/&amp;&apos;\-&quot;!%\*_\+:@&lt;&gt;\?=;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='SAnameType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 &amp;&apos;\(\)\*,\-\./]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='NTCnameType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='PAYEstringType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='CTstringType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ,\.\(\)/&amp;&apos;\-&quot;!%\*_\+:@&lt;&gt;\?=;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='SAstringType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 &amp;&apos;\(\)\*,\-\./@&#163;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='NTCstringType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[A-Za-z0-9 ~!&quot;@#$%&amp;&apos;\(\)\*\+,\-\./:;&lt;=&gt;\?\[\\\]^_\{\}&#163;&#8364;]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='UTRtype'>
    <xsd:restriction base='xsd:string'>
      <xsd:length value='10' />
      <xsd:pattern value='[0-9]{10}' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='IRtaxDistrictType'>
    <xsd:restriction base='xsd:string'>
      <xsd:length value='3' />
      <xsd:pattern value='[0-9]{3}' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='SortCodeType'>
    <xsd:restriction base='xsd:string'>
      <xsd:length value='6' />
      <xsd:pattern value='[0-9]{6}' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='AccountNumberType'>
    <xsd:restriction base='xsd:string'>
      <xsd:length value='8' />
      <xsd:pattern value='[0-9]{8}' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='AccountNameType'>
    <xsd:restriction base='xsd:string'>
      <xsd:maxLength value='28' />
      <xsd:pattern value='[A-Za-z0-9 &amp;&apos;\(\)\*,\-\./]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='BuildingSocietyReferenceType'>
    <xsd:restriction base='xsd:string'>
      <xsd:maxLength value='18' />
      <xsd:pattern value='[A-Za-z0-9 &amp;&apos;\(\)\*,\-\.]*' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='NINOtype'>
    <xsd:restriction base='xsd:string'>
      <xsd:length value='9' />
      <xsd:pattern value='[ABCEGHJKLMNOPRSTWXYZ][ABCEGHJKLMNPRSTWXYZ][0-9]{6}[A-D ]' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='IRNINOtype'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='[ABCEGHJKLMNOPRSTWXYZ][ABCEGHJKLMNPRSTWXYZ][0-9]{6}[A-D ]' />
      <xsd:pattern value='[0-9]{2}[A-Z][0-9]{5}' />
      <xsd:pattern value='TN[0-9]{6}[MF]' />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name='PostCodeType'>
    <xsd:restriction base='xsd:string'>
      <xsd:pattern value='(GIR 0AA)|((([A-Z][0-9][0-9]?)|(([A-Z][A-HJ-Y][0-9][0-9]?)|(([A-Z][0-9][A-Z])|([A-Z][A-HJ-Y][0-9]?[A-Z])))) [0-9][A-Z]{2})' />
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>
