-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersReg.xsl
225 lines (183 loc) · 9.02 KB
/
persReg.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"?>
<!-- Gesamtpersonenregister-XSL für \\edoc\ed000227 Religionsfriedens-Edition -->
<xsl:stylesheet
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:mets="http://www.loc.gov/METS/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exist="http://exist.sourceforge.net/NS/exist"
xmlns:gndo="https://d-nb.info/standards/elementset/gnd#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
exclude-result-prefixes="tei exist mets xlink gndo rdf"
version="3.0">
<xsl:include href="../rules/styles/param.xsl"/>
<xsl:include href="../rules/styles/tei-phraselevel.xsl"/>
<!-- <xsl:output encoding="UTF-8" indent="yes" method="html" doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>-->
<xsl:output encoding="UTF-8" indent="yes" method="html" doctype-system="about:legacy-compat"/><!-- bei HTML5 -->
<xsl:param name="ref"/>
<xsl:param name="footerXML">../listPerson.xml</xsl:param>
<xsl:param name="footerXSL">../personenregister.xsl</xsl:param>
<xsl:key name="place-ref" match="tei:rs[@type='place']" use="@ref"/>
<!-- erstellt Mai 2016 von Marcus Baumgarten auf Grundlage einer XSL-Transformation von Jennifer Bunselmeier, bearbeitet von Silke Kalmer Juli 2018 -->
<xsl:template match="/">
<html>
<head>
<title>Personenregister</title>
<!--<link rel="stylesheet" type="text/css" href="../layout/styles.css"/>-->
<link rel="stylesheet" type="text/css" media="screen" href="../../layout/navigator.css"></link>
<script src="../../javascript/jquery/jquery-3.3.1.min.js"></script>
<script src="../../javascript/jquery/functions.js"></script>
<!-- <script src="../../javascript/navigator.js"><noscript>please activate javascript to enable functions</noscript></script>-->
</head>
<body>
<!-- Bearbeitungsstand -->
<div id="wip">
<p><xsl:text>➨ Hinweis: Das Personenregister ist in Bearbeitung und daher nur eingeschränkt zitierfähig.</xsl:text></p>
<p><xsl:text>Bis Ende 2019 sind Änderungen und Korrekturen möglich.</xsl:text></p>
<p><xsl:text>Danach werden etwaige Korrekturen und Ergänzungen in einem Änderungsregister gelistet.</xsl:text></p>
</div> <!-- end WorkInProgress -->
<!-- Dokumentkopf -->
<div id="doc_header">
<div class="register_head">Personenregister</div>
<hr id="doc_header_line"/>
</div>
<div class="register">
<xsl:apply-templates select="//tei:listPerson/tei:person">
<xsl:sort select="normalize-space(tei:persName/tei:surname[1])
|| normalize-space(tei:persName/tei:forename[1])
|| normalize-space(tei:persName/tei:roleName[1])" />
</xsl:apply-templates>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="tei:person">
<h5>
<xsl:call-template name="head"/>
</h5>
<hr />
<table class="register_table">
<tr>
<td class="beschriftung">Name:</td>
<td class="eintrag"><xsl:call-template name="persName"/></td>
</tr>
<xsl:if test="tei:persName/tei:roleName">
<tr>
<td class="beschriftung">RoleName:</td><!-- statt "RoleName" "Titel" o.Ä.? -->
<td class="eintrag"><xsl:call-template name="roleName"/></td>
</tr>
</xsl:if>
<xsl:if test="tei:persName/@ref">
<tr>
<td class="beschriftung">Referenz:</td>
<td class="eintrag"><xsl:call-template name="reference"/></td>
</tr>
</xsl:if>
<xsl:if test="tei:note/text()">
<tr>
<td class="beschriftung">Hinweis:</td>
<td class="eintrag"><xsl:call-template name="note"/></td>
</tr>
</xsl:if>
<tr>
<td class="beschriftung"></td>
<td class="eintrag"></td>
</tr>
<!-- Auslesen der Daten aus gnd.xml -->
<xsl:if test="starts-with(tei:persName/@ref, 'http://d-nb.info/gnd')">
<tr>
<td></td>
<td><span class="italic">Folgende Daten sind aus der <a href="https://www.dnb.de/DE/Professionell/Standardisierung/GND/gnd_node.html" target="_blank">GND</a> generiert:</span></td>
</tr>
<xsl:variable name="gndlink">
<xsl:value-of select="tei:persName/@ref" />
</xsl:variable>
<xsl:variable name="gnd" select="doc('gnd.xml')//rdf:Description[@rdf:about = $gndlink]"/>
<xsl:if test="$gnd/gndo:dateOfBirth">
<tr>
<td class="beschriftung">Geburtsdatum:</td>
<td class="eintrag"><xsl:call-template name="birth"></xsl:call-template></td>
</tr>
</xsl:if>
<xsl:if test="$gnd/gndo:dateOfDeath">
<tr>
<td class="beschriftung">Todesdatum:</td>
<td class="eintrag"><xsl:call-template name="death"></xsl:call-template></td>
</tr>
</xsl:if>
<xsl:if test="$gnd/gndo:biographicalOrHistoricalInformation">
<tr>
<td class="beschriftung">Biographie:</td>
<td class="eintrag"><xsl:call-template name="bio"></xsl:call-template></td>
</tr>
</xsl:if>
</xsl:if>
<!-- gnd Ende -->
</table>
</xsl:template>
<xsl:template name="persName">
<xsl:apply-templates select="tei:persName" mode="noRoleName"/>
</xsl:template>
<xsl:template match="tei:roleName" mode="noRoleName"/>
<xsl:template name="surname">
<xsl:value-of select="tei:surname"/>
</xsl:template>
<xsl:template name="head">
<span class="bold">
<xsl:if test="tei:persName/tei:surname">
<xsl:value-of select="tei:persName/tei:surname"/>
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="tei:persName/tei:forename"/>
</span>
</xsl:template>
<xsl:template name="forename">
<xsl:for-each select="tei:forename">
<xsl:value-of select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>
<xsl:template name="nameLink">
<xsl:value-of select="tei:nameLink"/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template name="addName">
<xsl:value-of select="tei:addName"/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template name="roleName">
<xsl:value-of select="tei:persName/tei:roleName"/>
</xsl:template>
<xsl:template name="reference">
<a>
<xsl:attribute name="href"><!--
<xsl:value-of select="$gnd"/>-->
<xsl:value-of select="tei:persName/@ref"/></xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
<xsl:value-of select="tei:persName/@ref"/>
</a>
</xsl:template>
<xsl:template name="note">
<xsl:apply-templates select="tei:note"/>
</xsl:template>
<xsl:template name="birth">
<xsl:variable name="gndlink">
<xsl:value-of select="tei:persName/@ref" />
</xsl:variable>
<xsl:value-of select="document('gnd.xml')//rdf:Description[@rdf:about=$gndlink]//gndo:dateOfBirth"/>
</xsl:template>
<xsl:template name="death">
<xsl:variable name="gndlink">
<xsl:value-of select="tei:persName/@ref" />
</xsl:variable>
<xsl:value-of select="document('gnd.xml')//rdf:Description[@rdf:about=$gndlink]//gndo:dateOfDeath"/>
</xsl:template>
<xsl:template name="bio">
<xsl:variable name="gndlink">
<xsl:value-of select="tei:persName/@ref" />
</xsl:variable>
<xsl:for-each select="document('gnd.xml')//rdf:Description[@rdf:about=$gndlink]//gndo:biographicalOrHistoricalInformation"><!-- bei mehreren Elementen (Hinweis: Information manchmal doppelt?) SK 03.01.2019 -->
<xsl:value-of select="."/><br></br>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>