-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathparse_enclosure.xsl
31 lines (25 loc) · 1.25 KB
/
parse_enclosure.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?xml version="1.0" encoding="utf-8"?>
<xsl:transform version="1.0"
xmlns:npr="http://www.npr.org/rss/"
xmlns:nprml="http://api.npr.org/nprml"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:a="http://www.w3.org/2005/Atom"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:strip-space elements="*"/>
<xsl:output method="text"/>
<!-- <xsl:template match="/rss"> -->
<!-- <xsl:apply-templates/> -->
<!-- </xsl:template> -->
<xsl:template match="text()|@*" />
<xsl:template match="channel">
<xsl:apply-templates />
</xsl:template>
<!-- <xsl:template match="/rss/channel/item"> -->
<!-- <xsl:apply-templates/> -->
<!-- </xsl:template> -->
<xsl:template match="/rss/channel/item">"<xsl:value-of select="enclosure[contains(@type,'audio')]/@url[1]" />" "<xsl:value-of select="../title[1]" />" "<xsl:value-of select="title[1]" />" "<xsl:value-of select="../image[1]/url[1]" />" "<xsl:value-of select="pubDate[1]" />" "<xsl:value-of select="itunes:episode[1]" />"
</xsl:template>
</xsl:transform>