Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Document : AllClienteData.xsl
- Created on : 19 de Maio de 2019, 17:11
- Author : morei
- Description:
- Purpose of transformation follows.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="html"/>
- <xsl:template match="/casos">
- <html>
- <body>
- <table>
- <tr bgcolor="#9acd32">
- <th>Nome do Cliente</th>
- <th>Nome do objeto</th>
- <th>Morada</th>
- <th>Coberturas</th>
- <th>Valor Prémio</th>
- <th>Vigência</th>
- <th>Incidências</th>
- </tr>
- <tr>
- <xsl:apply-templates select="cliente"/>
- </tr>
- </table>
- </body>
- </html>
- </xsl:template>
- <xsl:template match="cliente">
- <td>
- <h5>Nome:
- <xsl:apply-templates select="nome"/>
- </h5>
- </td>
- <h5>Objetos:
- <xsl:apply-templates select="objetos"/>
- </h5>
- </xsl:template>
- <xsl:template match="nome">
- <h6>
- <xsl:value-of select="primeiro"/>
- <xsl:value-of select="apelido"/>
- </h6>
- </xsl:template>
- <xsl:template match="objetos">
- <h6>Objecto
- <xsl:apply-templates select="objeto"/>
- </h6>
- </xsl:template>
- <xsl:template match="objeto">
- <td>
- <h6>
- Nome Objeto
- <xsl:value-of select="nomeObjeto"/>
- </h6>
- </td>
- <td>
- <h6>
- Morada Objeto
- <xsl:apply-templates select="moradaObjeto"/>
- </h6>
- </td>
- <td>
- <h6>
- Coberturas Objeto
- <xsl:apply-templates select="coberturas"/>
- </h6>
- </td>
- <td>
- <h6>
- Valor Premio Objeto
- <xsl:value-of select="valorPremio"/>
- </h6>
- </td>
- <td>
- <h6>
- Vigencia Objeto
- <xsl:apply-templates select="vigencia"/>
- </h6>
- </td>
- <td>
- <h6>
- Ocurencias Objeto
- <xsl:apply-templates select="ocurrencias"/>
- </h6>
- </td>
- </xsl:template>
- <xsl:template match="coberturas">
- <h6>
- Cobertura
- <xsl:apply-templates select="cobertura"/>
- </h6>
- </xsl:template>
- <xsl:template match="cobertura">
- <h6>Nome Cobertura
- <xsl:value-of select="@cobertura"/>
- </h6>
- <h6>Descricao
- <xsl:value-of select="descricao"/>
- </h6>
- </xsl:template>
- <xsl:template match="moradaObjeto">
- <h6>Rua:
- <xsl:value-of select="rua"/>
- </h6>
- <h6>
- Porta:
- <xsl:value-of select="porta"/>
- </h6>
- <h6>
- Localidade:
- <xsl:value-of select="localidade"/>
- </h6>
- <h6>
- Pais:
- <xsl:value-of select="pais"/>
- </h6>
- <h6>
- Codigo Postal:
- <xsl:value-of select="codigo_postal"/>
- </h6>
- </xsl:template>
- <xsl:template match="vigencia">
- <tr>
- <h5>Data inicio
- <xsl:apply-templates select="dataInicio"/>
- </h5>
- <h5>Data fim
- <xsl:apply-templates select="dataFim"/>
- </h5>
- </tr>
- </xsl:template>
- <xsl:template match="dataInicio">
- <xsl:if test="dataInicio/mes=05">
- <tr>
- <h5>Ano
- <xsl:value-of select="ano"/>
- </h5>
- <h5>Mes
- <xsl:value-of select="mes"/>
- </h5>
- <h5>Dia
- <xsl:value-of select="dia"/>
- </h5>
- </tr>
- </xsl:if>
- </xsl:template>
- <xsl:template match="dataFim">
- <tr>
- <h5>Ano
- <xsl:value-of select="ano"/>
- </h5>
- <h5>Mes
- <xsl:value-of select="mes"/>
- </h5>
- <h5>Dia
- <xsl:value-of select="dia"/>
- </h5>
- </tr>
- </xsl:template>
- <xsl:template match="ocurrencias">
- <h5>Ocurencias Total
- <xsl:value-of select="ocurrenciasTotal"/>
- </h5>
- <h5>Ocurencias Penultimo Ano
- <xsl:value-of select="ocurrenciasPenultimoAno"/>
- </h5>
- <h5>Ocurencias Ultimo Ano
- <xsl:value-of select="ocurrenciasUltimoAno"/>
- </h5>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement