blob: 4972bb87d5090799603695c8476cd95e2eaa3f5c (
plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns="http://www.w3.org/2005/Atom"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output
method="xml"
omit-xml-declaration="no"
encoding="UTF-8"
indent="no"
/>
<xsl:include href="[utility/xhtml.xsl]"/>
<xsl:variable name="meta">
<datasource type="main" mode="full" source="01_data/articles.xml" target="articles"/>
<datasource type="support" mode="full" source="02_meta/meta.xml" target="meta"/>
<target mode="plain" value="atom.xml"/>
</xsl:variable>
<xsl:variable name="url" select="datasource/meta/url"/>
<xsl:variable name="author" select="datasource/meta/author"/>
<xsl:template match="datasource">
<feed>
<link href="{$url}/atom.xml" rel="self" title="/home/adrian" type="application/atom+xml"/>
<link href="{$url}" rel="alternate" title="Start @ /home/adrian" type="text/xhtml"/>
<id>
<xsl:value-of select="concat($url, '/')"/>
</id>
<title>
<xsl:value-of select="meta/title"/>
</title>
<author>
<name>
<xsl:value-of select="$author"/>
</name>
</author>
<updated>
<xsl:value-of select="articles/entry[1]/date/full"/>
<xsl:text>T00:00:01+02:00</xsl:text>
</updated>
<xsl:apply-templates select="articles/entry[position() <= 5]"/>
</feed>
</xsl:template>
<xsl:template match="articles/entry">
<entry xmlns="http://www.w3.org/2005/Atom">
<link rel="alternate" title="{title}">
<xsl:attribute name="href">
<xsl:value-of select="$url"/>
<xsl:text>/article/</xsl:text>
<xsl:value-of select="@handle"/>
</xsl:attribute>
</link>
<id>
<xsl:value-of select="$url"/>
<xsl:text>/article/</xsl:text>
<xsl:value-of select="@handle"/>
</id>
<title>
<xsl:value-of select="title"/>
</title>
<author>
<name>
<xsl:value-of select="$author"/>
</name>
</author>
<updated>
<xsl:value-of select="date/full"/>
<xsl:text>T00:00:01+02:00</xsl:text>
</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="content/node()" mode="xhtml"/>
</div>
</content>
</entry>
</xsl:template>
</xsl:stylesheet>
|