![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
06/06/2005, 02:24
|
![Avatar de Helbira](http://static.forosdelweb.com/customavatars/avatar6439_3.gif) | | | Fecha de Ingreso: octubre-2001 Ubicación: Sevilla, España
Mensajes: 1.228
Antigüedad: 23 años, 3 meses Puntos: 5 | |
strSplit Ahí la llevas
Código:
<xsl:template name="strSplit">
<xsl:param name="string" />
<xsl:param name="pattern" />
<xsl:choose>
<xsl:when test="contains($string, $pattern)">
<xsl:call-template name="strSplit">
<xsl:with-param name="string" select="substring-before($string, $pattern)" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
<xsl:call-template name="strSplit">
<xsl:with-param name="string" select="substring-after($string, $pattern)" />
<xsl:with-param name="pattern" select="$pattern" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Ejemplo de llamada:
Código:
<xsl:template match="/">
<xsl:call-template name="strSplit">
<xsl:with-param name="string" select="'123456-7895678-345678'" />
<xsl:with-param name="pattern" select="'-'" />
</xsl:call-template>
</xsl:template>
__________________ BUSCO TELETRABAJO
Experiencia de mas de 4 años como desarrolladora web en PHP, ASP, XML, XSL, JavaScript, MySQL, PostGres, SQLServer, ... |