![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
13/06/2005, 05:11
|
| | Fecha de Ingreso: mayo-2005 Ubicación: España
Mensajes: 279
Antigüedad: 19 años, 9 meses Puntos: 2 | |
Al tener varios controles el apply templates debo redirigirlo a todos?
El código completo es:
<?xsl version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="formulario/titulo"/></title>
</head>
<body>
<h3><xsl:value-of select="formulario/comentarios"/></h3>
<form>
<xsl:attribute name="action">procesar.jsp?idForm=<xsl:value-of select="formulario/id"/></xsl:attribute>
</form>
<link>
<xsl:attribute name="href"><xsl:value-of select="formulario/formato"/></xsl:attribute>
</link>
<xsl:for-each select="formulario/controles">
<xsl:if test="LineaTexto">
<p>
<tr>
<td align="center"> <xsl:value-of select="./LineaTexto/nombre"/>: </td>
<td align="center">
<input type="text" >
<xsl:attribute name="name"><xsl:value-of select="./LineaTexto/name"/></xsl:attribute>
<xsl:attribute name="size"><xsl:value-of select="./LineaTexto/size"/></xsl:attribute>
<xsl:attribute name="maxlength"><xsl:value-of select="./LineaTexto/maxlength"/></xsl:attribute>
</input>
</td>
</tr>
</p>
</xsl:if>
<xsl:if test="AreaTexto">
<p>
<tr>
<td> <xsl:value-of select="./AreaTexto/nombre" />: </td>
<td align="center">
<textarea>
<xsl:attribute name="name"><xsl:value-of select="./AreaTexto/name"/></xsl:attribute>
<xsl:attribute name="rows"><xsl:value-of select="./AreaTexto/rows"/></xsl:attribute>
<xsl:attribute name="cols"><xsl:value-of select="./AreaTexto/cols"/></xsl:attribute>
<xsl:value-of select="./AreaTexto/textoDefecto" />
</textarea>
</td>
</tr>
</p>
</xsl:if>
<xsl:if test="Checkbox">
<p>
<tr>
<td> <xsl:value-of select="./Checkbox/nombre"/>: </td>
<td>
<xsl:for-each select="./Checkbox/elemento">
<tr>
<td>
<input type="checkbox">
<xsl:attribute name="name"><xsl:value-of select="./Checkbox/elemento/name"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="./Checkbox/elemento/value"/></xsl:attribute>
</input>
</td>
<td>
<xsl:value-of select="./Checkbox/elemento/value"/>
</td>
</tr>
</xsl:for-each>
</td>
</tr>
</p>
</xsl:if>
<xsl:if test="Password">
<p>
<tr>
<td> <xsl:value-of select="./Password/nombre"/>: </td>
<td>
<input type="password">
<xsl:attribute name="name"><xsl:value-of select="./Password/name"/></xsl:attribute>
<xsl:attribute name="size"><xsl:value-of select="./Password/size"/></xsl:attribute>
<xsl:attribute name="maxlength"><xsl:value-of select="./Password/maxlength"/></xsl:attribute>
</input>
</td>
</tr>
</p>
</xsl:if>
<xsl:if test="ListaDesplegable">
<p>
<tr>
<td> <xsl:value-of select="./ListaDesplegable/nombre"/>: </td>
<td>
<select>
<xsl:attribute name="name"><xsl:value-of select="./ListaDesplegable/name"/></xsl:attribute>
<xsl:for-each select="./ListaDesplegable/elemento">
<option>
<xsl:attribute name="value"><xsl:value-of select="./ListaDesplegable/elemento/value"/></xsl:attribute><xsl:value-of select="./ListaDesplegable/elemento/valueus"/>
</option>
</xsl:for-each>
</select>
</td>
</tr>
</p>
</xsl:if>
<xsl:if test="Radio">
<p>
<tr>
<td> <xsl:value-of select="./Radio/nombre"/>: </td>
<td>
<xsl:for-each select="./Radio/value">
<input type="radio">
<xsl:attribute name="name"><xsl:value-of select="./Radio/name"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="./Radio/value"/></xsl:attribute>
</input>
</xsl:for-each>
</td>
</tr>
</p>
</xsl:if>
<xsl:if test="Submit">
<p>
<tr>
<td>
<input type="submit">
<xsl:attribute name="value"><xsl:value-of select="./Submit/nombre"/></xsl:attribute>
<xsl:attribute name="action"><xsl:value-of select="./Submit/action"/></xsl:attribute>
</input>
</td>
</tr>
</p>
</xsl:if>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet> |