Advertisement
moreiramota

Untitled

May 18th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="html"/>
  4. <xsl:template match="/casos">
  5. <html>
  6. <body>
  7. <h1> Clientes' Details</h1>
  8. <tr>
  9. <xsl:apply-templates select="cliente"/>
  10. </tr>
  11. </body>
  12. </html>
  13. </xsl:template>
  14. <xsl:template match="casos">
  15. <html>
  16. <head>
  17. <title>XML to HTML
  18. </title>
  19. </head>
  20. <body>
  21. <xsl:apply-templates select="cliente"/>
  22. </body>
  23. </html>
  24. </xsl:template>
  25.  
  26. <xsl:template match="cliente">
  27. <h3>CC:
  28. <xsl:apply-templates select="cc"/>
  29. </h3>
  30. <h5>Nome:
  31. <xsl:apply-templates select="nome"/>
  32. </h5>
  33. <h5>Contactos:
  34. <xsl:apply-templates select="contactos"/>
  35. </h5>
  36. <h5>Morada:
  37. <xsl:apply-templates select="morada"/>
  38. </h5>
  39. </xsl:template>
  40.  
  41. <xsl:template match="cc">
  42. <h6>Numero:
  43. <xsl:value-of select="numero"/>
  44. </h6>
  45. <h6>
  46. Data Fim:
  47. <xsl:value-of select="dataFim"/>
  48. </h6>
  49. </xsl:template>
  50.  
  51.  
  52.  
  53. <xsl:template match="nome">
  54. <h6>Primeiro:
  55. <xsl:value-of select="primeiro"/>
  56. </h6>
  57. <h6>
  58. Apelido:
  59. <xsl:value-of select="apelido"/>
  60. </h6>
  61. </xsl:template>
  62.  
  63.  
  64. <xsl:template match="contactos">
  65. <h6>Telefone:
  66. <xsl:value-of select="telefone"/>
  67. </h6>
  68. </xsl:template>
  69.  
  70.  
  71. <xsl:template match="morada">
  72. <tr bgcolor="#9acd32">
  73. <th>morada</th>
  74.  
  75. <h6>Rua:
  76. <xsl:value-of select="rua"/>
  77. </h6>
  78. <h6>
  79. Porta:
  80. <xsl:value-of select="porta"/>
  81. </h6>
  82. <h6>
  83. Localidade:
  84. <xsl:value-of select="localidade"/>
  85. </h6>
  86. <h6>
  87. Pais:
  88. <xsl:value-of select="pais"/>
  89. </h6>
  90. <h6>
  91. Codigo Postal:
  92. <xsl:value-of select="codigo_postal"/>
  93. </h6>
  94. </tr>
  95. </xsl:template>
  96. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement