Advertisement
moreiramota

Untitled

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