[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

pagination - From PHP To XSL - Recursion ?

Subject: pagination - From PHP To XSL - Recursion ?
From: "Alejandro" <alexcontini@xxxxxxxx>
Date: Sat, 2 Feb 2008 15:16:46 -0000
 pagination - From PHP To XSL - Recursion ?
Hello, i want to calculate and to catch the final result of the variables $_pagi_nav_desde and $_pagi_nav_hasta to pass them to one template. I donB4t know to make it in XSL, because i know that in XSL the variables canB4t to change. Can you help me, please?

Cheers,
Alexander


// PHP Code//


// Calculamos desde que numero de pagina se mostrara
$_pagi_nav_desde = $_pagi_actual - $_pagi_nav_intervalo;
// Calculamos hasta que numero de pagina se mostrara
$_pagi_nav_hasta = $_pagi_actual + $_pagi_nav_intervalo;

// Ajustamos los valores anteriores en caso sean resultados no vC!lidos

// Si $_pagi_nav_desde es un numero negativo
if($_pagi_nav_desde < 1){
// Le sumamos la cantidad sobrante al final para mantener el numero de enlaces que se quiere mostrar.
$_pagi_nav_hasta -= ($_pagi_nav_desde - 1);
// Establecemos $_pagi_nav_desde como 1.
$_pagi_nav_desde = 1;
}


// Si $_pagi_nav_hasta es un numero mayor que el total de paginas
if($_pagi_nav_hasta > $_pagi_totalPags){
// Le restamos la cantidad excedida al comienzo para mantener el numero de enlaces que se quiere mostrar.
$_pagi_nav_desde -= ($_pagi_nav_hasta - $_pagi_totalPags);
// Establecemos $_pagi_nav_hasta como el total de paginas.
$_pagi_nav_hasta = $_pagi_totalPags;


// Hacemos el ultimo ajuste verificando que al cambiar $_pagi_nav_desde no haya quedado con un valor no valido.
if($_pagi_nav_desde < 1){
$_pagi_nav_desde = 1;
}
}



// XSL Code //
<xsl:call-template name="pagination-item">
<xsl:with-param name="current" select="$curpage"/>
<xsl:with-param name="p" select="$_pagi_nav_desde"/> ??
<xsl:with-param name="last" select="$_pagi_nav_hasta"/> ??
<xsl:with-param name="script" select="$script"/>
</xsl:call-template>


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.