comparison xsls/rss.xsls @ 0:61e04fc01027

Initial import of the nginx.org website.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 11 Aug 2011 12:19:13 +0000
parents
children 0bf5b5e45501
comparison
equal deleted inserted replaced
-1:000000000000 0:61e04fc01027
1 X:stylesheet
2 xmlns:date="http://exslt.org/dates-and-times"
3 {
4
5 X:output indent="no" encoding="utf-8";
6
7 X:strip-space elements = "*";
8
9 <!--
10 -- a current directory of a XSLT script is where the script is stored,
11 -- but not where XSLT processor has been started to run the script
12 -->
13 X:param XML = "'../xml'";
14 X:param YEAR;
15
16 X:var SITE = "'http://nginx.org'";
17 X:var LINK = "/news/@link";
18
19 X:include href = "dirname.xslt";
20 X:include href = "link.xslt";
21 X:include href = "menu.xslt";
22 X:include href = "content.xslt";
23
24
25 X:template = "/news" {
26 <rss version="2.0">
27 <channel>
28 <title> !{@title} </title>
29 <link> !{$SITE} </link>
30 <description />
31 !! "event";
32 </channel>
33 </rss>
34 }
35
36
37 X:template = "event[position() &lt;= 10]" {
38
39 X:var year = { !{substring(../event[position()=1]/@date, 1, 4)} }
40 X:var y = { !{substring(@date, 1, 4)} }
41
42 X:var page = {
43 X:if "$year != $y" {
44 !{concat($y, '.html')}
45 }
46 }
47
48 <item>
49 <title>!{@date}</title>
50 <guid> !{$SITE} X:text {/} !{$page} X:text {#} !{@date} </guid>
51 <link> !{$SITE} X:text {/} !{$page} X:text {#} !{@date} </link>
52 <pubdate>
53 !{ concat(date:day-abbreviation(@date), ', ',
54 format-number(date:day-in-month(@date), '00'), ' ',
55 date:month-abbreviation(@date), ' ',
56 date:year(@date),
57 ' 00:00:00 +0300') }
58 </pubdate>
59
60 <description>
61 X:text disable-output-escaping="yes" {&lt;![CDATA[}
62 !! "para";
63 X:text disable-output-escaping="yes" {]]&gt;}
64 </description>
65 </item>
66 }
67
68
69 X:template = "event" { }
70
71
72 }