Advertisement
moreiramota

Untitled

May 19th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 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. <h1> Clientes' Name and Objetcts</h1>
  16. <tr>
  17. <xsl:apply-templates select="cliente"/>
  18. </tr>
  19. </body>
  20. </html>
  21. </xsl:template>
  22. <xsl:template match="casos">
  23. <html>
  24. <head>
  25. <title>XML to HTML
  26. </title>
  27. </head>
  28. <body>
  29. <xsl:apply-templates select="cliente"/>
  30. </body>
  31. </html>
  32. </xsl:template>
  33.  
  34. <xsl:template match="cliente">
  35. <h5>Nome:
  36. <xsl:apply-templates select="nome"/>
  37. </h5>
  38. <h5>Objetos
  39. <xsl:apply-templates select="objetos"/>
  40. </h5>
  41. </xsl:template>
  42.  
  43. <xsl:template match="objetos">
  44. <h6>Objecto
  45. <xsl:apply-templates select="objecto"/>
  46. </h6>
  47. </xsl:template>
  48.  
  49.  
  50.  
  51. <xsl:template match="objecto">
  52. <h6>
  53. Nome Objeto
  54. <xsl:value-of select="nomeObjeto"/>
  55. </h6>
  56. <h6>
  57. Morada Objeto
  58. <xsl:apply-templates select="morada"/>
  59. </h6>
  60. <h6>
  61. Coberturas Objeto
  62. <xsl:apply-templates select="coberturas"/>
  63. </h6>
  64. <h6>
  65. Valor Premio Objeto
  66. <xsl:value-of select="valorPremio"/>
  67. </h6>
  68. <h6>
  69. Vigencia Objeto
  70. <xsl:apply-templates select="vigencia"/>
  71. </h6>
  72. <h6>
  73. Ocurencias Objeto
  74. <xsl:apply-templates select="ocurrencias"/>
  75. </h6>
  76. </xsl:template>
  77.  
  78.  
  79. <xsl:template match="coberturas">
  80. <h6>Nome Cobertura
  81. <xsl:value-of select="cobertura"/>
  82. </h6>
  83. <h6>Descricao
  84. <xsl:value-of select="descricao"/>
  85. </h6>
  86. </xsl:template>
  87.  
  88.  
  89. <xsl:template match="morada">
  90. <tr bgcolor="#9acd32">
  91. <th>morada</th>
  92.  
  93. <h6>Rua:
  94. <xsl:value-of select="rua"/>
  95. </h6>
  96. <h6>
  97. Porta:
  98. <xsl:value-of select="porta"/>
  99. </h6>
  100. <h6>
  101. Localidade:
  102. <xsl:value-of select="localidade"/>
  103. </h6>
  104. <h6>
  105. Pais:
  106. <xsl:value-of select="pais"/>
  107. </h6>
  108. <h6>
  109. Codigo Postal:
  110. <xsl:value-of select="codigo_postal"/>
  111. </h6>
  112. </tr>
  113. </xsl:template>
  114.  
  115. <xsl:template match="vigencia">
  116. <h5>Data inicio
  117. <xsl:value-of select="dataInicio"/>
  118. </h5>
  119. <h5>Data fim
  120. <xsl:value-of select="dataFim"/>
  121. </h5>
  122. </xsl:template>
  123.  
  124.  
  125. <xsl:template match="ocurrencias">
  126. <h5>Ocurencias Total
  127. <xsl:value-of select="ocurrenciasTotal"/>
  128. </h5>
  129. <h5>Ocurencias Penultimo Ano
  130. <xsl:value-of select="ocurrenciasPenultimoAno"/>
  131. </h5>
  132. <h5>Ocurencias Ultimo Ano
  133. <xsl:value-of select="ocurrenciasUltimoAno"/>
  134. </h5>
  135. </xsl:template>
  136.  
  137. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement