![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
15/06/2005, 04:15
|
![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 | |
Ahí llevas el código de tu XSL. Tienes arreglado el tema que no te agrupe cada tipo de control del formualrio sino que te aparezcan en el orden en que vienen en el XML. Creo que es eso lño que querias.
Código:
<?xml version="1.0" encoding="iso-8859-1"?>
<?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/text()"/></title></head>
<body>
<h3><xsl:value-of select="formulario/comentarios/text()"/></h3>
<form>
<xsl:attribute name="action">procesar.jsp?idForm=<xsl:value-of select="formulario/id/text()"/></xsl:attribute>
</form>
<link>
<xsl:attribute name="href"><xsl:value-of select="formulario/formato/text()"/></xsl:attribute>
</link>
<xsl:apply-templates select="formulario/controles" />
</body>
</html>
</xsl:template>
<xsl:template match="controles">
<xsl:apply-templates select="child::*" />
</xsl:template>
<xsl:template match="LineaTexto">
<p>
<tr>
<td align="center"> <xsl:value-of select="nombre/text()"/>: </td>
<td align="center">
<input type="text" >
<xsl:attribute name="name"><xsl:value-of select="name/text()"/></xsl:attribute>
<xsl:attribute name="size"><xsl:value-of select="size/text()"/></xsl:attribute>
<xsl:attribute name="maxlength"><xsl:value-of select="maxlength/text()"/></xsl:attribute>
</input>
</td>
</tr>
</p>
</xsl:template>
<xsl:template match="AreaTexto">
<p>
<tr>
<td> <xsl:value-of select="AreaTexto/nombre" />: </td>
<td align="center">
<textarea>
<xsl:attribute name="name"><xsl:value-of select="name"/></xsl:attribute>
<xsl:attribute name="rows"><xsl:value-of select="rows"/></xsl:attribute>
<xsl:attribute name="cols"><xsl:value-of select="cols"/></xsl:attribute>
<xsl:value-of select="textoDefecto" />
</textarea>
</td>
</tr>
</p>
</xsl:template>
<xsl:template match="Checkbox">
<p>
<tr>
<td> <xsl:value-of select="nombre"/>: </td>
<td>
<xsl:for-each select="elemento">
<tr>
<td>
<input type="checkbox">
<xsl:attribute name="name"><xsl:value-of select="name/text()"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="value/text()"/></xsl:attribute>
</input>
</td>
<td><xsl:value-of select="value/text()"/></td>
</tr>
</xsl:for-each>
</td>
</tr>
</p>
</xsl:template>
<xsl:template match="Password">
<p>
<tr>
<td> <xsl:value-of select="nombre"/>: </td>
<td>
<input type="password">
<xsl:attribute name="name"><xsl:value-of select="name"/></xsl:attribute>
<xsl:attribute name="size"><xsl:value-of select="size"/></xsl:attribute>
<xsl:attribute name="maxlength"><xsl:value-of select="maxlength"/></xsl:attribute>
</input>
</td>
</tr>
</p>
</xsl:template>
<xsl:template match="ListaDesplegable">
<p>
<tr>
<td> <xsl:value-of select="nombre"/>: </td>
<td>
<select>
<xsl:attribute name="name"><xsl:value-of select="name"/></xsl:attribute>
<xsl:for-each select="elemento">
<option>
<xsl:attribute name="value"><xsl:value-of select="value"/></xsl:attribute><xsl:value-of select="value"/>
</option>
</xsl:for-each>
</select>
</td>
</tr>
</p>
</xsl:template>
<xsl:template match="Radio">
<p>
<tr>
<td> <xsl:value-of select="nombre"/>: </td>
<td>
<xsl:for-each select="value">
<input type="radio">
<xsl:attribute name="name"><xsl:value-of select="name"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="value"/></xsl:attribute>
</input>
</xsl:for-each>
</td>
</tr>
</p>
</xsl:template>
<xsl:template match="Submit">
<p>
<tr>
<td>
<input type="submit">
<xsl:attribute name="value"><xsl:value-of select="nombre"/></xsl:attribute>
<xsl:attribute name="action"><xsl:value-of select="action"/></xsl:attribute>
</input>
</td>
</tr>
</p>
</xsl:template>
<xsl:template match="Reset">
<p>
<tr>
<td>
<input type="reset">
<xsl:attribute name="value"><xsl:value-of select="nombre"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="name"/></xsl:attribute>
</input>
</td>
</tr>
</p>
</xsl:template>
</xsl:stylesheet>
Besos
__________________ BUSCO TELETRABAJO
Experiencia de mas de 4 años como desarrolladora web en PHP, ASP, XML, XSL, JavaScript, MySQL, PostGres, SQLServer, ... |