Mis CookBook
Tuesday, March 07, 2006
Friday, February 24, 2006
Monday, January 30, 2006
Apache2 + php4 Windows
- Instalacion de Apache 2
- Descargar el fichero: apache_2.0.55-win32-x86-no_ssl.msi
- Ejecutar e instalar como servicio
C:\Archivos de programa\Apache Group\Apache2\bin\apache -k install
- Instalacion de PHP4
- Descargar php-4.4.2-Win32.zip
y descomprimir enD:\php4
- Copiar
D:\php4\sapi\php4apache2.dll
aD:\php4
- Copiar
D:\php4\php4ts.dll
aC:\Archivos de programa\Apache Group\Apache2\bin
- Agregar a
httpd.conf
LoadModule php4_module "D:/php/php4apache2.dll"
AddType application/x-httpd-php .php - Copiar
D:\php4\php.ini
aC:\Windows
- Descargar php-4.4.2-Win32.zip
Friday, January 13, 2006
Xsl Recursion
<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/listado">
<xsl:call-template name="habitante">
<xsl:with-param name="municipio" select="/listado/datos_ayto/nombre"/>
<xsl:with-param name="habitante" select="/listado/habitantes/habitante"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="habitante">
<xsl:param name="i" select="1" />
<xsl:param name="habitante" />
<xsl:value-of select="$i"/>
<xsl:value-of select="$habitante"/>
<xsl:variable name="sgte" select="$habitante/following-sibling::*" />
<xsl:if test="$sgte">
<xsl:call-template name="habitante">
<xsl:with-param name="habitante" select="$sgte"/>
<xsl:with-param name="i" select="$i + 1 "/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Wednesday, January 11, 2006
XSL SUMA recursiva
Fichero XML
<?xml version="1.0"?>
<booklist>
<book>
<title>Angela's Ashes</title>
<author>Frank McCourt</author>
<publisher>HarperCollins</publisher>
<isbn>0 00 649840 X</isbn>
<price>6.99</price>
<sales>235</sales>
</book>
<book>
<title>Sword of Honour</title>
<author>Evelyn Waugh</author>
<publisher>Penguin Books</publisher>
<isbn>0 14 018967 X</isbn>
<price>12.99</price>
<sales>12</sales>
</book> </booklist>
Fichero XSL
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:call-template name="sumSales1">
<xsl:with-param name="pNodes" select="/*/book"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="sumSales1">
<xsl:param name="pNodes" select="/.."/>
<xsl:param name="result" select="0"/>
<xsl:choose>
<xsl:when test="$pNodes">
<xsl:call-template name="sumSales1">
<xsl:with-param name="pNodes" select="$pNodes[position()!=1]"/>
<xsl:with-param name="result" select="$result + $pNodes[1]/sales*$pNodes[1]/price"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>