This repository has been archived by the owner on Nov 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gdpr-articles.xsl
225 lines (191 loc) · 9.09 KB
/
gdpr-articles.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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?xml version="1.0" encoding="UTF-8"?>
<!-- HERE BE DRAGONS -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xslFormatting="urn:xslFormatting">
<xsl:output method="html" encoding="UTF-8" indent="yes" />
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:template match="/">
<xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
<html lang="{translate(/CONS.ACT/CONS.DOC/BIB.INSTANCE/LG.DOC, $uppercase, $lowercase)}">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="referrer" content="no-referrer"/>
<title>GDPR articles (<xsl:value-of select="/CONS.ACT/CONS.DOC/BIB.INSTANCE/LG.DOC" />)</title>
<link rel="stylesheet" href="../../style.css"/>
</head>
<body>
<header>
<nav>
Articles · <a href="../rec/">Recitals</a> · <a href="../../">Other languages</a>
</nav>
<h1 class="page-title">
GDPR articles (<xsl:value-of select="/CONS.ACT/CONS.DOC/BIB.INSTANCE/LG.DOC" />)
</h1>
</header>
<section class="intro" lang="en">
<p>This page contains the articles of the GDPR. Please note that this is not the official version; for that, <a href="https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=celex%3A32016R0679">see the official version</a> (and the 2018 <a href="https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32016R0679R%2802%29">corrigendum</a>). There may be errors here; if you find any, please <a href="mailto:[email protected]">contact us</a> or <a href="https://github.com/andersju/gdpr-xml">create an issue on GitHub</a>.</p>
<p>The following was generated from <a href="https://publications.europa.eu/en/publication-detail/-/publication/5f2552c2-cc45-11e6-ad7c-01aa75ed71a1/language-en/format-PDF/source-82709144">XML files of the consolidated GDPR</a> (i.e., with corrections integrated). These files did not include the preamble containing the recitals, so these were added from <a href="https://publications.europa.eu/en/publication-detail/-/publication/3e485e15-11bd-11e6-ba9a-01aa75ed71a1/language-en">the XML version of the original GDPR</a>, and the preamble corrections were then merged in.</p>
<p>This is a service by <a href="https://dataskydd.net/english">Dataskydd.net</a>. The texts are © European Union, 2018.</p>
</section>
<main class="articles">
<h2><xsl:apply-templates select="/CONS.ACT/CONS.DOC/TITLE"/></h2>
<ul>
<xsl:for-each select="/CONS.ACT/CONS.DOC/ENACTING.TERMS/DIVISION">
<xsl:call-template name="toc">
<xsl:with-param name="division" select="."/>
</xsl:call-template>
</xsl:for-each>
</ul>
<xsl:apply-templates select="/CONS.ACT/CONS.DOC/ENACTING.TERMS/DIVISION"/>
<xsl:apply-templates select="/CONS.ACT/CONS.DOC/FINAL/P"/>
<!--<xsl:apply-templates select="/CONS.ACT/CONS.DOC/FINAL/SIGNATURE"/>-->
</main>
<xsl:call-template name="footnotes" />
</body>
</html>
</xsl:template>
<xsl:template match="PREAMBLE.INIT|VISA|GR.CONSID.INIT|PREAMBLE.FINAL">
<p><xsl:apply-templates select="node()"/></p>
</xsl:template>
<xsl:template name="footnotes">
<section class="footnotes">
<ol>
<xsl:for-each select="/CONS.ACT/CONS.DOC/ENACTING.TERMS/descendant::NOTE[@TYPE='FOOTNOTE']">
<li id="cite-note-{@NOTE.ID}">
<a href="#cite-ref-{@NOTE.ID}">^</a><xsl:text> </xsl:text>
<xsl:apply-templates match="." />
</li>
</xsl:for-each>
</ol>
</section>
</xsl:template>
<xsl:template name="toc">
<xsl:param name="division" />
<li>
<a href="#ch{position()}">
<xsl:value-of select="$division/TITLE/TI" /><xsl:text disable-output-escaping="yes"> <![CDATA[–]]> </xsl:text><xsl:value-of select="$division/TITLE/STI" />
</a><br />
<ul>
<xsl:for-each select="$division/ARTICLE">
<li>
<a href="#art{number(@IDENTIFIER)}"><xsl:value-of select="TI.ART" /></a><xsl:text disable-output-escaping="yes"> <![CDATA[–]]> </xsl:text><xsl:value-of select="STI.ART" />
</li>
</xsl:for-each>
<xsl:for-each select="$division/DIVISION">
<li>
<a href="#{translate(normalize-space(concat(../TITLE/TI, TITLE/TI)), ' ', '')}">
<xsl:value-of select="TITLE/TI" /><xsl:text disable-output-escaping="yes"> <![CDATA[–]]> </xsl:text><xsl:value-of select="TITLE/STI" />
</a>
</li>
<li>
<xsl:for-each select="ARTICLE">
<a href="#art{number(@IDENTIFIER)}"><xsl:value-of select="TI.ART" /></a><xsl:text disable-output-escaping="yes"> <![CDATA[–]]> </xsl:text><xsl:value-of select="STI.ART" /><br />
</xsl:for-each>
</li>
</xsl:for-each>
</ul>
</li>
</xsl:template>
<xsl:template match="/CONS.ACT/CONS.DOC/ENACTING.TERMS/DIVISION">
<a href="#ch{position()}">
<h2 id="ch{position()}">
<xsl:value-of select="normalize-space(TITLE/TI)"/><xsl:text disable-output-escaping="yes"> <![CDATA[–]]> </xsl:text><xsl:value-of select="TITLE/STI" />
</h2>
</a>
<xsl:apply-templates select="ARTICLE" />
<xsl:apply-templates select="DIVISION" />
</xsl:template>
<xsl:template match="/CONS.ACT/CONS.DOC/ENACTING.TERMS/DIVISION/DIVISION">
<a href="#{translate(normalize-space(concat(../TITLE/TI, TITLE/TI)), ' ', '')}">
<h2 id="{translate(normalize-space(concat(../TITLE/TI, TITLE/TI)), ' ', '')}"><xsl:value-of select="normalize-space(TITLE/TI)"/><xsl:text disable-output-escaping="yes"> <![CDATA[–]]> </xsl:text><xsl:value-of select="normalize-space(TITLE/STI)"/></h2>
</a>
<xsl:apply-templates select="ARTICLE" />
<xsl:apply-templates select="DIVISION" />
</xsl:template>
<xsl:template match="TITLE/STI">
<span class="sti-div"><xsl:value-of select="normalize-space(.)"/></span>
</xsl:template>
<xsl:template match="ARTICLE">
<a href="#art{number(@IDENTIFIER)}">
<h3 id="art{number(@IDENTIFIER)}"><xsl:value-of select="TI.ART" /></h3>
</a>
<p class="sti-art"><strong><xsl:value-of select="STI.ART"/></strong></p>
<ul>
<xsl:apply-templates select="PARAG" />
<xsl:apply-templates select="ALINEA" />
</ul>
</xsl:template>
<xsl:template match="PARAG">
<li>
<xsl:apply-templates select="NO.PARAG" /><xsl:text> </xsl:text><xsl:apply-templates select="ALINEA[1]"/>
</li>
<xsl:for-each select="ALINEA[position()>1]">
<li>
<xsl:apply-templates select="."/>
</li>
</xsl:for-each>
</xsl:template>
<xsl:template match="PARAG/ALINEA">
<xsl:apply-templates select="node()"/>
</xsl:template>
<xsl:template match="PARAG/ALINEA/LIST|ARTICLE/ALINEA/LIST|ARTICLE/ALINEA/LIST/ITEM/NP/P/LIST">
<ul>
<xsl:apply-templates select="node()"/>
</ul>
</xsl:template>
<xsl:template match="PARAG/ALINEA/LIST/ITEM|ARTICLE/ALINEA/LIST/ITEM|ARTICLE/ALINEA/LIST/ITEM/NP/P/LIST/ITEM">
<li>
<xsl:if test="../@TYPE='DASH'">
<xsl:text disable-output-escaping="yes"><![CDATA[—]]></xsl:text>
</xsl:if>
<xsl:apply-templates select="node()"/>
</li>
</xsl:template>
<xsl:template match="ARTICLE/ALINEA">
<li>
<xsl:apply-templates select="node()"/>
</li>
</xsl:template>
<xsl:template match="TITLE/TI/P">
<span>
<xsl:value-of select="normalize-space(.)"/>
</span>
</xsl:template>
<xsl:template match="HT[@TYPE='ITALIC']">
<em>
<xsl:apply-templates select="node()"/>
</em>
</xsl:template>
<xsl:template match="HT[@TYPE='UC']">
<span class="uppercase">
<xsl:apply-templates select="node()"/>
</span>
</xsl:template>
<xsl:template match="HT[@TYPE='BOLD']">
<strong>
<xsl:apply-templates select="node()"/>
</strong>
</xsl:template>
<xsl:template match="NOTE[@TYPE='FOOTNOTE']">
<sup id="cite-ref-{@NOTE.ID}">
<a href="#cite-note-{@NOTE.ID}"><xsl:value-of select="number(substring(@NOTE.ID, 2))" /></a>
</sup>
</xsl:template>
<!-- ughhhhhh. -->
<xsl:template match="QUOT.START"><xsl:text disable-output-escaping="yes"><q></xsl:text></xsl:template>
<xsl:template match="QUOT.END"><xsl:text disable-output-escaping="yes"></q></xsl:text></xsl:template>
<xsl:decimal-format name="european" decimal-separator=',' grouping-separator=' ' />
<xsl:template match="FT[@TYPE='NUMBER']">
<xsl:value-of select="format-number(text(), '# ###,##;(# ###,##)', 'european')" />
</xsl:template>
<xsl:template match="REF.DOC.OJ">
<a href="https://eur-lex.europa.eu/legal-content/EN/AUTO/?uri=OJ:{@COLL}:{substring(@DATE.PUB, 1, 4)}:{@NO.OJ}:TOC">
<xsl:value-of select="." />
</a>
</xsl:template>
</xsl:stylesheet>