SQL Workbench/J Git Repository https://www.sql-workbench.eu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

79 lines
2.0 KiB

  1. <?xml version="1.0"?>
  2. <!--
  3. Title: RSS 2.0 XSL Template
  4. Author: Rich Manalang (http://manalang.com)
  5. Description: This sample XSLT will convert any valid RSS 2.0 feed to HTML.
  6. -->
  7. <xsl:stylesheet version="1.0"
  8. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:wfw="http://wellformedweb.org/CommentAPI/">
  10. <xsl:output method="html"/>
  11. <xsl:template match="/">
  12. <style>
  13. <xsl:comment>
  14. .syndication-content-area {
  15. }
  16. .syndication-title {
  17. font-size: 1.1em;
  18. font-weight: bold;
  19. }
  20. .syndication-description {
  21. font-size: .9em;
  22. margin: 0 0 10px 0;
  23. }
  24. .syndication-list {
  25. font-size: .8em;
  26. margin:0 0 0 20px;
  27. }
  28. .syndication-list-item {
  29. margin: 0 0 5px 0;
  30. }
  31. .syndication-list-item a,
  32. .syndication-list-item a:link {
  33. color: blue;
  34. }
  35. .syndication-list-item a:active,
  36. .syndication-list-item a:hover {
  37. color: red;
  38. }
  39. .syndication-list-item a:visited {
  40. color: black;
  41. text-decoration: none;
  42. }
  43. .syndication-list-item-date {
  44. font-size: .8em;
  45. }
  46. .syndication-list-item-description {
  47. font-size: .9em;
  48. }
  49. </xsl:comment>
  50. </style>
  51. <xsl:apply-templates select="/rss/channel"/>
  52. </xsl:template>
  53. <xsl:template match="/rss/channel">
  54. <div class="syndication-content-area">
  55. <div class="syndication-title">
  56. <xsl:value-of select="title"/>
  57. </div>
  58. <div class="syndication-description">
  59. <xsl:value-of select="description"/>
  60. </div>
  61. <ul class="syndication-list">
  62. <xsl:apply-templates select="item"/>
  63. </ul>
  64. </div>
  65. </xsl:template>
  66. <xsl:template match="/rss/channel/item">
  67. <li class="syndication-list-item">
  68. <a href="{link}" title="{description}">
  69. <xsl:value-of select="title"/>
  70. </a>
  71. <span class="syndication-list-item-date">
  72. (<xsl:value-of select="pubDate"/>)
  73. </span>
  74. <div class="syndication-list-item-description">
  75. <xsl:value-of select="description" disable-output-escaping="yes" />
  76. </div>
  77. </li>
  78. </xsl:template>
  79. </xsl:stylesheet>