<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:DPIVA="http://esquemas.clouda.sat.gob.mx/archivos/DoctosDigitales/TipoDPIVA/1"
xmlns:DD="http://esquemas.clouda.sat.gob.mx/archivos/DoctosDigitales/1"
>
<xsl:template match="/">
<!--ENCABEZADOS DE LOS TOTALES-->
<xsl:param name="totalOp" select="'Total de operaciones que relaciona'"/>
<xsl:param name="total15o16" select="'Total de actos o actividades  pagados a la tasa de 15% ó 16% de IVA'"/>
<xsl:param name="total15" select="'Total de actos o actividades pagados a la tasa de 15% de IVA'"/>
<xsl:param name="total15o16NAc" select="'Total del IVA pagado no acreditable a la tasa de 15% ó 16% (Correspondiente en la proporción de las deducciones autorizadas)'"/>
<xsl:param name="total10o11" select="'Total de los actos o actividades pagados a la tasa de 10% u 11% de IVA'"/>
<xsl:param name="total10" select="'Total de los actos o actividades pagados a la tasa de 10% de IVA'"/>
<xsl:param name="total10o11NAc" select="'Total del IVA pagado no acreditable a la tasa de 10% u 11% (Correspondiente en la proporción de las deducciones autorizadas)'"/>
<xsl:param name="totalactos15o16" select="'Total de los actos o actividades pagados en la importación de bienes y servicios a la tasa 15% ó 16% de IVA'"/>
<xsl:param name="totaldatos15o16" select="'Total del IVA pagado no acreditable por la importación a la tasa de 15% ó 16% (Correspondiente en la proporción de las deducciones autorizadas)'"/>
<xsl:param name="totalactos10o11" select="'Total de los actos o actividades pagados en la importación de bienes y servicios a la tasa de 10% u 11% del IVA'"/>
<xsl:param name="totaldatos10o11" select="'Total del IVA pagado no acreditable por la importación a la tasa de 10% u 11% (Correspondiente en la proporción de las deducciones autorizadas)'"/>
<xsl:param name="totalIVAImp" select="'Total de los actos o actividades pagados en la importancia de bienes y servicios por los que no se pagará el IVA (Exentos)'"/>
<xsl:param name="totalactosCero" select="'Total de los demás actos o actividades pagados a la tasa de 0% de IVA'"/>
<xsl:param name="totalactosPag0" select="'Total de los actos o actividades pagados por los que no se pagará el IVA (Exentos)'"/>
<xsl:param name="totalIVACont" select="'Total de IVA retenido por el contribuyente'"/>
<xsl:param name="totalIVADev" select="'Total de IVA correspondiente a las devoluciones, descuentos y bonificaciones sobre compras'"/>
<xsl:param name="totalIVATras" select="'Total de IVA trasladado al contribuyente, excepto importaciones de bienes y servicios (Pagado)'"/>
<xsl:param name="totalIVAImpbYs" select="'Total de IVA pagado en las importaciones de bienes y servicios'"/>

<!--ENCABEZADOS DEL DPIVA-->
<xsl:param name="pPeriodoTraducido" select="'Periodo'"/>
<xsl:param name="pRFC" select="'RFC'"/>
<xsl:param name="pRazonEmpresa" select="'Razón social de la empresa'"/>

<xsl:param name="pVersion" select="'Versión'"/>
<xsl:param name="pEjercicio" select="'Ejercicio'"/>
<xsl:param name="pTipoPeriodicidad" select="'Tipo de periodicidad'"/>
<xsl:param name="pPeriodo" select="'Periodo SAT'"/>
<xsl:param name="pFechaC" select="'Fecha de causación'"/>
<xsl:param name="pDPIVA" select="'DPIVA'"/>
<xsl:param name="pTipoDeclaracion" select="'Tipo de declaración'"/>
<xsl:param name="pFolioAnt" select="'Folio anterior'"/>
<xsl:param name="pFechaPresAnt" select="'Fecha de presentación anterior'"/>

<!--ENCABEZADOS DE LOS PROVEEDORES NACIONALES-->
<xsl:param name="pTipoOperac" select="'Tipo de operación'"/>
<xsl:param name="pRFCProv" select="'RFC'"/>
<xsl:param name="pValActPagTas15o16IVA" select="'Actos Pagados Tasa 15% ó 16%'"/>
<xsl:param name="pValActPagTas15IVA" select="'Actos Pagados Tasa 15%'"/>
<xsl:param name="pMonIVAPagNoAcrTas15o16" select="'No Acreditable Pagado al 15% ó 16%'"/>
<xsl:param name="pValActPagTas10u11IVA" select="'Actos Pagados Tasa 10% u 11%'"/>
<xsl:param name="pValActPagTas10IVA" select="'Actos Pagados Tasa 10%'"/>
<xsl:param name="pMonIVAPagNoAcrTas10u11" select="'No Acreditable Pagado al 10% u 11%'"/>
<xsl:param name="pValActPagTas0IVA" select="'Actos Pagados Tasa 0%'"/>
<xsl:param name="pValActPagNoIVA" select="'Actos Pagados Exentos'"/>
<xsl:param name="pIVARetCont" select="'IVA Retenido'"/>
<xsl:param name="pIVADevDescyBonifComp" select="'IVA de Devoluciones, Descuentos y Bonificaciones'"/>

<!--ENCABEZADOS EXTRA DE LOS PROVEEDORES EXTRANJEROS Y GLOBALES-->
<xsl:param name="pNumIDFiscal" select="'Identificador Fiscal'"/>
<xsl:param name="pNombExtranjero" select="'Nombre'"/>
<xsl:param name="pPaisResidencia" select="'País de Residencia'"/>
<xsl:param name="pNacionalidad" select="'Nacionalidad'"/>
<xsl:param name="pValActPagImpBySTas15016IVA" select="'Actos Importación al 15% ó 16%'"/>
<xsl:param name="pMonIVAPagNoAcrImpTas15o16" select="'IVA No Acreditable Pagado Importación 15% ó 16%'"/>
<xsl:param name="pValActPagImpBySTas10u11IVA" select="'Actos Importación al 10% u 11%'"/>
<xsl:param name="pMonIVAPagNoAcrImpTas10u11" select="'IVA No Acreditable Pagado Importación 10% u 11%'"/>
<xsl:param name="pValActPagImpBySNoIVA" select="'Actos Importación Exentos'"/>

<!--ENCABEZADOS PARA DOCUMENTOS DIGITALES-->
<!--
<xsl:param name="pTipoDoctoDigital" select="'Tipo de documento digital'"/>
<xsl:param name="pCert" select="'Certificado'"/>
<xsl:param name="pNumCert" select="'Número de serie del certificado'"/>
<xsl:param name="pFirmaContrib" select="'Firma digital del contribuyente(FIEL)'"/>
-->

<html>

<head><title>Vista previa DPIVA</title>

<style type="text/css">
body
{
font-family: arial,verdana,sans-serif;
}

table.contpaqtable {
	font-size:11px;
	color:#333333;
	border-width: 1px;
	border-color: #000000;
	border-collapse: collapse;
	table-layout:fixed;
	width:2500px;
}

table.contpaqtable th {
	border: 2px solid #000000;
}

table.contpaqtable tr {
	width:2500px;
	padding: 0px; 
	background-color: #848484;
}

table.contpaqtable tr.header {
text-align:center;
}

table.contpaqtable td {
	padding: 0px;
	background-color: #F2F2F2;
	border: 2px solid #F2F2F2;
	text-align: right;
}

table.contpaqtable th p{
	margin:0px;
	padding:8px;
	border-top: 2px solid #eefafc;
	border-bottom:2px;
	border-left: 2px solid #eefafc;
	border-right:2px;
}

table.contpaqtable td p{
	margin:0px;
	padding:8px;
	border-top: 2px solid #fcfdec;
	border-bottom:2px;
	border-left: 2px solid #fcfdec;;
	border-right:2px;
}

table.contpaqtable td.columna{
	border-right:70px solid #000000;
}

<!-- Estilo para las tablas de totales-->
table.contpaqtabletotales {
	font-size:12px;
	color:#333333;
	border-color: #000000;
	border-collapse: collapse;
	width:2500px;
}

table.contpaqtabletotales th {
	border: 1px solid #009acc;
	text-align: left;
	padding: 8px; 
	background-color: #cdeaff;
}

table.contpaqtabletotales tr {
	width:2500px;
	padding: 0px; 
	border: 1px solid #009acc;
}

table.contpaqtabletotales tr.header {
	text-align:center; 
	border: 1px solid #009acc;
}


table.contpaqtabletotales td {
	padding: 5px;
	background-color: #c3e1f4;
	border: 1px solid #009acc;
	text-align: right;
	width="200px"
}

</style>

</head>
<body>
<img src="replacepathimage/imgLogoContpaqi.jpg" align="left"></img>

<!--
<h4 style="color:#01A9DB">Documento Digital</h4>
-->
<!--DESPLIEGUE DEL NODO DOCTO DIGITAL-->
<!--
<table border="0" class="contpaqtable">
<tr style="text-align:center">
<th><xsl:value-of select="$pVersion"/></th>
<th><xsl:value-of select="$pTipoDoctoDigital"/></th>
<th><xsl:value-of select="$pCert"/></th>
<th><xsl:value-of select="$pNumCert"/></th>
<th><xsl:value-of select="$pFirmaContrib"/></th>
</tr>
<xsl:for-each select="//DD:DoctoDigital">
<tr>
<td><xsl:value-of select="@Version"/></td>
<td><xsl:value-of select="@TipoDoctoDigital"/></td>
<td><xsl:value-of select="@Cert"/></td>
<td><xsl:value-of select="@NumCert"/></td>
<td><xsl:value-of select="@FirmaContrib"/></td>
</tr>
</xsl:for-each>
</table>
-->
<!--DESPLIEGUE DEL NODO EMISOR-->
<!--
<h4 style="color:#01A9DB">Emisor</h4>
<table border="0" class="contpaqtable">
<tr style="text-align:center">
<th><xsl:value-of select="$pVersion"/></th>
<th><xsl:value-of select="$pTipoDoctoDigital"/></th>
<th><xsl:value-of select="$pCert"/></th>
<th><xsl:value-of select="$pNumCert"/></th>
<th><xsl:value-of select="$pFirmaContrib"/></th>
</tr>
<xsl:for-each select="//DD:DoctoDigital">
<tr>
<td><xsl:value-of select="@Version"/></td>
<td><xsl:value-of select="@TipoDoctoDigital"/></td>
<td><xsl:value-of select="@Cert"/></td>
<td><xsl:value-of select="@NumCert"/></td>
<td><xsl:value-of select="@FirmaContrib"/></td>
</tr>
</xsl:for-each>
</table>
-->








<!--DESPLIEGUE DEL NODO DPIVA-->
<h3 style="color:#1C1C1C" align="center">Vista previa DPIVA</h3>
<h3 style="color:#1C1C1C" align="center">Declaración de proveedores IVA</h3>
<br/><br/>
<h4 style="color:#2E2E2E">Datos generales</h4>
<table border="0" class="contpaqtabletotales" style="width:500px">

<!--Valores del nodo DPIVA-->
<xsl:for-each select="//DPIVA:DPIVA">
<!--
<tr> 
	<th><xsl:value-of select="$pVersion"/></th>
	<td><xsl:value-of select="@Version"/></td>
</tr>
-->

<tr> 
	<th><xsl:value-of select="$pRFC"/></th>
	<td><xsl:value-of select="'LLAVERFC'"/></td>
</tr>

<tr> 
	<th><xsl:value-of select="$pRazonEmpresa"/></th>
	<td><xsl:value-of select="'LLAVERAZONEMPRESA'"/></td>
</tr>



<tr> 
	<th><xsl:value-of select="$pEjercicio"/></th>
	<td><xsl:value-of select="@Ejercicio"/></td>
</tr> 

<tr> 
	<th><xsl:value-of select="$pTipoPeriodicidad"/></th>
	<td><xsl:value-of select="@TipoPerid"/></td>
</tr> 

<tr> 
	<th><xsl:value-of select="$pPeriodoTraducido"/></th>
	<td><xsl:value-of select="'LLAVEPERIODOTRADUCIDO'"/></td>
</tr>

<tr> 
	<th><xsl:value-of select="$pPeriodo"/></th>
	<td><xsl:value-of select="@Periodo"/></td>
</tr> 
<!--
<tr> 
	<th><xsl:value-of select="$pFechaC"/></th>
	<td><xsl:value-of select="@FechaCausa"/></td>
</tr> 
-->
<!--
<tr> 
	<th><xsl:value-of select="$pDPIVA"/></th>
	<td><xsl:value-of select="@DPIVA"/></td>
</tr> 
-->
<tr> 
	<th><xsl:value-of select="$pTipoDeclaracion"/></th>
	<td><xsl:value-of select="@TipoDec"/></td>
</tr> 

<tr> 
	<th><xsl:value-of select="$pFolioAnt"/></th>
	<td><xsl:value-of select="@FolioAnt"/></td>
</tr> 

<tr> 
	<th><xsl:value-of select="$pFechaPresAnt"/></th>
	<td><xsl:value-of select="@FechPresAnt"/></td>
</tr> 

</xsl:for-each>
</table>
<!--DESPLIEGUE DEL NODO DE LOS TOTALES-->
<br/><br/>
<h4 style="color:#2E2E2E">Totales</h4>
<table class="contpaqtabletotales" style="!important; width:950px !important;">

<xsl:for-each select="//DPIVA:Totales">

<tr>
<th><xsl:value-of select="$totalOp"/></th>
<xsl:choose>
     <xsl:when test="number(@TotOperac) = @TotOperac">
     <td><xsl:value-of select="format-number(@TotOperac, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$total15o16"/></th>
<xsl:choose>
     <xsl:when test="number(@TotActPagTas15o16IVA) = @TotActPagTas15o16IVA">
       <td><xsl:value-of select="format-number(@TotActPagTas15o16IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$total15"/></th>
<xsl:choose>
     <xsl:when test="number(@totActPagTas15IVA) = @totActPagTas15IVA">
       <td><xsl:value-of select="format-number(@totActPagTas15IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$total15o16NAc"/></th>
<xsl:choose>
     <xsl:when test="number(@TotIVAPagNoAcrTas15o16) = @TotIVAPagNoAcrTas15o16">
       <td><xsl:value-of select="format-number(@TotIVAPagNoAcrTas15o16, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$total10o11"/></th>
<xsl:choose>
     <xsl:when test="number(@TotActPagTas10u11IVA) = @TotActPagTas10u11IVA">
       <td><xsl:value-of select="format-number(@TotActPagTas10u11IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$total10"/></th>
<xsl:choose>
     <xsl:when test="number(@TotActPagTas10IVA) = @TotActPagTas10IVA">
       <td><xsl:value-of select="format-number(@TotActPagTas10IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$total10o11NAc"/></th>
<xsl:choose>
     <xsl:when test="number(@TotIVAPagNoAcrTas10u11) = @TotIVAPagNoAcrTas10u11">
       <td><xsl:value-of select="format-number(@TotIVAPagNoAcrTas10u11, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalactos15o16"/></th>
<xsl:choose>
     <xsl:when test="number(@TotActPagImpBySTas15o16IVA) = @TotActPagImpBySTas15o16IVA">
       <td><xsl:value-of select="format-number(@TotActPagImpBySTas15o16IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totaldatos15o16"/></th>
<xsl:choose>
     <xsl:when test="number(@TotIVAPagNoAcrImpTas15o16) = @TotIVAPagNoAcrImpTas15o16">
       <td><xsl:value-of select="format-number(@TotIVAPagNoAcrImpTas15o16, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalactos10o11"/></th>
<xsl:choose>
     <xsl:when test="number(@TotActPagImpBySTas10u11IVA) = @TotActPagImpBySTas10u11IVA">
       <td><xsl:value-of select="format-number(@TotActPagImpBySTas10u11IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totaldatos10o11"/></th>
<xsl:choose>
     <xsl:when test="number(@TotIVAPagNoAcrImpTas10u11) = @TotIVAPagNoAcrImpTas10u11">
       <td><xsl:value-of select="format-number(@TotIVAPagNoAcrImpTas10u11, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalIVAImp"/></th>
<xsl:choose>
     <xsl:when test="number(@TotActPagImpBySNoPagIVA) = @TotActPagImpBySNoPagIVA">
       <td><xsl:value-of select="format-number(@TotActPagImpBySNoPagIVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalactosCero"/></th>
<xsl:choose>
     <xsl:when test="number(@TotDemActPagTas0IVA) = @TotDemActPagTas0IVA">
       <td><xsl:value-of select="format-number(@TotDemActPagTas0IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalactosPag0"/></th>
<xsl:choose>
     <xsl:when test="number(@TotActPagNoPagIVA) = @TotActPagNoPagIVA">
       <td><xsl:value-of select="format-number(@TotActPagNoPagIVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalIVACont"/></th>
<xsl:choose>
     <xsl:when test="number(@TotIVARetCont) = @TotIVARetCont">
       <td><xsl:value-of select="format-number(@TotIVARetCont, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalIVADev"/></th>
<xsl:choose>
     <xsl:when test="number(@TotIVADevDescyBonifComp) = @TotIVADevDescyBonifComp">
       <td><xsl:value-of select="format-number(@TotIVADevDescyBonifComp, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalIVATras"/></th>
<xsl:choose>
     <xsl:when test="number(@TotIVATraslContExcImpByS) = @TotIVATraslContExcImpByS">
       <td><xsl:value-of select="format-number(@TotIVATraslContExcImpByS, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

<tr>
<th><xsl:value-of select="$totalIVAImpbYs"/></th>
<xsl:choose>
     <xsl:when test="number(@TotIVAPagImpByS) = @TotIVAPagImpByS">
       <td><xsl:value-of select="format-number(@TotIVAPagImpByS, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>
</tr>

</xsl:for-each>
</table>

<!--DESPLIEGUE DEL NODO DE LOS PROVEEDORES NACIONALES (DE 0 A n)-->
<xsl:if test="//DPIVA:ProvNacional">
<br/><br/>
<h4 style="color:#2E2E2E">Proveedores Nacionales</h4>
<table border="0" class="contpaqtabletotales" style="table-layout:fixed !important; width:1910px !important;">
<tr style="text-align:center" class="header">
<!--encabezado del nodo-->
<th style="width:355px !important;"><xsl:value-of select="$pTipoOperac"/></th>
<th style="width:355px !important;"><xsl:value-of select="$pRFCProv"/></th>
<th ><xsl:value-of select="$pValActPagTas15o16IVA"/></th>
<th ><xsl:value-of select="$pValActPagTas15IVA"/></th>
<th ><xsl:value-of select="$pMonIVAPagNoAcrTas15o16"/></th>
<th ><xsl:value-of select="$pValActPagTas10u11IVA"/></th>
<th ><xsl:value-of select="$pValActPagTas10IVA"/></th>
<th ><xsl:value-of select="$pMonIVAPagNoAcrTas10u11"/></th>
<th ><xsl:value-of select="$pValActPagTas0IVA"/></th>
<th ><xsl:value-of select="$pValActPagNoIVA"/></th>
<th ><xsl:value-of select="$pIVARetCont"/></th>
<th ><xsl:value-of select="$pIVADevDescyBonifComp"/></th>
</tr>
<!--Valores del nodo Proveedores Nacionales-->
<xsl:for-each select="//DPIVA:ProvNacional">
<tr>
<td style="text-align:left"><xsl:value-of select="@TipoOperac"/></td>
<td style="text-align:left"><xsl:value-of select="@RFCProv"/></td>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas15o16IVA) = @ValActPagTas15o16IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas15o16IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas15IVA) = @ValActPagTas15IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas15IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrTas15o16) = @MonIVAPagNoAcrTas15o16">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrTas15o16, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas10u11IVA) = @ValActPagTas10u11IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas10u11IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas10IVA) = @ValActPagTas10IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas10IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrTas10u11) = @MonIVAPagNoAcrTas10u11">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrTas10u11, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas0IVA) = @ValActPagTas0IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas0IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagNoIVA) = @ValActPagNoIVA">
       <td><xsl:value-of select="format-number(@ValActPagNoIVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@IVARetCont) = @IVARetCont">
       <td><xsl:value-of select="format-number(@IVARetCont, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@IVADevDescyBonifComp) = @IVADevDescyBonifComp">
       <td><xsl:value-of select="format-number(@IVADevDescyBonifComp, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

</tr>
</xsl:for-each>
</table>
</xsl:if>

<!--DESPLEIGUE DEL NODO DE LOS PROVEEDORES EXTRANJEROS (DE 0 A n)-->
<xsl:if test="//DPIVA:ProvExtranjero">
<br/><br/>
<h4 style="color:#2E2E2E">Proveedores Extranjeros</h4>
<table border="0" class="contpaqtabletotales">
<tr style="text-align:center" class="header">
<!--encabezado del nodo-->
<th><xsl:value-of select="$pTipoOperac"/></th>
<th><xsl:value-of select="$pRFCProv"/></th>
<th><xsl:value-of select="$pNumIDFiscal"/></th>
<th><xsl:value-of select="$pNombExtranjero"/></th>
<th><xsl:value-of select="$pPaisResidencia"/></th>
<th><xsl:value-of select="$pNacionalidad"/></th>
<th><xsl:value-of select="$pValActPagTas15o16IVA"/></th>
<th><xsl:value-of select="$pValActPagTas15IVA"/></th>
<th><xsl:value-of select="$pMonIVAPagNoAcrTas15o16"/></th>
<th><xsl:value-of select="$pValActPagTas10u11IVA"/></th>
<th><xsl:value-of select="$pValActPagTas10IVA"/></th>
<th><xsl:value-of select="$pMonIVAPagNoAcrTas10u11"/></th>
<th><xsl:value-of select="$pValActPagTas0IVA"/></th>
<th><xsl:value-of select="$pValActPagNoIVA"/></th>
<th><xsl:value-of select="$pIVARetCont"/></th>
<th><xsl:value-of select="$pIVADevDescyBonifComp"/></th>

<th><xsl:value-of select="$pValActPagImpBySTas15016IVA"/></th>
<th><xsl:value-of select="$pMonIVAPagNoAcrImpTas15o16"/></th>
<th><xsl:value-of select="$pValActPagImpBySTas10u11IVA"/></th>
<th><xsl:value-of select="$pMonIVAPagNoAcrImpTas10u11"/></th>
<th><xsl:value-of select="$pValActPagImpBySNoIVA"/></th>




</tr>
<!--Valores del nodo Proveedores Extranjeros-->
<xsl:for-each select="//DPIVA:ProvExtranjero">
<tr>
<td style="text-align:left"><xsl:value-of select="@TipoOperac"/></td>
<td style="text-align:left"><xsl:value-of select="@RFCProv"/></td>
<td><xsl:value-of select="@NumIDFiscal"/></td>
<td style="text-align:left"><xsl:value-of select="@NombExtranjero"/></td>
<td style="text-align:center"><xsl:value-of select="@PaisResidencia"/></td>
<td style="text-align:center"><xsl:value-of select="@Nacionalidad"/></td>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas15o16IVA) = @ValActPagTas15o16IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas15o16IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas15IVA) = @ValActPagTas15IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas15IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrTas15o16) = @MonIVAPagNoAcrTas15o16">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrTas15o16, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas10u11IVA) = @ValActPagTas10u11IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas10u11IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas10IVA) = @ValActPagTas10IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas10IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrTas10u11) = @MonIVAPagNoAcrTas10u11">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrTas10u11, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas0IVA) = @ValActPagTas0IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas0IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagNoIVA) = @ValActPagNoIVA">
       <td><xsl:value-of select="format-number(@ValActPagNoIVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@IVARetCont) = @IVARetCont">
       <td><xsl:value-of select="format-number(@IVARetCont, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@IVADevDescyBonifComp) = @IVADevDescyBonifComp">
       <td><xsl:value-of select="format-number(@IVADevDescyBonifComp, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagImpBySTas15o16IVA) = @ValActPagImpBySTas15o16IVA">
       <td><xsl:value-of select="format-number(@ValActPagImpBySTas15o16IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrImpTas15o16) = @MonIVAPagNoAcrImpTas15o16">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrImpTas15o16, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagImpBySTas10u11IVA) = @ValActPagImpBySTas10u11IVA">
       <td><xsl:value-of select="format-number(@ValActPagImpBySTas10u11IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrImpTas10u11) = @MonIVAPagNoAcrImpTas10u11">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrImpTas10u11, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagImpBySNoIVA) = @ValActPagImpBySNoIVA">
       <td><xsl:value-of select="format-number(@ValActPagImpBySNoIVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

</tr>
</xsl:for-each>
</table>
</xsl:if>

<!--DESPLIEGUE DEL NODO DE LOS PROVEEDORES GLOBALES (DE 1 A n)-->

<xsl:if test="//DPIVA:ProvGlobal">
<br/><br/>
<h4 style="color:#2E2E2E">Proveedores Globales</h4>
<table border="0" class="contpaqtabletotales">
<tr style="text-align:center" class="header">
<!--encabezado del nodo-->
<th colspan="6"><xsl:value-of select="$pTipoOperac"/></th>
<th><xsl:value-of select="$pValActPagTas15o16IVA"/></th>
<th><xsl:value-of select="$pValActPagTas15IVA"/></th>
<th><xsl:value-of select="$pMonIVAPagNoAcrTas15o16"/></th>
<th><xsl:value-of select="$pValActPagTas10u11IVA"/></th>
<th><xsl:value-of select="$pValActPagTas10IVA"/></th>
<th><xsl:value-of select="$pMonIVAPagNoAcrTas10u11"/></th>
<th><xsl:value-of select="$pValActPagTas0IVA"/></th>
<th><xsl:value-of select="$pValActPagNoIVA"/></th>
<th><xsl:value-of select="$pIVARetCont"/></th>
<th><xsl:value-of select="$pIVADevDescyBonifComp"/></th>

<th><xsl:value-of select="$pValActPagImpBySTas15016IVA"/></th>
<th><xsl:value-of select="$pMonIVAPagNoAcrImpTas15o16"/></th>
<th><xsl:value-of select="$pValActPagImpBySTas10u11IVA"/></th>
<th><xsl:value-of select="$pMonIVAPagNoAcrImpTas10u11"/></th>
<th><xsl:value-of select="$pValActPagImpBySNoIVA"/></th>

</tr>
<!--Valores del nodo Proveedores Globales-->
<xsl:for-each select="//DPIVA:ProvGlobal">
<tr>
<td style="text-align:left" colspan="6"><xsl:value-of select="@TipoOperac"/></td>
<xsl:choose>
     <xsl:when test="number(@ValActPagTas15o16IVA) = @ValActPagTas15o16IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas15o16IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas15IVA) = @ValActPagTas15IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas15IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrTas15o16) = @MonIVAPagNoAcrTas15o16">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrTas15o16, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas10u11IVA) = @ValActPagTas10u11IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas10u11IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas10IVA) = @ValActPagTas10IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas10IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrTas10u11) = @MonIVAPagNoAcrTas10u11">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrTas10u11, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagTas0IVA) = @ValActPagTas0IVA">
       <td><xsl:value-of select="format-number(@ValActPagTas0IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagNoIVA) = @ValActPagNoIVA">
       <td><xsl:value-of select="format-number(@ValActPagNoIVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@IVARetCont) = @IVARetCont">
       <td><xsl:value-of select="format-number(@IVARetCont, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@IVADevDescyBonifComp) = @IVADevDescyBonifComp">
       <td><xsl:value-of select="format-number(@IVADevDescyBonifComp, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagImpBySTas15o16IVA) = @ValActPagImpBySTas15o16IVA">
       <td><xsl:value-of select="format-number(@ValActPagImpBySTas15o16IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrImpTas15o16) = @MonIVAPagNoAcrImpTas15o16">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrImpTas15o16, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagImpBySTas10u11IVA) = @ValActPagImpBySTas10u11IVA">
       <td><xsl:value-of select="format-number(@ValActPagImpBySTas10u11IVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@MonIVAPagNoAcrImpTas10u11) = @MonIVAPagNoAcrImpTas10u11">
       <td><xsl:value-of select="format-number(@MonIVAPagNoAcrImpTas10u11, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

<xsl:choose>
     <xsl:when test="number(@ValActPagImpBySNoIVA) = @ValActPagImpBySNoIVA">
       <td><xsl:value-of select="format-number(@ValActPagImpBySNoIVA, '#,###')"/></td>
     </xsl:when>
     <xsl:otherwise>
      <td>0</td>
     </xsl:otherwise>
</xsl:choose>

</tr>
</xsl:for-each>
</table>
</xsl:if>

</body>
</html>
</xsl:template>
</xsl:stylesheet>

