comparison xslt/news.xslt @ 1085:c454373427ef

Regenerated.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 28 Feb 2014 20:12:47 +0400
parents b133b1f44765
children fdf1464e1977
comparison
equal deleted inserted replaced
1084:be1d72ba7e5f 1085:c454373427ef
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 Copyright (C) Igor Sysoev
4 Copyright (C) Nginx, Inc.
5 -->
6
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 7 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3 8
4 <xsl:output indent="no" version="4.0" encoding="utf-8" method="html"/> 9 <xsl:output method="html" version="4.0" indent="no" encoding="utf-8"/>
5 10
6 <xsl:strip-space elements="*"/> 11 <xsl:strip-space elements="*"/>
7 12
8 <xsl:param select="'../xml'" name="XML"/> 13 <!--
14 .. a current directory of a XSLT script is where the script is stored,
15 .. but not where XSLT processor has been started to run the script
16 -->
17 <xsl:param select="'../xml'" name="XML"/>
18 <xsl:param name="YEAR"/>
19 <xsl:param name="ORIGIN"/>
20 <xsl:param name="TRANS"/>
9 21
10 <xsl:param name="YEAR"/> 22 <xsl:variable select="'http://nginx.org'" name="SITE"/>
23 <xsl:variable select="/news/@link" name="LINK"/>
24 <xsl:variable select="/news/@lang" name="LANG"/>
11 25
12 <xsl:param name="ORIGIN"/> 26 <xsl:include href="dirname.xslt"/>
27 <xsl:include href="link.xslt"/>
28 <xsl:include href="style.xslt"/>
29 <xsl:include href="body.xslt"/>
30 <xsl:include href="menu.xslt"/>
31 <xsl:include href="ga.xslt"/>
32 <xsl:include href="content.xslt"/>
13 33
14 <xsl:param name="TRANS"/>
15 34
16 <xsl:variable select="'http://nginx.org'" name="SITE"/> 35 <xsl:template match="/news">
36 <html><head>
17 37
18 <xsl:variable select="/news/@link" name="LINK"/> 38 <link rel="alternate" type="application/rss+xml" title="{@name}" href="{$SITE}/index.rss"/>
19 39
20 <xsl:variable select="/news/@lang" name="LANG"/> 40 <title> <xsl:value-of select="@name"/> <xsl:if test="$YEAR"> <xsl:text>: </xsl:text> <xsl:value-of select="$YEAR"/> </xsl:if> </title>
21 41
22 <xsl:include href="dirname.xslt"/> 42 <xsl:call-template name="style"><xsl:with-param select="@lang" name="lang"/></xsl:call-template><xsl:call-template name="ga"/></head>
23 43
24 <xsl:include href="link.xslt"/> 44 <xsl:call-template name="body"><xsl:with-param select="@lang" name="lang"/></xsl:call-template></html>
45 </xsl:template>
25 46
26 <xsl:include href="style.xslt"/>
27 47
28 <xsl:include href="body.xslt"/> 48 <xsl:template match="event">
29 49
30 <xsl:include href="menu.xslt"/> 50 <xsl:variable name="year"> <xsl:value-of select="substring(../event[position()=1]/@date, 1, 4)"/> </xsl:variable>
51 <xsl:variable name="y"> <xsl:value-of select="substring(@date, 1, 4)"/> </xsl:variable>
31 52
32 <xsl:include href="ga.xslt"/> 53 <xsl:if test="position() = 1">
33 54 <xsl:text disable-output-escaping="yes">
34 <xsl:include href="content.xslt"/>
35
36 <xsl:template match="/news">
37
38 <html>
39 <head>
40
41 <link rel="alternate" type="application/rss+xml" title="{@name}" href="{$SITE}/index.rss"/>
42
43 <title>
44 <xsl:value-of select="@name"/>
45 <xsl:if test="$YEAR">
46 <xsl:text>: </xsl:text>
47 <xsl:value-of select="$YEAR"/>
48 </xsl:if>
49 </title>
50
51 <xsl:call-template name="style">
52 <xsl:with-param select="@lang" name="lang"/>
53 </xsl:call-template>
54
55 <xsl:call-template name="ga"/>
56
57 </head>
58
59 <xsl:call-template name="body">
60 <xsl:with-param select="@lang" name="lang"/>
61 </xsl:call-template>
62
63 </html>
64 </xsl:template>
65
66 <xsl:template match="event">
67
68 <xsl:variable name="year">
69 <xsl:value-of select="substring(../event[position()=1]/@date, 1, 4)"/>
70 </xsl:variable>
71
72 <xsl:variable name="y">
73 <xsl:value-of select="substring(@date, 1, 4)"/>
74 </xsl:variable>
75
76 <xsl:if test="position() = 1">
77
78 <xsl:text disable-output-escaping="yes">
79 &lt;table class="news"&gt; 55 &lt;table class="news"&gt;
80 </xsl:text> 56 </xsl:text>
81 </xsl:if> 57 </xsl:if>
82 58
83 <xsl:if test="(not($YEAR) and ($year = $y or position() &lt; 11)) or $YEAR=$y"> 59 <xsl:if test="(not($YEAR) and ($year = $y or position() &lt; 11)) or $YEAR=$y">
60 <tr>
61 <td class="date">
62 <a name="{@date}"/> <xsl:value-of select="@date"/>
63 </td>
64 <td> <xsl:apply-templates select="para"/> </td>
65 </tr>
66 </xsl:if>
84 67
85 <tr> 68 <xsl:if test="position() = last()">
86 69 <xsl:text disable-output-escaping="yes">
87 <td class="date">
88
89 <a name="{@date}"/>
90 <xsl:value-of select="@date"/>
91
92 </td>
93
94 <td>
95 <xsl:apply-templates select="para"/>
96 </td>
97
98 </tr>
99 </xsl:if>
100
101 <xsl:if test="position() = last()">
102
103 <xsl:text disable-output-escaping="yes">
104 &lt;/table&gt; 70 &lt;/table&gt;
105 </xsl:text> 71 </xsl:text>
106 </xsl:if> 72 </xsl:if>
107 </xsl:template> 73 </xsl:template>
74
108 75
109 </xsl:stylesheet> 76 </xsl:stylesheet>