broadcast2atom.xslt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Turn broadcast xml into one atom entry. Called by podcasts/*/app/atom.sh.
  4. Copyright (c) 2021-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="http://www.w3.org/2005/Atom"
  24. xmlns:date="http://exslt.org/date"
  25. xmlns:rec="../../../../../assets/2013/radio-pi.rdf"
  26. xmlns:svg="http://www.w3.org/2000/svg"
  27. xmlns:xlink="http://www.w3.org/1999/xlink"
  28. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  29. version="1.0">
  30. <xsl:output
  31. indent="yes"
  32. method="xml"
  33. omit-xml-declaration="yes"
  34. />
  35. <xsl:template match="/">
  36. <xsl:for-each select="rec:broadcast">
  37. <xsl:variable name="id" select="rec:meta[@name='DC.identifier']/@content"/>
  38. <entry>
  39. <title><xsl:value-of select="rec:meta[@name='DC.title']/@content"/></title>
  40. <id><xsl:value-of select="$podcast"/>/<xsl:value-of select="$id"/></id>
  41. <updated><xsl:value-of select="$updated"/></updated>
  42. <content><xsl:value-of select="rec:meta[@name='DC.description']/@content"/></content>
  43. <link rel="enclosure" length="{$filesize}" href="{$baseurl}/enclosures/{$id}.mp3?atom" type="audio/mpeg"/>
  44. </entry>
  45. </xsl:for-each>
  46. </xsl:template>
  47. </xsl:stylesheet>