forked from NixOS/nixos-homepage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
news.xsl
41 lines (30 loc) · 1.19 KB
/
news.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:sets="http://exslt.org/sets"
xmlns:exsl="http://exslt.org/common"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="exsl sets str"
exclude-result-prefixes="xhtml"
>
<xsl:output method='xml' encoding="UTF-8" omit-xml-declaration="yes" />
<xsl:param name="maxItem" />
<xsl:template match="news">
<table class="news">
<xsl:for-each select="item[position() <= $maxItem]">
<tr class="news-header">
<td class="news-short">
<xsl:apply-templates select="title/child::node()" mode="id"/>
</td>
<td class="news-date"><xsl:value-of select="year" />/<xsl:value-of select="month" />/<xsl:value-of select="day" /></td>
</tr>
<tr class="news-descr">
<td colspan="2">
<xsl:copy-of select="description/child::node()" />
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>