Advertisement
moreiramota

Untitled

May 18th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3. <xsl:output encoding="UTF-8"/>
  4.  
  5. <!-- TODO customize transformation rules
  6. syntax recommendation http://www.w3.org/TR/xslt
  7. -->
  8. <xsl:template match="/">
  9. <xsl:apply-templates select= "casos/cliente"/>
  10. </xsl:template>
  11.  
  12.  
  13. <xsl:template match="casos/cliente">
  14. CC:
  15. <xsl:apply-templates select="cc"/>
  16. Nome:
  17. <xsl:apply-templates select="nome"/>
  18. Contactos:
  19. <xsl:apply-templates select="contactos"/>
  20. Morada:
  21. <xsl:apply-templates select="morada"/>
  22. </xsl:template>
  23.  
  24.  
  25. <xsl:template match="cc">
  26. Cartao cidadao:
  27. numero: <xsl:value-of select= "numero"/>
  28. data Fim:<xsl:value-of select= "dataFim"/>
  29. <xsl:text>&#xa;</xsl:text>
  30. </xsl:template>
  31.  
  32. <xsl:template match="nome">
  33. Primeiro:
  34. <xsl:value-of select="primeiro"/>
  35. Apelido:
  36. <xsl:value-of select="apelido"/>
  37. <xsl:text>&#xa;</xsl:text>
  38. </xsl:template>
  39.  
  40. <xsl:template match="contactos">
  41. Telefone:
  42. <xsl:value-of select="telefone"/>
  43. <xsl:text>&#xa;</xsl:text>
  44. </xsl:template>
  45.  
  46.  
  47. <xsl:template match="morada">
  48. Rua:
  49. <xsl:value-of select="rua"/>
  50. Porta:
  51. <xsl:value-of select="porta"/>
  52. Localidade:
  53. <xsl:value-of select="localidade"/>
  54. Pais:
  55. <xsl:value-of select="pais"/>
  56. Codigo Postal:
  57. <xsl:value-of select="codigo_postal"/>
  58. <xsl:text>&#xa;</xsl:text>
  59. </xsl:template>
  60.  
  61. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement