<?xml version="1.0"?>
<xs:schema
   targetNamespace=
        "urn:ietf:params:xml:ns:EmergencyCallData:ProviderInfo"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:pi="urn:ietf:params:xml:ns:EmergencyCallData:ProviderInfo"
   xmlns:xml="http://www.w3.org/XML/1998/namespace"
   xmlns:xc="urn:ietf:params:xml:ns:vcard-4.0"
   elementFormDefault="qualified"
   attributeFormDefault="unqualified">

   <xs:import namespace="http://www.w3.org/XML/1998/namespace"
        schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>

    <xs:import namespace="urn:ietf:params:xml:ns:vcard-4.0"
        schemaLocation="vcard.xsd"/>

    <xs:element
        name="EmergencyCallData.ProviderInfo"
        type="pi:ProviderInfoType"/>

    <xs:simpleType name="SubcontractorPriorityType">
       <xs:restriction base="xs:string">
            <xs:enumeration value="sub"/>
            <xs:enumeration value="main"/>
       </xs:restriction>
    </xs:simpleType>

        <xs:complexType name="ProviderInfoType">
            <xs:sequence>
                <xs:element name="DataProviderReference"
                    type="xs:token" minOccurs="1" maxOccurs="1"/>

                <xs:element name="DataProviderString"
                    type="xs:string" minOccurs="1" maxOccurs="1"/>

                <xs:element name="ProviderID"
                    type="xs:string" minOccurs="0" maxOccurs="1"/>

                <xs:element name="ProviderIDSeries"
                    type="xs:string" minOccurs="0" maxOccurs="1"/>

                <xs:element name="TypeOfProvider"
                    type="xs:string" minOccurs="1" maxOccurs="1"/>

                <xs:element name="ContactURI" type="xs:anyURI"
                    minOccurs="1" maxOccurs="1"/>


<xs:element name="Language" minOccurs="1" maxOccurs="unbounded">
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern
value="([a-z]{2,3}((-[a-z]{3}){0,3})?|[a-z]{4,8})
(-[a-z]{4})?(-([a-z]{2}|\d{3}))?(-([0-9a-z]{5,8}|
\d[0-9a-z]{3}))*(-[0-9a-wyz](-[0-9a-z]{2,8})+)*
(-x(-[0-9a-z]{1,8})+)?|x(-[0-9a-z]{1,8})+|[a-z]{1,3}
(-[0-9a-z]{2,8}){1,2}"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>


                <xs:element name="DataProviderContact"
                    minOccurs="0" maxOccurs="1">
                  <xs:complexType>
                     <xs:sequence>
                       <xs:element minOccurs="0"
                           maxOccurs="unbounded" ref="xc:vcard"/>
                     </xs:sequence>
                  </xs:complexType>
                </xs:element>

                <xs:element name="SubcontractorPrincipal"
                    type="xs:string" minOccurs="0" maxOccurs="1"/>

                <xs:element name="SubcontractorPriority"
                    type="pi:SubcontractorPriorityType"
                    minOccurs="0" maxOccurs="1"/>

                <xs:any namespace="##other" processContents="lax"
                    minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>

</xs:schema>