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

50 lines
1.1KB

  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. <xsl:param name="link"/>
  5. <xsl:template match="/html">
  6. <xsl:element name="newsset">
  7. <xsl:element name="news">
  8. <xsl:attribute name="date">
  9. <xsl:value-of select="/html/@newsdate"/>
  10. </xsl:attribute>
  11. <xsl:if test="/html/@type">
  12. <xsl:attribute name ="type">
  13. <xsl:value-of select="/html/@type"/>
  14. </xsl:attribute>
  15. </xsl:if>
  16. <xsl:element name="title">
  17. <xsl:value-of select="/html/head/title"/>
  18. </xsl:element>
  19. <xsl:element name="body">
  20. <xsl:value-of select="/html/body/p[@newsteaser]"/>
  21. </xsl:element>
  22. <xsl:element name="link">
  23. <xsl:variable name="the_link">
  24. <xsl:value-of select="/html/@link"/>
  25. </xsl:variable>
  26. <xsl:choose>
  27. <xsl:when test="not(string($the_link))">
  28. <xsl:value-of select="$link"/>
  29. </xsl:when>
  30. <xsl:otherwise>
  31. <xsl:value-of select="$the_link"/>
  32. </xsl:otherwise>
  33. </xsl:choose>
  34. </xsl:element>
  35. </xsl:element>
  36. </xsl:element>
  37. </xsl:template>
  38. </xsl:stylesheet>