šablona/rss.xsl
author František Kučera <franta-hg@frantovo.cz>
Sat Jan 07 01:57:27 2012 +0100 (2012-01-07)
changeset 57 768a7eecb0cf
parent 9 71275159d985
child 61 9503eb8377f1
permissions -rw-r--r--
odkaz #16 na RFCčko musí být číselný
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <xsl:stylesheet version="2.0"
     3 	xmlns:a="http://www.w3.org/2005/Atom"
     4 	xmlns:atom="http://www.w3.org/2005/Atom"
     5 	xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
     6 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     7 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
     8 	exclude-result-prefixes="fn j a">
     9 	<xsl:output	method="xml" indent="yes" encoding="UTF-8"/>
    10 	
    11 	<xsl:template match="/">		
    12 		<rss version="2.0">
    13 			<channel>
    14 				<xsl:variable name="url" select="a:feed/a:link[not(@rel)]/@href"/>
    15 				<title><xsl:value-of select="a:feed/a:title"/></title>
    16 				<link><xsl:value-of select="$url"/></link>
    17 				<description><xsl:value-of select="a:feed/a:subtitle"/></description>				
    18 				<atom:link rel="self" href="{$url}rss.xml"/>
    19 				<xsl:apply-templates select="a:feed/a:entry"/>
    20 			</channel>
    21 		</rss>		
    22 	</xsl:template>
    23 	
    24 	<xsl:template match="a:entry">
    25 		<item>		
    26 			<title><xsl:value-of select="a:title"/></title>
    27 			<link><xsl:value-of select="a:link/@href"/></link>
    28 			<description><xsl:value-of select="a:summary"/></description>
    29 			<guid><xsl:value-of select="a:id"/></guid>
    30 			<pubDate><xsl:value-of select="format-dateTime(a:updated,
    31                 '[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] [Z]',
    32                 'en',
    33                 'ISO',
    34                 'US')"/></pubDate>		
    35 		</item>
    36 	</xsl:template>
    37 	
    38 </xsl:stylesheet>