Advertisement
pqpm

XSL - Vista Media

Dec 28th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:import href="user_vistaMedia.xsl"/>
  4. <xsl:output method="xhtml" version="1.0" encoding="UTF-8" indent="yes"/>
  5. <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
  6. <xsl:strip-space elements="*"/>
  7. <xsl:template match="/">
  8. <html xml:lang="pt">
  9. <head>
  10. <title>Pagina Utilizador - Vista Longa</title>
  11. <link rel="stylesheet" type="text/css" href="../CSS.css" charset="UTF-8"/>
  12. </head>
  13. <body>
  14. <div id="barra_de_navegacao">
  15. <a href="../main.xhtml" class="button1">Pagina Inicial</a>
  16. <a href="../listas/videos.html" class="button1">Vídeos</a>
  17. <a href="../listas/lista_videos.html" class="button1">Lista de videos</a>
  18. <a href="../listas/lista_users.html" class="button1">Lista de utilizadores</a>
  19. </div>
  20. <div class="display" id="user">
  21. <xsl:apply-templates select="//user[@userID = 'user001']"/>
  22. <!-- Para mudar utilizador, mudar aqui-->
  23. </div>
  24. </body>
  25. </html>
  26. </xsl:template>
  27. <xsl:template match="user">
  28. <xsl:apply-imports/>
  29. <div class="user_subscricoes">
  30. <h1>
  31. <xsl:value-of select="@userID"/>
  32. </h1>
  33. <h3>Subscrições</h3>
  34. <h3>Videos</h3>
  35. <ul>
  36. <!-- Comecando em user, precisamos subir na arvore, até á raiz para depois poder descer em direção aos subscritores-->
  37. <xsl:for-each select="root()//subscritor[@userID = '{@userID}']/*:video">
  38. <li>
  39. <a href="../videos/{@videoID}.xhtml" class="button2">
  40. <xsl:value-of select="root()//video[@videoID = '{videoID}']/nome"/>
  41. </a>
  42. </li>
  43. </xsl:for-each>
  44. </ul>
  45. </div>
  46. <div id="user_comentarios">
  47. <!---->
  48. <h1>
  49. <xsl:value-of select="@userID"/>
  50. </h1>
  51. <!---->
  52. <h3>Comentários</h3>
  53. <ul>
  54. <xsl:for-each select="root()//comentario[de[@userID='{@userID}']]">
  55. <li>
  56. <div class="button2">
  57. <a href="../Vídeos/socialtube-vid001.xhtml"> <xsl:value-of select="/texto"/></a>
  58. </div>
  59. </li>
  60. </xsl:for-each>
  61. </ul>
  62. </div>
  63. </xsl:template>
  64. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement