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.

press.xsl 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="xml" encoding="utf-8" indent="yes"/>
  4. <!-- $today = current date (given as <html date="...">) -->
  5. <xsl:variable name="today">
  6. <xsl:value-of select="/html/@date"/>
  7. </xsl:variable>
  8. <!-- Fill dynamic content -->
  9. <xsl:template match="dynamic-content">
  10. <xsl:element name="dl">
  11. <xsl:attribute name="id">press-releases</xsl:attribute>
  12. <!-- Show news except those in the future, but no newsletters -->
  13. <xsl:for-each select="/html/set/news[translate(@date,'-','')&lt;=translate($today,'-','') and not(@type='newsletter')]">
  14. <xsl:sort select="@date" order="descending" />
  15. <!-- A news entry -->
  16. <xsl:if test="position()&lt;4">
  17. <xsl:element name="dt">
  18. <xsl:value-of select="@date"/>
  19. </xsl:element>
  20. <xsl:element name="dd">
  21. <xsl:element name="a">
  22. <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  23. <xsl:value-of select="title"/>
  24. </xsl:element>
  25. </xsl:element>
  26. </xsl:if>
  27. </xsl:for-each>
  28. </xsl:element>
  29. </xsl:template>
  30. <!-- Do not copy <set> or <text> to output at all -->
  31. <xsl:template match="set | tags"/>
  32. <!-- For all other nodes, copy verbatim -->
  33. <xsl:template match="@*|node()" priority="-1">
  34. <xsl:copy>
  35. <xsl:apply-templates select="@*|node()"/>
  36. </xsl:copy>
  37. </xsl:template>
  38. </xsl:stylesheet>