The FSFE planet, a blog aggregator of posts from our community https://planet.fsfe.org
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.

opml.xml.xslt 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  2. xmlns:atom="http://www.w3.org/2005/Atom"
  3. xmlns:planet="http://planet.intertwingly.net/"
  4. exclude-result-prefixes="atom planet">
  5. <xsl:output indent="yes" method="xml"/>
  6. <xsl:template name="rfc822" xmlns:date="http://exslt.org/dates-and-times">
  7. <xsl:param name="date"/>
  8. <!-- http://www.trachtenberg.com/blog/2005/03/03/xslt-cookbook-generating-an-rfc-822-date/ -->
  9. <xsl:value-of select="concat(date:day-abbreviation($date), ', ',
  10. format-number(date:day-in-month($date), '00'), ' ',
  11. date:month-abbreviation($date), ' ', date:year($date), ' ',
  12. format-number(date:hour-in-day($date), '00'), ':',
  13. format-number(date:minute-in-hour($date), '00'), ':',
  14. format-number(date:second-in-minute($date), '00'), ' GMT')"/>
  15. </xsl:template>
  16. <xsl:template match="atom:feed">
  17. <opml version="1.1">
  18. <head>
  19. <title><xsl:value-of select="atom:title"/></title>
  20. <dateModified>
  21. <xsl:call-template name="rfc822">
  22. <xsl:with-param name="date" select="atom:updated"/>
  23. </xsl:call-template>
  24. </dateModified>
  25. <ownerName><xsl:value-of select="atom:author/atom:name"/></ownerName>
  26. <ownerEmail><xsl:value-of select="atom:author/atom:email"/></ownerEmail>
  27. </head>
  28. <body>
  29. <xsl:for-each select="planet:source">
  30. <outline type="rss" text="{planet:name}" title="{atom:title}"
  31. xmlUrl="{atom:link[@rel='self']/@href}"/>
  32. </xsl:for-each>
  33. </body>
  34. </opml>
  35. </xsl:template>
  36. </xsl:stylesheet>