-
Notifications
You must be signed in to change notification settings - Fork 1
/
doi.xsl
268 lines (235 loc) · 7.54 KB
/
doi.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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" />
<xsl:template match="/">
<resource xmlns="http://datacite.org/schema/kernel-4"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.2/metadata.xsd">
<!-- DOI -->
<identifier identifierType="DOI">
<xsl:value-of select="//GOOBI-DOI" />
</identifier>
<!-- IF TOP ELEMENT -->
<xsl:if test="not(//SUBELEMENT)">
<!-- TITLE -->
<titles>
<title>
<xsl:value-of select="//TITLE" />
</title>
</titles>
<!-- PUBLISHER AND PUBLICATION YEAR -->
<publisher>
<xsl:value-of select="//PUBLISHER" />
</publisher>
<publicationYear>
<xsl:value-of select="//PUBLICATIONYEAR" />
</publicationYear>
<!-- SUBJECTS IF AVAILABLE -->
<xsl:if test="//SUBJECT">
<subjects>
<xsl:for-each select="//SUBJECT">
<subject xml:lang="de-DE">
<xsl:value-of select="." />
</subject>
</xsl:for-each>
</subjects>
</xsl:if>
<!-- // SUBJECTS IF AVAILABLE -->
<!-- PUBLICATION TYPE -->
<resourceType resourceTypeGeneral="Text">
<xsl:value-of select="//GOOBI-DOCTYPE" />
</resourceType>
<!-- LANGUAGE -->
<language>
<xsl:value-of select="//LANGUAGE" />
</language>
<!-- CREATORS: AUTHORS AND EDITORS -->
<creators>
<xsl:for-each select="//CREATOR">
<creator>
<creatorName>
<xsl:value-of select="." />
</creatorName>
<givenName>
<xsl:value-of select="substring-after(., ', ')" />
</givenName>
<familyName>
<xsl:value-of select="substring-before(., ', ')" />
</familyName>
</creator>
</xsl:for-each>
</creators>
<!-- // CREATORS: AUTHORS AND EDITORS -->
<!-- ORIGINAL PUBLICATION YEAR -->
<dates>
<date dateType="Created">
<xsl:value-of select="//PUBLICATIONYEAR" />
</date>
</dates>
<!-- FORMAT IF AVAILABLE -->
<xsl:if test="//FORMAT">
<sizes>
<size>
<xsl:value-of select="//FORMAT" />
</size>
</sizes>
</xsl:if>
<!-- // FORMAT IF AVAILABLE -->
<!-- GOOBI IDENTIFIER -->
<alternateIdentifiers>
<alternateIdentifier
alternateIdentifierType="Goobi identifier">
<xsl:value-of select="//IDENTIFIER" />
</alternateIdentifier>
</alternateIdentifiers>
<!-- // GOOBI IDENTIFIER -->
<!-- HOSTING INSTITUTION -->
<contributors>
<contributor contributorType="HostingInstitution">
<contributorName>Universitätsbibliothek Stuttgart</contributorName>
</contributor>
</contributors>
<!-- // HOSTING INSTITUTION -->
<!-- ANCHOR INFORMATION IF AVAILABLE -->
<xsl:if test="//NUMBER != ''">
<relatedItems>
<relatedItem relatedItemType="Collection"
relationType="IsPartOf">
<titles>
<title>
<xsl:value-of select="//ANCHORTITLE" />
</title>
<xsl:if test="//ANCHORSUBTITLE">
<title titleType="Subtitle">
<xsl:value-of select="//ANCHORSUBTITLE" />
</title>
</xsl:if>
</titles>
<xsl:if test="//SERIES">
<volume>
<xsl:value-of select="//SERIES" />
</volume>
</xsl:if>
<number>
<xsl:value-of select="//NUMBER" />
</number>
</relatedItem>
</relatedItems>
</xsl:if>
<!-- // ANCHOR INFORMATION IF AVAILABLE -->
</xsl:if>
<!-- IF TOP ELEMENT -->
<!-- IF SUB ELEMENT -->
<xsl:if test="//SUBELEMENT">
<!-- TITLE OF SUB ELEMENT -->
<titles>
<title>
<xsl:value-of select="//METADATA-TitleDocMain" />
</title>
</titles>
<!-- PUBLISHER AND PUBLICATION YEAR -->
<publisher>
<xsl:value-of select="//PUBLISHER" />
</publisher>
<publicationYear>
<xsl:value-of select="//PUBLICATIONYEAR" />
</publicationYear>
<!-- RESOURCE TYPE FOR SUB ELEMENT -->
<resourceType resourceTypeGeneral="Text">document</resourceType>
<!-- CREATORS FOR SUB ELEMENT -->
<creators>
<xsl:if test="//PERSON-Author">
<xsl:for-each select="//PERSON-Author">
<creator>
<creatorName>
<xsl:value-of select="." />
</creatorName>
<givenName>
<xsl:value-of select="substring-after(., ', ')" />
</givenName>
<familyName>
<xsl:value-of select="substring-before(., ', ')" />
</familyName>
</creator>
</xsl:for-each>
</xsl:if>
<xsl:if test="not(//PERSON-Author)">
<creator>
<creatorName>- CREATOR UNKNOWN -</creatorName>
</creator>
</xsl:if>
</creators>
<!-- // CREATORS FOR SUB ELEMENT -->
<!-- ORIGINAL PUBLICATION YEAR -->
<dates>
<date dateType="Created">
<xsl:value-of select="//PUBLICATIONYEAR" />
</date>
</dates>
<!-- GOOBI IDENTIFIER -->
<alternateIdentifiers>
<alternateIdentifier
alternateIdentifierType="Goobi identifier">
<xsl:value-of select="//IDENTIFIER" />
</alternateIdentifier>
</alternateIdentifiers>
<!-- // GOOBI IDENTIFIER -->
<!-- HOSTING INSTITUTION -->
<contributors>
<contributor contributorType="HostingInstitution">
<contributorName>Universitätsbibliothek Stuttgart</contributorName>
</contributor>
</contributors>
<!-- // HOSTING INSTITUTION -->
<!-- ANCHOR INFORMATION IF AVAILABLE -->
<xsl:if test="//NUMBER != ''">
<descriptions>
<description descriptionType="SeriesInformation">
<xsl:value-of select="//ANCHORTITLE" />
</description>
<description descriptionType="SeriesInformation">
<xsl:value-of select="//NUMBER" />
</description>
</descriptions>
</xsl:if>
<!-- // ANCHOR INFORMATION IF AVAILABLE -->
<!-- VOLUME INFORMATION WHERE THE SUB ELEMENT IS PART OF -->
<relatedItems>
<relatedItem relationType="IsPublishedIn"
relatedItemType="Journal">
<titles>
<title>
<xsl:value-of select="//TITLE" />
</title>
</titles>
<publicationYear>
<xsl:value-of select="//PUBLICATIONYEAR" />
</publicationYear>
<volume>
<xsl:value-of select="//NUMBER" />
</volume>
<firstPage>
<xsl:value-of select="//SUBELEMENT-PAGE-START" />
</firstPage>
<lastPage>
<xsl:value-of select="//SUBELEMENT-PAGE-END" />
</lastPage>
</relatedItem>
</relatedItems>
<!-- // VOLUME INFORMATION WHERE THE SUB ELEMENT IS PART OF -->
</xsl:if>
<!-- IF SUB ELEMENT -->
</resource>
</xsl:template>
</xsl:stylesheet>
<!-- ========================== Available internal elements ==========================
- Publication type of anchor document (e.g. Periodical) <xsl:value-of select="//GOOBI-ANCHOR-DOCTYPE"/>
- Publication type of document (e.g. Monograph or Volume) <xsl:value-of select="//GOOBI-DOCTYPE"/>
- Generated DOI <xsl:value-of select="//GOOBI-DOI"/>
- Specific metadata (e.g. TitleDocMain) <xsl:value-of select="//METADATA-TitleDocMain"/>
- Specific person (e.g. Author) <xsl:value-of select="//PERSON-Author"/>
- Type of Structure element (e.g. Article) if it is one <xsl:value-of select="//SUBELEMENT"/>
- Start page of a structure element (e.g. [1]) <xsl:value-of select="//SUBELEMENT-PAGE-START"/>
- End page of a structure element (e.g. 23) <xsl:value-of select="//SUBELEMENT-PAGE-END"/>
========================== // Available internal elements ========================== -->