<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.pap.minhafp.gob.es/ficherosxsd/Resguardo_Constitucion.xsd" xmlns="http://www.pap.minhafp.gob.es/ficherosxsd/Resguardo_Constitucion.xsd" attributeFormDefault="unqualified" elementFormDefault="qualified">
  <xsd:element name="resguardo_constitucion">
    <xsd:complexType>
      <xsd:sequence>
		<xsd:element type="xsd:string" name="version"/>
		<xsd:element type="numero_registro" name="numero_registro"/>
		<xsd:element type="provisional_definitivo" name="provisional_definitivo"/>
		<xsd:element type="modalidad" name="modalidad"/>
		<xsd:element type="nacionalidad" name="nacionalidad_garante"/>
        <xsd:element type="nifCif" name="nifCif_garante"/>
        <xsd:element type="xsd:string" name="nombre_garante"/>
		<xsd:element type="xsd:string" name="domicilio_garante"/>
		<xsd:element type="xsd:string" name="municipio_garante"/>
		<xsd:element type="codigo_postal" name="codigo_postal_garante"/>
		<xsd:element type="nacionalidad" name="nacionalidad_garantizado" minOccurs="0"/>
        <xsd:element type="nifCif" name="nifCif_garantizado" minOccurs="0"/>
        <xsd:element type="xsd:string" name="nombre_garantizado" minOccurs="0"/>
		<xsd:element type="xsd:string" name="domicilio_garantizado" minOccurs="0"/>
		<xsd:element type="xsd:string" name="municipio_garantizado" minOccurs="0"/>
		<xsd:element type="codigo_postal" name="codigo_postal_garantizado" minOccurs="0"/>
		<xsd:element type="xsd:string" name="codigo_norma"/>
		<xsd:element type="xsd:string" name="denominacion_norma"/>
		<xsd:element type="certificado" name="certificado_inmovilizacion" minOccurs="0"/>
		<xsd:element type="fecha" name="fecha_inmovilizacion" minOccurs="0"/>
		<xsd:element type="fecha" name="plazo_vigencia" minOccurs="0"/>
		<xsd:element type="nifCif" name="nifCif_entidad_gestora" minOccurs="0"/>
		<xsd:element type="isin" name="codigo_isin" minOccurs="0"/>
		<xsd:element type="xsd:double" name="valor_nominal" minOccurs="0"/>
		<xsd:element type="participacion" name="num_participaciones" minOccurs="0"/>
		<xsd:element type="xsd:double" name="valor_realizacion" minOccurs="0"/>
		<xsd:element type="xsd:string" name="finalidad"/>
		<xsd:element type="expediente" name="codigo_expediente"/>
		<xsd:element type="nacionalidad" name="nacionalidad_autoridad"/>
        <xsd:element type="nifCif" name="nifCif_autoridad"/>
        <xsd:element type="xsd:string" name="nombre_autoridad"/>
        <xsd:element type="xsd:double" name="importe_cifra"/>
        <xsd:element type="fecha" name="fecha_expedicion"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>	
	
	<xsd:simpleType name="numero_registro">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[0-9]{9}[O]{1}[0-9]{7}"></xsd:pattern>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="modalidad"> 
		<xsd:restriction base="xsd:string">  
			<xsd:enumeration value="1"></xsd:enumeration> 
			<xsd:enumeration value="2"></xsd:enumeration> 
			<xsd:enumeration value="3"></xsd:enumeration> 
			<xsd:enumeration value="4"></xsd:enumeration>
		</xsd:restriction> 
	</xsd:simpleType> 
	
	<xsd:simpleType name="fecha"> 
		<xsd:restriction base="xsd:string"> 
			<xsd:pattern value="(0[1-9]|[12]\d|3[01])/(0[1-9]|1[0-2])/(\d{4})"></xsd:pattern> 
		</xsd:restriction> 
	</xsd:simpleType>
	
	<xsd:simpleType name="nacionalidad">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="2"/>
			<xsd:maxLength value="2"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="nifCif">
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="9"/>
			<xsd:maxLength value="9"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="codigo_postal">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[0-9]{5}"></xsd:pattern>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="provisional_definitivo"> 
		<xsd:restriction base="xsd:string"> 
			<xsd:enumeration value="P"></xsd:enumeration> 
			<xsd:enumeration value="D"></xsd:enumeration> 
		</xsd:restriction> 
	</xsd:simpleType>
	
	<xsd:simpleType name="certificado">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="12"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="isin">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="13"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="participacion">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="6"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="expediente">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="26"/>
		</xsd:restriction>
	</xsd:simpleType>
  
</xsd:schema>