Mercurial > hg > nginx-site
comparison xsls/news.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 | c007b57d617c |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:61e04fc01027 |
---|---|
1 X:stylesheet { | |
2 | |
3 X:output method="html" indent="no" encoding="utf-8"; | |
4 | |
5 X:strip-space elements = "*"; | |
6 | |
7 <!-- | |
8 -- a current directory of a XSLT script is where the script is stored, | |
9 -- but not where XSLT processor has been started to run the script | |
10 --> | |
11 X:param XML = "'../xml'"; | |
12 X:param YEAR; | |
13 | |
14 X:var SITE = "'http://nginx.org'"; | |
15 X:var LINK = "/news/@link"; | |
16 | |
17 X:include href = "dirname.xslt"; | |
18 X:include href = "link.xslt"; | |
19 X:include href = "style.xslt"; | |
20 X:include href = "body.xslt"; | |
21 X:include href = "menu.xslt"; | |
22 X:include href = "content.xslt"; | |
23 | |
24 | |
25 X:template = "/news" { | |
26 <html><head> | |
27 | |
28 <link rel="alternate" type="application/rss+xml" | |
29 title="{@title}" href="{$SITE}/index.rss" /> | |
30 | |
31 <title> !{@title} X:if "$YEAR" { X:text{: } !{$YEAR} } </title> | |
32 | |
33 !style () | |
34 | |
35 </head> | |
36 | |
37 !body (lang="/news/@lang") | |
38 | |
39 </html> | |
40 } | |
41 | |
42 | |
43 X:template = "event" { | |
44 | |
45 X:var year = { !{substring(../event[position()=1]/@date, 1, 4)} } | |
46 X:var y = { !{substring(@date, 1, 4)} } | |
47 | |
48 X:if "(not($YEAR) and ($year = $y or position() < 11)) or $YEAR=$y" { | |
49 <table width="100%"> | |
50 | |
51 <tr> | |
52 <td valign="top" align="right" width="15%"> | |
53 <a name="{@date}" /> !{@date} X:text {  } | |
54 </td> | |
55 <td> !! "para"; </td> | |
56 </tr> | |
57 | |
58 <tr><td colspan="2"> | |
59 X:text disable-output-escaping="yes" {&nbsp;} | |
60 </td></tr> | |
61 | |
62 </table> | |
63 } | |
64 } | |
65 | |
66 | |
67 X:template = "event/para" { <p class="noindent"> !!; </p> } | |
68 | |
69 | |
70 } |