<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

    <xsd:element name="adi" type="adiType"></xsd:element>

    <xsd:complexType name="adiType">
            <xsd:sequence>
            <xsd:element name="TipoIdInformante" type="tipoIdInformanteType">
                <xsd:annotation>
                    <xsd:documentation>Tipo Id del Informante</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="IdInformante" type="cedRucPasTriType">
                <xsd:annotation>
                    <xsd:documentation>RUC del Informante</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="Anio" type="anioType">
                <xsd:annotation>
                    <xsd:documentation>Anio - periodo informado</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="Mes" type="mesType"/>
            <xsd:element name="razonSocial" type="razonSocialType"/>
            <xsd:element name="tipoInformante" type="tipoInformanteType"/>            
            <xsd:element name="codigoOperativo" type="codigoOperativoType"></xsd:element>          
            
            
            <xsd:element maxOccurs="1" minOccurs="0" name="informacionUtilidad" type="informacionUtilidadType">
                <xsd:annotation>
                    <xsd:documentation>INFORMACION DE UTILIDADES</xsd:documentation>
                </xsd:annotation>
            </xsd:element>

            <xsd:element name="detDividendosDistribuidos" type="detDividendoBeneficioUtilidadType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>DETALLE MODULO 1 DIVIDENDOS DISTRIBUIDOS</xsd:documentation>
                </xsd:annotation>
            </xsd:element>

            <xsd:element name="detDivPrestAccionistas" type="detPrestamosAccionistasType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>DETALLE MODULO 2 DIVIDENDOS PRESTAMOS ACCIONISTAS</xsd:documentation>
                </xsd:annotation>
            </xsd:element>

            <xsd:element name="detDividendosAnticipados" type="detDividendosAnticipadosType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>DETALLE MODULO 3 DIVIDENDOS ANTICIPADOS</xsd:documentation>
                </xsd:annotation>
            </xsd:element>

            <xsd:element name="detDividendosExterior" type="detDividendosProvenientesExteriorType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>DETALLE MODULO 4 BENEFICIARIOS DE DIVIDENDOS PERCIBIDOS DEL EXTERIOR</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>    

    <xsd:complexType name="informacionUtilidadType">
        <xsd:sequence>
            <xsd:element name="utilidadEjercicioInformado" type="baseDecimalType" minOccurs="0"/>
            <xsd:element name="utilidadDistribuidaDistintaReinv" type="baseDecimalType"/>
            <xsd:element name="utilidadReinvertidaConDerechoReduccion" type="baseDecimalType"/>
            <xsd:element name="utilidadReinvertidaSinDerechoReduccion" type="baseDecimalType"/>
            <xsd:element name="utilidadPagadaAnticipado" type="baseDecimalType"/>
            <xsd:element name="utilidadNoDistribuidaEjerInfor" type="baseDecimalType"/>
            <xsd:element name="utilidadNoDistribEjerAntPeriodoInfor" type="baseDecimalType" minOccurs="0"/>
            <xsd:element name="utilidadDistribEjerciciosAnteriores" type="baseDecimalType"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="tipoIdInformanteType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="R"></xsd:enumeration>
            <xsd:enumeration value="C"></xsd:enumeration>
            <xsd:enumeration value="E"></xsd:enumeration>
            <xsd:enumeration value="P"></xsd:enumeration>
            <xsd:length value="1"></xsd:length>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="numeroRucType">
        <xsd:annotation>
            <xsd:documentation/>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:length value="13"/>
            <xsd:pattern value="[0-9]{10}001"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:simpleType name="razonSocialType">
        <xsd:restriction base="xsd:string">
          <xsd:minLength value="5"/>
          <xsd:maxLength value="500"/>
          <xsd:pattern value="[A-Z0-9][A-Z0-9\s]+[A-Z0-9\s]|[A-Z0-9]"/>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:simpleType name="anioType">
        <xsd:annotation>
            <xsd:documentation>Se detalla el anio correspondiente a la
        informacion que esta presentando el contribuyente, consta de cuatro
        digitos: Ej: 2011, 2012, 2013, etc.</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="2010"/>
            <xsd:maxInclusive value="9999"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="anioUtilidadesType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1900"/>
            <xsd:maxInclusive value="9999"/>
        </xsd:restriction>
    </xsd:simpleType>


    <xsd:simpleType name="mesType">
        <xsd:annotation>
            <xsd:documentation>Corresponde al periodo informado compuesto de dos
        digitos que van desde el 01 hasta el 12, corresponde al mes
        informado.</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="2"/>
            <xsd:minLength value="2"/>
            <xsd:pattern value="(0[0-9]|1[012])"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="plazoMesType">
        <xsd:annotation>
            <xsd:documentation>Corresponde a la cantidad de mese que se dara el plazo</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="999"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="codigoOperativoType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="ADI"/>
            <xsd:length value="3"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tipoInformanteType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="2"/>
            <xsd:maxLength value="2"/>
            <xsd:pattern value="[0-9]{2,2}"/>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:simpleType name="secuencialType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="0"/>
            <xsd:maxLength value="9"/>
            <xsd:pattern value="[0-9]{0,9}"/>
        </xsd:restriction>
    </xsd:simpleType>
    

    <xsd:simpleType name="tipoIdentificacionType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="R"/>
            <xsd:enumeration value="C"/>
            <xsd:enumeration value="P"/>
            <xsd:enumeration value="E"/>
            <xsd:minLength value="1"/>
            <xsd:maxLength value="1"/>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:simpleType name="tipoIdBeneficiarioEfectivoType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="R"/>
            <xsd:enumeration value="C"/>
            <xsd:enumeration value="P"/>            
            <xsd:minLength value="1"/>
            <xsd:maxLength value="1"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="cedRucPasTriType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="3"/>
            <xsd:maxLength value="13"/>
            <xsd:pattern value="[0-9a-zA-Z]{3,13}"/>
        </xsd:restriction>
    </xsd:simpleType>    

    <xsd:simpleType name="tipoPersonaIdTributariaExteriorType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="2"/>
            <xsd:maxLength value="2"/>
            <xsd:pattern value="[0-9]{2,2}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="porcentajeParticipacionType">
        <xsd:restriction base="xsd:decimal">
            <xsd:minInclusive value="0.00"/>
            <xsd:maxInclusive value="100"/>
            <xsd:pattern value="[0-9]{1,3}\.[0-9]{6}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="porcentajeRetencionType">
        <xsd:restriction base="xsd:decimal">
            <xsd:minInclusive value="0.00"/>
            <xsd:maxInclusive value="100"/>
            <xsd:pattern value="[0-9]{1,3}\.[0-9]{2}"/>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:simpleType name="porcentajeRetencionAccionistaType">
        <xsd:restriction base="xsd:decimal">
            <xsd:minInclusive value="0.0000"/>
            <xsd:maxInclusive value="100"/>
            <xsd:pattern value="[0-9]{1,3}\.[0-9]{4}"/>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:complexType name="detDividendoBeneficioUtilidadType">
        <xsd:sequence>
            <xsd:element name="dividendosDistribuidos" type="dividendosDistribuidosType" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>MODULO 1 DIVIDENDOS DISTRIBUIDOS</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="dividendosDistribuidosType">
        <xsd:sequence>
            <xsd:element name="secuencialDD" type="secuencialType"/>
            <xsd:element name="tipoIdPerceptor" type="tipoIdentificacionType"/>
            <xsd:element name="numeroIdPerceptor" type="cedRucPasTriType"/>
            <xsd:element name="tipoBeneficiarioDD" type="tipoBeneficiarioType"/>
            <xsd:element name="paisResidenciaDD" type="paisResidenciaType"/>
            <xsd:element minOccurs="0" name="regimenFiscalPreferenteDD" type="siNoType" />
            <xsd:element minOccurs="0" name="tipoIdBeneficiarioEfectivo" type="tipoIdBeneficiarioEfectivoType"/>
            <xsd:element minOccurs="0" name="numeroIdBeneficiarioEfectivo" type="cedRucPasTriType"/>

            <xsd:element minOccurs="0" name="detDivDist" type="detDividendosDistribuidosType">
                <xsd:annotation>
                    <xsd:documentation>DETALLE DE LA DISTRIBUCION/PAGO DEL DIVIDENDO (C.2)</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="detDividendosDistribuidosType">
        <xsd:sequence>
            <xsd:element minOccurs="0" maxOccurs="unbounded" name="datosDivDist" type="datosDividendosDistribuidosType">
                <xsd:annotation>
                    <xsd:documentation>DETALLE DE LA DISTRIBUCION/PAGO DEL DIVIDENDO (C.2)</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="datosDividendosDistribuidosType">
        <xsd:sequence>
            <xsd:element name="anioGeneraUtilidadAtribuibles" type="anioUtilidadesType"/>
            <xsd:element name="tipoDividendoDistribuido" type="tipoDividendoType"/>
            <xsd:element minOccurs="0" name="fechaRegistroContable" type="fechaType"/>                       
            <xsd:element name="montoDividendoDistribuido" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="tarifaUtilidadesDividendo" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="dividendoDistribuidoSociedad" type="siNoType"/>
            <xsd:element minOccurs="0" name="tipoIdPrimeraSociedad" type="tipoIdentificacionType"/>
            <xsd:element minOccurs="0" name="numeroIdPrimeraSociedad" type="cedRucPasTriType"/>
            <xsd:element minOccurs="0" name="impuestoPagadoPrimeraSociedad" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="impuestoPagadoSociedadAtribuible" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="ingresoGravadoDividendos" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="PorcentajeRetencion" type="porcentajeRetencionType"/>
            <xsd:element minOccurs="0" name="valorInformadoAccionista" type="baseDecimalType"/>
            <xsd:element name="MontoRetencion" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="pagado" type="siNoType"/> 
            <xsd:element minOccurs="0" name="detFormaPago" type="detFormaPagoType">
                <xsd:annotation>
                    <xsd:documentation>DETALLE DE LA FORMA DE PAGO/PAGO DEL DIVIDENDO (C.2)</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="midPagaDividendo" type="baseDecimalType"/>               
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="detFormaPagoType">
        <xsd:sequence>
            <xsd:element maxOccurs="unbounded" name="datosFormaPago" type="datosFormaPagoType">
                <xsd:annotation>
                    <xsd:documentation>DETALLE DE LA FORMA DE PAGO/PAGO DEL DIVIDENDO (C.2)</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="datosFormaPagoType">
        <xsd:sequence>            
            <xsd:element minOccurs="0" name="formaPago" type="formaPagoType"/>
            <xsd:element minOccurs="0" name="fechaPago" type="fechaType"/>             
            <xsd:element minOccurs="0" name="valorDividendoPagado" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="valorDividendoTransferExterior" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="isdPagado" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="fechaTransferencia" type="fechaType"/>
            <xsd:element minOccurs="0" name="numeroCuentaAcreditada" type="numeroCuentaType"/>            
            <xsd:element minOccurs="0" name="bancoExterior" type="bancoType"/>
            <xsd:element minOccurs="0" name="codigoAba" type="codigoAbaType"/>
            <xsd:element minOccurs="0" name="codigoBic" type="codigoBicType"/>         
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="tipoBeneficiarioType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="2"/>
            <xsd:maxLength value="2"/>
            <xsd:pattern value="[0-9]{2,2}"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tipoDividendoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="2"/>
            <xsd:maxLength value="2"/>
            <xsd:pattern value="[0-9]{2,2}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="paisResidenciaType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="3"/>
            <xsd:maxLength value="3"/>
            <xsd:pattern value="[0-9]{3,3}"/>
        </xsd:restriction>
    </xsd:simpleType>

  <xsd:simpleType name="siNoType">
    <xsd:restriction base="xsd:string">
            <xsd:enumeration value="01"></xsd:enumeration>
            <xsd:enumeration value="02"></xsd:enumeration>
    </xsd:restriction>
  </xsd:simpleType> 
    
    <xsd:simpleType name="formaPagoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="2"/>            
            <xsd:pattern value="[0-9][0-9](,[0-9][0-9])*"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="fechaType">
        <xsd:annotation>
            <xsd:documentation>
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="(0[1-9]|[12][0-9]|3[01])[/](0[1-9]|1[012])[/](19|20)\d\d"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="numeroCuentaType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="3"/>
            <xsd:maxLength value="20"/>
            <xsd:pattern value="[A-Za-z0-9]{3,20}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="bancoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="5"/>
            <xsd:maxLength value="500"/>
            <xsd:pattern value="[A-Z a-z 0-9]{5,500}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="codigoAbaType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="11"/>
            <xsd:maxLength value="60"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="codigoBicType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="21"/>
            <xsd:maxLength value="60"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="detPrestamosAccionistasType">
        <xsd:sequence>
            <xsd:element name="prestAccionistas" type="dividendosPrestamosAccionistasType" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>MODULO 2 DIVIDENDOS PRESTAMOS ACCIONISTAS</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="dividendosPrestamosAccionistasType">
        <xsd:sequence>
            <xsd:element name="secuencialDP" type="secuencialType"/>
            <xsd:element name="tipoIdentificacionDP" type="tipoIdentificacionType"/>
            <xsd:element name="numeroIdentificacionDP" type="cedRucPasTriType"/>
            <xsd:element name="tipoBeneficiarioDP" type="tipoBeneficiarioType"/>
            <xsd:element name="paisResidenciaDP" type="paisResidenciaType"/>
            <xsd:element minOccurs="0" name="regimenFiscalPreferenteDP" type="siNoType"/>
            <xsd:element minOccurs="0" name="tipoIdentificacionBeneficiarioEfectivoDP" type="tipoIdBeneficiarioEfectivoType"/>
            <xsd:element minOccurs="0" name="numeroIdentificacionBeneficiarioEfectivoDP" type="cedRucPasTriType"/>

            <xsd:element minOccurs="0" name="detPrestAccionistas" type="detDividendosPrestamosAccionistasType">
                <xsd:annotation>
                    <xsd:documentation>INFORMACION DE PRESTAMOS</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="detDividendosPrestamosAccionistasType">
        <xsd:sequence>
            <xsd:element minOccurs="0" maxOccurs="unbounded" name="datosPrestAccionista" type="datosPrestamosAccionistasType">
                <xsd:annotation>
                    <xsd:documentation>INFORMACION DE PRESTAMOS (D.2)</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="datosPrestamosAccionistasType">
        <xsd:sequence>
            <xsd:element name="fechaPrestamo" type="fechaType"/>
            <xsd:element name="montoPrestamo" type="baseDecimalType"/>
            <xsd:element name="tasasInteres" type="tasaInteresType"/>
            <xsd:element name="plazoMeses" type="plazoMesType"/>
            <xsd:element name="tarifaRetencionDividendosAnticipadosDP" type="tarifaRetencionType"/>
            <xsd:element name="valorRetencionCtDP" type="baseDecimalType"/>
            <xsd:element name="baseImponibleRetencionAccionistaDP" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="porcentajeRetencionAccionista" type="porcentajeRetencionAccionistaType"/>
            <xsd:element name="valorRetencionAccionistaDP" type="baseDecimalType"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="tasaInteresType">
        <xsd:restriction base="xsd:decimal">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="100"/>
            <xsd:pattern value="[0-9]{1,2}\.[0-9]{4}"/>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:simpleType name="baseDecimalType">
        <xsd:restriction base="xsd:decimal">            
            <xsd:pattern value="[0-9]{1,10}\.[0-9]{2}"/>
        </xsd:restriction>
    </xsd:simpleType>    
    <xsd:simpleType name="tarifaRetencionType">
        <xsd:restriction base="xsd:decimal">
            <xsd:pattern value="[0-9]{0,2}\.[0-9]{2}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="detDividendosAnticipadosType">
        <xsd:sequence>
            <xsd:element name="dividendosAnticipados" type="dividendosAnticipadosType" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>MODULO 3 DIVIDENDOS ANTICIPADOS</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="dividendosAnticipadosType">
        <xsd:sequence>
            <xsd:element name="secuencialDA" type="secuencialType"/>
            <xsd:element name="tipoIdentificacionDA" type="tipoIdentificacionType"/>
            <xsd:element name="numeroIdentificacionDA" type="cedRucPasTriType"/>
            <xsd:element name="tipoBeneficiarioDA" type="tipoBeneficiarioType"/>
            <xsd:element name="paisResidenciaDA" type="paisResidenciaType"/>
            <xsd:element minOccurs="0" name="regimenFiscalPreferenteDA" type="siNoType"/>
            <xsd:element minOccurs="0" name="tipoIdentificacionBeneficiarioEfectivoDA" type="tipoIdBeneficiarioEfectivoType" />
            <xsd:element minOccurs="0" name="numeroIdentificacionBeneficiarioEfectivoDA" type="cedRucPasTriType"/>            
            <xsd:element minOccurs="0" name="detDivAnti" type="detInformacionDividendosAnticipadosType">
                <xsd:annotation>
                    <xsd:documentation>INFORMACION DEL DIVIDENDO ANTICIPADO (E.2)</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="detInformacionDividendosAnticipadosType">
        <xsd:sequence>
            <xsd:element minOccurs="0" maxOccurs="unbounded" name="datosDivAnti" type="datosDividendosAnticipadosType">
                <xsd:annotation>
                    <xsd:documentation>INFORMACION DEL DIVIDENDO ANTICIPADO</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="datosDividendosAnticipadosType">
        <xsd:sequence>
            <xsd:element name="fechaReparticionDividendoAnticipado" type="fechaType"/>
            <xsd:element name="montoDividendoAnticipado" type="baseDecimalType"/>
            <xsd:element name="tarifaRetencionDividendosAnticipadosDA" type="tarifaRetencionType"/>
            <xsd:element name="valorRetencionCtDA" type="baseDecimalType"/>
            <xsd:element name="baseImponibleRetencionAccionistaDA" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="porcentajeRetencionAccionistaDA" type="porcentajeRetencionAccionistaType"/>
            <xsd:element name="valorRetencionAccionistaDA" type="baseDecimalType"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="detDividendosProvenientesExteriorType">
        <xsd:sequence>
            <xsd:element name="beneficiariosDivExterior" type="beneficiariosDividPercibidosExteriorType" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation>MODULO 4 BENEFICIARIOS DE DIVIDENDOS PERCIBIDOS DEL EXTERIOR</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="beneficiariosDividPercibidosExteriorType">
        <xsd:sequence>
            <xsd:element name="tipoIdentificacionPE" type="tipoIdentificacionType"/>
            <xsd:element name="numeroIdentificacionPE" type="cedRucPasTriType"/>
            <xsd:element name="razonSocialPE" type="razonSocialType"/>
            <xsd:element name="paisResidenciaPE" type="paisResidenciaType"/>
            <xsd:element name="regimenFiscalPreferentePE" type="siNoType"/>
            <xsd:element name="utilidadGravadaPaisResidencia" type="baseDecimalType"/>
            <xsd:element name="impuestoPagadoPaisResidencia" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="tarifaImpuestoRentaPaisResidencia" type="tarifaImpuestoRentaPaisResidenciaType" />

            <xsd:element minOccurs="0" name="detDivExterior" type="detBeneficiariosDividPercibidosExteriorType">
                <xsd:annotation>
                    <xsd:documentation>DETALLE DEL DIVIDENDO PERCIBIDO (F.2)</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="tarifaImpuestoRentaPaisResidenciaType">
        <xsd:restriction base="xsd:decimal">
            <xsd:pattern value="[0-9]{1,3}\.[0-9]{2}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="detBeneficiariosDividPercibidosExteriorType">
        <xsd:sequence>
            <xsd:element minOccurs="0" maxOccurs="unbounded" name="datosDivExterior" type="datosPercibidosExteriorType">
                <xsd:annotation>
                    <xsd:documentation>DETALLE DEL DIVIDENDO PERCIBIDO</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="datosPercibidosExteriorType">
        <xsd:sequence>
            <xsd:element name="valorDividendoDistribuido" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="tieneRelacionSociedadEcuatoriana" type="siNoType"/>
            <xsd:element minOccurs="0" name="numeroIdSociedadEcuatorianaRelacionada" type="rucType"/>                        
            <xsd:element minOccurs="0" name="porcentajeParticipacionSociedadExterior" type="porcentajeParticipacionType" />
            <xsd:element minOccurs="0" name="porcentajeParticipacionPersonaNaturalExterior" type="porcentajeParticipacionType"/>            
            <xsd:element name="tarifaRetencionAplicadaDividendo" type="tarifaImpuestoRentaPaisResidenciaType"/>
            <xsd:element name="montoImpuestoRetenidoExterior" type="baseDecimalType"/>
            <xsd:element minOccurs="0" name="declaradoIngresoExentoImpuestoRenta" type="siNoType"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="rucType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="13"/>
            <xsd:maxLength value="13"/>
            <xsd:pattern value="[0-9]{13}"/>
        </xsd:restriction>
    </xsd:simpleType>

</xsd:schema>