Advertisement
Guest User

XSL

a guest
Jan 29th, 2023
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 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.  
  4. <xsl:template match="/">
  5. <html>
  6. <head>
  7. <link rel="stylesheet" href="style.css" type="text/css"/>
  8. </head>
  9. <body>
  10. <table border="1">
  11. <caption><h2>The best movies</h2></caption>
  12. <thead>
  13. <tr style="background-color: green">
  14. <th>Title</th>
  15. <th>Year</th>
  16. <th>Director</th>
  17. <th>Country</th>
  18. <th>Rating</th>
  19. <th>Photo</th>
  20. </tr>
  21. </thead>
  22.  
  23. <tbody>
  24. <xsl:for-each select="BestMovies/movie">
  25. <tr style="background-color: {@type}">
  26. <td><xsl:value-of select="title"/></td>
  27. <td><xsl:value-of select="year"/></td>
  28. <td><xsl:value-of select="filmDirector"/></td>
  29. <td><xsl:value-of select="country"/></td>
  30. <td><xsl:value-of select="filmweb_rating"/></td>
  31. <td><img src="{photo}" alt="brak zdjecia" width="100px" height="100px"/></td>
  32. </tr>
  33. </xsl:for-each>
  34. </tbody>
  35. </table>
  36.  
  37. </body>
  38. </html>
  39. </xsl:template>
  40. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement