Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <html>
- <body>
- <table border="1">
- <tr bgcolor="red">
- <th>ISBN</th>
- <th>Titulo</th>
- <th>Autor</th>
- <th>Precio</th>
- <th>Numero de páginas</th>
- </tr>
- <xsl:for-each select="libreria/libro">
- <xsl:choose>
- <xsl:when test="numPaginas<150">
- <tr bgcolor="green">
- <td><xsl:value-of select="isbn"/></td>
- <td><xsl:value-of select="titulo"/></td>
- <td><xsl:value-of select="autor"/></td>
- <td><xsl:value-of select="precio"/></td>
- <td><xsl:value-of select="numPaginas"/></td>
- </tr>
- </xsl:when>
- <xsl:when test="numPaginas>200">
- <tr bgcolor="blue">
- <td><xsl:value-of select="isbn"/></td>
- <td><xsl:value-of select="titulo"/></td>
- <td><xsl:value-of select="autor"/></td>
- <td><xsl:value-of select="precio"/></td>
- <td><xsl:value-of select="numPaginas"/></td>
- </tr>
- </xsl:when>
- <xsl:otherwise>
- <tr bgcolor="red">
- <td><xsl:value-of select="isbn"/></td>
- <td><xsl:value-of select="titulo"/></td>
- <td><xsl:value-of select="autor"/></td>
- <td><xsl:value-of select="precio"/></td>
- <td><xsl:value-of select="numPaginas"/></td>
- </tr>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </table>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement