broadcast2rss.xslt 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Turn broadcast xml into one rss item. Called by podcasts/*/app/rss.sh.
  4. Copyright (c) 2013-2021 Marcus Rohrmoser, https://mro.name/radio-privatkopie
  5. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
  6. associated documentation files (the "Software"), to deal in the Software without restriction,
  7. including without limitation the rights to use, copy, modify, merge, publish, distribute,
  8. sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in all copies or
  11. substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
  13. NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  14. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
  15. OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. MIT License http://opensource.org/licenses/MIT
  18. http://www.w3.org/TR/xslt/
  19. -->
  20. <xsl:stylesheet
  21. exclude-result-prefixes="rec"
  22. extension-element-prefixes="date"
  23. xmlns:atom="http://www.w3.org/2005/Atom"
  24. xmlns:date="http://exslt.org/date"
  25. xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  26. xmlns:rec="../../../../../assets/2013/radio-pi.rdf"
  27. xmlns:svg="http://www.w3.org/2000/svg"
  28. xmlns:xlink="http://www.w3.org/1999/xlink"
  29. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  30. version="1.0">
  31. <xsl:output
  32. indent="yes"
  33. method="xml"
  34. omit-xml-declaration="yes"
  35. />
  36. <xsl:template match="/">
  37. <xsl:for-each select="rec:broadcast">
  38. <xsl:variable name="id" select="rec:meta[@name='DC.identifier']/@content"/>
  39. <item>
  40. <title><xsl:value-of select="rec:meta[@name='DC.title']/@content"/></title>
  41. <link><xsl:value-of select="$baseurl"/>/stations/<xsl:value-of select="$id"/>.xml</link>
  42. <guid isPermaLink="true"><xsl:value-of select="$podcast"/>/<xsl:value-of select="$id"/></guid>
  43. <description><xsl:value-of select="rec:meta[@name='DC.description']/@content"/></description>
  44. <pubDate><xsl:value-of select="$pubDate"/></pubDate>
  45. <itunes:explicit>clean</itunes:explicit>
  46. <enclosure type="{$mimetype}" url="{$enclosure}?rss" length="{$filesize}"/>
  47. </item>
  48. </xsl:for-each>
  49. </xsl:template>
  50. </xsl:stylesheet>