Simple XSLT RSS Reader


/ Published in: XSLT
Save to your folder(s)

A simple RSS reader written in XSLT


Copy this code and paste it in your HTML
  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  4.  
  5. <xsl:template match="/">
  6. <html>
  7. <body>
  8. <h1><a href="{rss/channel/link}"><xsl:value-of select="rss/channel/title" /></a></h1>
  9. <p><xsl:value-of select="rss/channel/description" /></p>
  10. <ol>
  11. <xsl:for-each select="rss/channel/item">
  12. <li>
  13. <h1><a href="{link}"><xsl:value-of select="title" /></a></h1>
  14. <p><xsl:value-of select="description" /></p>
  15. </li>
  16. </xsl:for-each>
  17. </ol>
  18. </body>
  19. </html>
  20. </xsl:template>
  21.  
  22. </xsl:stylesheet>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.