rss.xsl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="html" version="5" encoding="UTF-8" indent="yes" />
  4. <xsl:template match="rss">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <title><xsl:value-of select="channel/title" />RSS Feed</title>
  8. <meta charset="UTF-8" />
  9. <meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1" />
  10. <meta name="viewport" content="width=device-width,initial-scale=1" />
  11. </head>
  12. <body>
  13. <header>
  14. <h2>
  15. <xsl:value-of select="channel/description" />
  16. </h2>
  17. </header>
  18. <hr />
  19. <main>
  20. <xsl:for-each select="channel/item">
  21. <article>
  22. <h3>
  23. <a hreflang="en" target="_blank">
  24. <xsl:attribute name="href">
  25. <xsl:value-of select="link" />
  26. </xsl:attribute>
  27. <xsl:value-of select="title" />
  28. </a>
  29. </h3>
  30. <time><xsl:value-of select="pubDate" /></time>
  31. <p><xsl:value-of select="description" /></p>
  32. <hr />
  33. </article>
  34. </xsl:for-each>
  35. </main>
  36. </body>
  37. </html>
  38. </xsl:template>
  39. </xsl:stylesheet>