Advertisement
moreiramota

Untitled

May 19th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.01 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!--
  4. Document : AllClienteData.xsl
  5. Created on : 19 de Maio de 2019, 17:11
  6. Author : morei
  7. Description:
  8. Purpose of transformation follows.
  9. -->
  10. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  11. <xsl:output method="html"/>
  12. <xsl:template match="/casos">
  13. <html>
  14. <body>
  15. <table>
  16. <tr bgcolor="#9acd32">
  17. <th>Nome do Cliente</th>
  18. <th>Nome do objeto</th>
  19. <th>Morada</th>
  20. <th>Coberturas</th>
  21. <th>Valor Prémio</th>
  22. <th>Vigência</th>
  23. <th>Incidências</th>
  24. </tr>
  25. <tr>
  26. <xsl:if test="dataInicio/mes=05">
  27. <xsl:apply-templates select="cliente"/>
  28. </xsl:if>
  29. </tr>
  30. </table>
  31. </body>
  32. </html>
  33. </xsl:template>
  34.  
  35. <xsl:template match="cliente">
  36. <xsl:if test="objetos/objeto/vigencia/dataInicio/mes=05">
  37. <td>
  38. <h5>
  39. <xsl:apply-templates select="nome"/>
  40. </h5>
  41. </td>
  42. <h5>Objetos:
  43. <xsl:apply-templates select="objetos"/>
  44. </h5>
  45. </xsl:if>
  46. </xsl:template>
  47.  
  48. <xsl:template match="nome">
  49. <h6>
  50. <xsl:value-of select="primeiro"/>
  51. <xsl:value-of select="apelido"/>
  52. </h6>
  53. </xsl:template>
  54.  
  55. <xsl:template match="objetos">
  56. <h6>Objecto
  57. <xsl:apply-templates select="objeto"/>
  58. </h6>
  59. </xsl:template>
  60.  
  61.  
  62.  
  63. <xsl:template match="objeto">
  64. <td>
  65. <h6>
  66. <xsl:value-of select="nomeObjeto"/>
  67. </h6>
  68. </td>
  69. <td>
  70. <h6>
  71. <xsl:apply-templates select="moradaObjeto"/>
  72. </h6>
  73. </td>
  74. <td>
  75. <h6>
  76. <xsl:apply-templates select="coberturas"/>
  77. </h6>
  78. </td>
  79. <td>
  80. <h6>
  81. <xsl:value-of select="valorPremio"/>
  82. </h6>
  83. </td>
  84. <td>
  85. <h6>
  86. <xsl:apply-templates select="vigencia"/>
  87. </h6>
  88. </td>
  89. <td>
  90. <h6>
  91. <xsl:apply-templates select="ocurrencias"/>
  92. </h6>
  93. </td>
  94. </xsl:template>
  95.  
  96.  
  97. <xsl:template match="coberturas">
  98. <h6>
  99. Cobertura
  100. <xsl:apply-templates select="cobertura"/>
  101. </h6>
  102. </xsl:template>
  103.  
  104.  
  105. <xsl:template match="cobertura">
  106. <h6>Nome Cobertura
  107. <xsl:value-of select="@cobertura"/>
  108. </h6>
  109. <h6>Descricao
  110. <xsl:value-of select="descricao"/>
  111. </h6>
  112. </xsl:template>
  113.  
  114.  
  115. <xsl:template match="moradaObjeto">
  116. <h6>Rua:
  117. <xsl:value-of select="rua"/>
  118. </h6>
  119. <h6>
  120. Porta:
  121. <xsl:value-of select="porta"/>
  122. </h6>
  123. <h6>
  124. Localidade:
  125. <xsl:value-of select="localidade"/>
  126. </h6>
  127. <h6>
  128. Pais:
  129. <xsl:value-of select="pais"/>
  130. </h6>
  131. <h6>
  132. Codigo Postal:
  133. <xsl:value-of select="codigo_postal"/>
  134. </h6>
  135. </xsl:template>
  136.  
  137. <xsl:template match="vigencia">
  138. <tr>
  139. <h5>Data inicio
  140. <xsl:apply-templates select="dataInicio"/>
  141. </h5>
  142. <h5>Data fim
  143. <xsl:apply-templates select="dataFim"/>
  144. </h5>
  145. </tr>
  146. </xsl:template>
  147.  
  148. <xsl:template match="dataInicio">
  149.  
  150. <tr>
  151. <h5>Ano
  152. <xsl:value-of select="ano"/>
  153. </h5>
  154. <h5>Mes
  155. <xsl:value-of select="mes"/>
  156. </h5>
  157. <h5>Dia
  158. <xsl:value-of select="dia"/>
  159. </h5>
  160. </tr>
  161. </xsl:template>
  162.  
  163. <xsl:template match="dataFim">
  164. <tr>
  165. <h5>Ano
  166. <xsl:value-of select="ano"/>
  167. </h5>
  168. <h5>Mes
  169. <xsl:value-of select="mes"/>
  170. </h5>
  171. <h5>Dia
  172. <xsl:value-of select="dia"/>
  173. </h5>
  174. </tr>
  175. </xsl:template>
  176.  
  177.  
  178. <xsl:template match="ocurrencias">
  179. <h5>Ocurencias Total
  180. <xsl:value-of select="ocurrenciasTotal"/>
  181. </h5>
  182. <h5>Ocurencias Penultimo Ano
  183. <xsl:value-of select="ocurrenciasPenultimoAno"/>
  184. </h5>
  185. <h5>Ocurencias Ultimo Ano
  186. <xsl:value-of select="ocurrenciasUltimoAno"/>
  187. </h5>
  188. </xsl:template>
  189.  
  190. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement