view myrss/step1.xsl @ 19:fce61e65e3ae

myrss_update.sh: simplify printing *.feedtmp
author paulo@thepaulopc
date Wed, 10 Nov 2010 22:30:04 -0800
parents 4d7f45e51e8e
children e92b8e5b8fd7
line source
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:a="http://www.w3.org/2005/Atom"
5 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6 xmlns:r1="http://purl.org/rss/1.0/"
7 xmlns="http://www.pauloang.com/">
9 <!-- Atom -->
10 <xsl:template match="/a:feed">
11 <site>
12 <title><xsl:value-of select="a:title"/></title>
13 <link><xsl:value-of select="a:link[@rel='alternate']/@href"/></link>
14 <xsl:for-each select="a:entry">
15 <headline>
16 <title><xsl:value-of select="a:title"/></title>
17 <link><xsl:value-of select="a:link[@rel='alternate']/@href"/></link>
18 </headline>
19 </xsl:for-each>
20 </site>
21 </xsl:template>
23 <!-- RSS -->
24 <xsl:template match="rss/channel">
25 <site>
26 <title><xsl:value-of select="title"/></title>
27 <link><xsl:value-of select="link"/></link>
28 <xsl:for-each select="item">
29 <headline>
30 <title><xsl:value-of select="title"/></title>
31 <link><xsl:value-of select="link"/></link>
32 </headline>
33 </xsl:for-each>
34 </site>
35 </xsl:template>
37 <!-- RDF -->
38 <xsl:template match="rdf:RDF">
39 <site>
40 <title><xsl:value-of select="r1:channel/r1:title"/></title>
41 <link><xsl:value-of select="r1:channel/r1:link"/></link>
42 <xsl:for-each select="r1:item">
43 <headline>
44 <title><xsl:value-of select="r1:title"/></title>
45 <link><xsl:value-of select="r1:link"/></link>
46 </headline>
47 </xsl:for-each>
48 </site>
49 </xsl:template>
51 </xsl:stylesheet>