forked from berthubert/tkconv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtk.xslt
164 lines (143 loc) · 4.15 KB
/
tk.xslt
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:vv="http://www.tweedekamer.nl/ggm/vergaderverslag/v1.0"
exclude-result-prefixes="vv"
>
<xsl:output method="html"
version="5.0"
doctype-system="about:legacy-compat"
encoding="UTF-8"
indent="yes"
/>
<!-- This XSLT converts Dutch parliamentary documents into HTML. The input vocabulary is
documented in https://github.com/TweedeKamerDerStaten-Generaal/OpenDataPortaal/tree/master/xsd/vlos -->
<xsl:template match="/*">
<html>
<head>
<title>
<xsl:apply-templates select="*" mode="title" />
</title>
<link
rel="stylesheet"
href="../pico.min.css"
/>
<style>
.interrumpant {
background-color: var(--pico-mark-background-color);
}
</style>
</head>
<body>
<main class="container">
<xsl:apply-templates select="*" />
</main>
</body>
</html>
</xsl:template>
<xsl:template match="vv:vergadering">
<h1>
<xsl:value-of select="vv:titel" />
</h1>
<xsl:apply-templates select="vv:activiteit" />
</xsl:template>
<xsl:template match="vv:activiteit">
<section class="activiteit">
<xsl:apply-templates select="vv:activiteithoofd" />
</section>
</xsl:template>
<xsl:template match="vv:activiteithoofd">
<section class="activiteithoofd">
<h2>
<xsl:value-of select="vv:titel" />
</h2>
<xsl:apply-templates select="vv:tekst|vv:activiteitdeel" />
</section>
</xsl:template>
<xsl:template match="vv:tekst">
<section class="tekst">
<xsl:apply-templates select="*" />
</section>
</xsl:template>
<xsl:template match="vv:activiteitdeel">
<section class="activiteitdeel">
<xsl:apply-templates select="vv:tekst|vv:activiteititem" />
</section>
</xsl:template>
<xsl:template match="vv:activiteititem">
<section class="activiteititem">
<xsl:apply-templates select="vv:tekst|vv:woordvoerder" />
</section>
</xsl:template>
<xsl:template match="vv:woordvoerder">
<section class="woordvoerder">
<xsl:apply-templates select="vv:tekst|vv:interrumpant" />
</section>
</xsl:template>
<xsl:template match="vv:interrumpant">
<section class="interrumpant">
<xsl:apply-templates select="vv:tekst" />
</section>
</xsl:template>
<xsl:template match="vv:nadruk[@type='Vet']">
<strong>
<xsl:apply-templates />
</strong>
</xsl:template>
<xsl:template match="vv:nadruk[@type='Schuin']">
<em>
<xsl:apply-templates />
</em>
</xsl:template>
<xsl:template match="vv:nadruk[@type='Bovenschrift']">
<sup>
<xsl:apply-templates />
</sup>
</xsl:template>
<xsl:template match="vv:nadruk[@type='Onderschrift']">
<sub>
<xsl:apply-templates />
</sub>
</xsl:template>
<xsl:template match="vv:dossiernummer|vv:stuknummer">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="vv:alinea">
<div class="alinea">
<xsl:apply-templates select="*" />
</div>
</xsl:template>
<xsl:template match="vv:alinea/vv:alineaitem">
<p>
<xsl:apply-templates />
</p>
</xsl:template>
<xsl:template match="vv:lijst">
<ul>
<xsl:apply-templates />
</ul>
</xsl:template>
<xsl:template match="vv:lijst/vv:alineaitem">
<li>
<xsl:apply-templates />
</li>
</xsl:template>
<xsl:template match="vv:vergadering" mode="title">
<xsl:choose>
<xsl:when test="@soort='Commissie'">Commissievergadering</xsl:when>
<xsl:when test="@soort='Plenair'">Plenaire vergadering</xsl:when>
<xsl:otherwise>Vergadering</xsl:otherwise>
</xsl:choose>
<xsl:text>; </xsl:text>
<xsl:value-of
select="vv:titel" />
<!-- What else do we want in the title?-->
</xsl:template>
<!-- Helps the author of this xslt to see what still needs to be done -->
<!-- <xsl:template match="vv:*">
<xsl:message terminate="no">
<xsl:text>Unhandled element </xsl:text>
<xsl:value-of select="local-name()" />
</xsl:message>
<xsl:apply-templates />
</xsl:template> -->
</xsl:stylesheet>