Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/ https://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.

events.rss.xsl 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!-- XSL stylesheet for generating RSS feeds. We use RSS 0.91 for now -->
  3. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  4. <xsl:import href="../tools/xsltsl/events-utils.xsl" />
  5. <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="yes"
  6. indent="yes" />
  7. <!-- $today = current date (given as <html date="...">) -->
  8. <xsl:variable name="today">
  9. <xsl:value-of select="/buildinfo/@date" />
  10. </xsl:variable>
  11. <!-- ============ -->
  12. <!-- Main routine -->
  13. <!-- ============ -->
  14. <xsl:template match="/buildinfo">
  15. <xsl:apply-templates select="document" />
  16. </xsl:template>
  17. <xsl:template match="/buildinfo/document">
  18. <!-- Language -->
  19. <xsl:variable name="lang">
  20. <xsl:value-of select="@language" />
  21. </xsl:variable>
  22. <!-- Header -->
  23. <rss version="0.91">
  24. <channel>
  25. <title>FSFE Events</title>
  26. <description>Free Software Events</description>
  27. <link>http://fsfe.org/events/</link>
  28. <language><xsl:value-of select="$lang" /></language>
  29. <copyright>Copyright (c) Free Software Foundation Europe. Verbatim copying and distribution
  30. of this entire article is permitted in any medium, provided this
  31. notice is preserved.</copyright>
  32. <managingEditor>press@fsfe.org (FSFE Press Team)</managingEditor>
  33. <webMaster>web@lists.fsfe.org (FSFE Webmaster Team)</webMaster>
  34. <image>
  35. <url>http://fsfe.org/events/fsfe-events.png</url>
  36. <title>FSFE Events</title>
  37. <width>88</width>
  38. <height>31</height>
  39. <link>http://fsfe.org/events/</link>
  40. </image>
  41. <!-- Event items -->
  42. <xsl:for-each select="/buildinfo/document/set/event
  43. [translate (@end, '-', '') &gt;= translate ($today, '-', '')]">
  44. <xsl:sort select="@start" />
  45. <xsl:if test="position() &lt; 11">
  46. <xsl:variable name="start"><xsl:value-of select="@start" /></xsl:variable>
  47. <xsl:variable name="end"><xsl:value-of select="@end" /></xsl:variable>
  48. <item>
  49. <!-- <guid> (is also a permalink to the event page, with anchor -->
  50. <xsl:element name="guid">
  51. <xsl:text>http://fsfe.org/events/events.html#</xsl:text>
  52. <xsl:value-of select="@filename"/>
  53. </xsl:element>
  54. <!-- Title -->
  55. <xsl:element name="title">
  56. <xsl:value-of select="title"/>
  57. <xsl:text> (</xsl:text>
  58. <xsl:value-of select="@start"/>
  59. <xsl:if test="$start != $end">
  60. <xsl:text> - </xsl:text>
  61. <xsl:value-of select="@end"/>
  62. </xsl:if>
  63. <xsl:text>)</xsl:text>
  64. </xsl:element>
  65. <!-- News body -->
  66. <xsl:element name="description">
  67. <xsl:value-of select="normalize-space(body)"/>
  68. </xsl:element>
  69. <!-- Link -->
  70. <xsl:element name="link">
  71. <xsl:call-template name="event-link">
  72. <xsl:with-param name="absolute-fsfe-links" select="'yes'" />
  73. </xsl:call-template>
  74. </xsl:element>
  75. </item>
  76. </xsl:if>
  77. </xsl:for-each>
  78. <!-- Footer -->
  79. </channel>
  80. </rss>
  81. </xsl:template>
  82. </xsl:stylesheet>