comparison xslt/news.xslt @ 170:cd2698ea00ab

Added generated XSLTs.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 02 Nov 2011 19:31:11 +0000
parents
children 1507ec5ba69a
comparison
equal deleted inserted replaced
169:b7b160e4e046 170:cd2698ea00ab
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4 <xsl:output indent="no" version="4.0" encoding="utf-8" method="html"/>
5
6 <xsl:strip-space elements="*"/>
7
8 <xsl:param select="'../xml'" name="XML"/>
9
10 <xsl:param name="YEAR"/>
11
12 <xsl:variable select="'http://nginx.org'" name="SITE"/>
13
14 <xsl:variable select="/news/@link" name="LINK"/>
15
16 <xsl:include href="dirname.xslt"/>
17
18 <xsl:include href="link.xslt"/>
19
20 <xsl:include href="style.xslt"/>
21
22 <xsl:include href="body.xslt"/>
23
24 <xsl:include href="menu.xslt"/>
25
26 <xsl:include href="content.xslt"/>
27
28 <xsl:template match="/news">
29
30 <html>
31 <head>
32
33 <link rel="alternate" type="application/rss+xml" title="{@name}" href="{$SITE}/index.rss"/>
34
35 <title>
36 <xsl:value-of select="@name"/>
37 <xsl:if test="$YEAR">
38 <xsl:text>: </xsl:text>
39 <xsl:value-of select="$YEAR"/>
40 </xsl:if>
41 </title>
42
43 <xsl:call-template name="style">
44 <xsl:with-param select="@lang" name="lang"/>
45 </xsl:call-template>
46
47 </head>
48
49 <xsl:call-template name="body">
50 <xsl:with-param select="@lang" name="lang"/>
51 </xsl:call-template>
52
53 </html>
54 </xsl:template>
55
56 <xsl:template match="event">
57
58 <xsl:variable name="year">
59 <xsl:value-of select="substring(../event[position()=1]/@date, 1, 4)"/>
60 </xsl:variable>
61
62 <xsl:variable name="y">
63 <xsl:value-of select="substring(@date, 1, 4)"/>
64 </xsl:variable>
65
66 <xsl:if test="position() = 1">
67
68 <xsl:text disable-output-escaping="yes">
69 &lt;table class="news"&gt;
70 </xsl:text>
71 </xsl:if>
72
73 <xsl:if test="(not($YEAR) and ($year = $y or position() &lt; 11)) or $YEAR=$y">
74
75 <tr>
76
77 <td class="date">
78
79 <a name="{@date}"/>
80 <xsl:value-of select="@date"/>
81
82 </td>
83
84 <td>
85 <xsl:apply-templates select="para"/>
86 </td>
87
88 </tr>
89 </xsl:if>
90
91 <xsl:if test="position() = last()">
92
93 <xsl:text disable-output-escaping="yes">
94 &lt;/table&gt;
95 </xsl:text>
96 </xsl:if>
97 </xsl:template>
98
99 </xsl:stylesheet>