-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoaipmh2marc_bib_honors.xsl
620 lines (566 loc) · 29.6 KB
/
oaipmh2marc_bib_honors.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:functx="http://www.functx.com"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
<!-- start functx -->
<!-- not working because ' has to be in double quotes, " has to be in single quotes
<xsl:variable name="fr" select="('‘', '’', '“', '”', '<p>', '</p>')"/>
<xsl:variable name="to" select="(''', ''', '"', '"', '', '')"/>
-->
<!-- Replacements for curly quotes, html tags, en and em dashes -->
<xsl:variable name="fr" select="('“', '”', '<p>', '</p>', '<em>', '</em>', '<strong>', '</strong>', '
', '<br />', '–', '—')"/>
<xsl:variable name="to" select="('"', '"', '', '', '', '', '', '', '', '', '-', '--')"/>
<!-- Replacements for degrees, titles, etc. -->
<xsl:variable name="degFr" select="(', Ph.D.', ', PhD', ', Ph. D.', ', Ph.D', 'Dr. ', ', Associate Professor', ', Assistant Professor', 'RD')"/>
<xsl:variable name="degTo" select="('', '', '', '', '', '', '', '')"/>
<xsl:function name="functx:replace-multi" as="xs:string?"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="xs:string?"/>
<xsl:param name="changeFrom" as="xs:string*"/>
<xsl:param name="changeTo" as="xs:string*"/>
<xsl:sequence select="
if (count($changeFrom) > 0)
then functx:replace-multi(
replace($arg, $changeFrom[1],
functx:if-absent($changeTo[1],'')),
$changeFrom[position() > 1],
$changeTo[position() > 1])
else $arg
"/>
</xsl:function>
<xsl:function name="functx:if-absent" as="item()*"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="item()*"/>
<xsl:param name="value" as="item()*"/>
<xsl:sequence select="
if (exists($arg))
then $arg
else $value
"/>
</xsl:function>
<!-- end functx -->
<xsl:template match="/">
<xsl:comment>comment</xsl:comment>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="oai:OAI-PMH">
<marc:collection xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
<xsl:apply-templates select="oai:ListRecords/oai:record/oai:metadata/oai_dc:dc"/>
</marc:collection>
</xsl:template>
<xsl:template match="oai:ListRecords/oai:record/oai:metadata/oai_dc:dc">
<!-- Name order variables -->
<!-- Full name in direct order -->
<!-- Rearrange for direct order; add period after initial -->
<!--<xsl:variable name="fullNameDirect"
select="replace(replace(dc:creator.name.full, '( [A-Z])( |$)', '$1.$2'), '^(.*), (.*)$', '$2 $1')"/>-->
<xsl:variable name="fullNameDirect" as="node()*">
<xsl:for-each select="dc:creator.name.full">
<xsl:value-of select="replace(replace(., '( [A-Z])( |$)', '$1.$2'), '^(.*), (.*)$', '$2 $1')"/> <!-- TODO or should there be a . instead of dc:creator.name.full in the replace? -->
</xsl:for-each>
</xsl:variable>
<!-- Full name in inverted order; sequence of names if more than one -->
<!-- In inverted order by default; add period after initial if missing -->
<xsl:variable name="fullNameInverted" as="node()*">
<xsl:for-each select="dc:creator.name.full">
<xsl:choose>
<xsl:when test="matches(., ' [A-Z]( |$)')">
<xsl:value-of select="concat(., '.')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<!-- Advisor name(s) in inverted order; sequence of names if more than one -->
<!-- Rearrange for inverted order if necessary -->
<xsl:variable name="advisorNameInverted" as="node()*">
<xsl:for-each select="dc:contributor.advisor">
<xsl:choose>
<xsl:when test="not(contains(functx:replace-multi(., $degFr, $degTo), ','))">
<xsl:value-of select="replace(functx:replace-multi(., $degFr, $degTo), '^(.*) ([''A-z-]+)$', '$2, $1')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="functx:replace-multi(., $degFr, $degTo)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<!-- End variables -->
<marc:record>
<!-- Insert leader and control fields -->
<marc:leader><xsl:text> nam a22 i 4500</xsl:text></marc:leader>
<marc:controlfield tag="005">
<xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01][H][m][s].[f01]')"/>
</marc:controlfield>
<marc:controlfield tag="007">
<xsl:text>cr </xsl:text>
</marc:controlfield>
<marc:controlfield tag="008">
<xsl:value-of select="format-dateTime(current-dateTime(), '[Y01][M01][D01]')"/>
<xsl:text>t</xsl:text>
<xsl:value-of select="substring(dc:date.available, 1, 4)"/>
<xsl:value-of select="substring(dc:date.dateSubmitted, 1, 4)"/>
<xsl:text>vau obm 000 0 eng d</xsl:text>
</marc:controlfield>
<!-- Insert DOI in 024 -->
<xsl:if test="dc:identifier.doi/text()">
<marc:datafield tag="024" ind1="7" ind2=" ">
<marc:subfield code="a">
<xsl:value-of select="replace(dc:identifier.doi, 'https://doi.org/', '')"/>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>doi</xsl:text>
</marc:subfield>
</marc:datafield>
</xsl:if>
<!--Insert ARK identifier in 024 if available-->
<xsl:if test="dc:identifier.ark/text()">
<marc:datafield tag="024" ind1="8" ind2=" ">
<marc:subfield code="a">
<xsl:value-of select="replace(dc:identifier.ark, '\.pdf$', '')"/>
</marc:subfield>
</marc:datafield>
</xsl:if>
<!-- Insert 040 -->
<marc:datafield tag="040" ind1=" " ind2=" ">
<marc:subfield code="a">VMC</marc:subfield>
<marc:subfield code="b">eng</marc:subfield>
<marc:subfield code="e">rda</marc:subfield>
<marc:subfield code="c">VMC</marc:subfield>
</marc:datafield>
<!-- Insert 049 -->
<marc:datafield tag="049" ind1=" " ind2=" ">
<marc:subfield code="a">VMCI</marc:subfield>
</marc:datafield>
<!-- Insert local call number in 050 -->
<marc:datafield tag="050" ind1=" " ind2="4">
<marc:subfield code="a">[TODO]</marc:subfield>
</marc:datafield>
<!-- Insert 100 with full name of first author, followed by "dissertant" relator -->
<marc:datafield tag="100" ind1="1" ind2=" ">
<marc:subfield code="a">
<xsl:value-of select="$fullNameInverted[position()=1]"/>
<xsl:text>,</xsl:text>
</marc:subfield>
<marc:subfield code="e">
<xsl:text>dissertant.</xsl:text>
</marc:subfield>
<marc:subfield code="4">
<xsl:text>http://id.loc.gov/vocabulary/relators/dis</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 245 -->
<xsl:variable name="ind2">
<xsl:choose>
<xsl:when test="starts-with(dc:title, 'A ')">2</xsl:when>
<xsl:when test="starts-with(dc:title, 'An ')">3</xsl:when>
<xsl:when test="starts-with(dc:title, 'The ')">4</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<marc:datafield tag="245" ind1="1" ind2="{$ind2}">
<!-- If title contains a colon, split into subfield a and b -->
<xsl:choose>
<xsl:when test="contains(dc:title, ':')">
<marc:subfield code="a">
<xsl:value-of select='functx:replace-multi(replace(replace(substring-before(dc:title, ": "), "‘", "'"), "’", "'"),$fr,$to)'/>
<xsl:text> :</xsl:text>
</marc:subfield>
<marc:subfield code="b">
<xsl:value-of select='functx:replace-multi(replace(replace(substring-after(dc:title, ": "), "‘", "'"), "’", "'"),$fr,$to)'/>
<xsl:text> /</xsl:text>
</marc:subfield>
</xsl:when>
<xsl:otherwise>
<marc:subfield code="a">
<xsl:value-of select='functx:replace-multi(replace(replace(dc:title, "‘", "'"), "’", "'"),$fr,$to)'/>
<xsl:text> /</xsl:text>
</marc:subfield>
</xsl:otherwise>
</xsl:choose>
<!-- Insert name(s) in direct order -->
<!-- TODO this must be as it appears on document -->
<marc:subfield code="c">
<xsl:text>[TODO].</xsl:text>
<!--<xsl:choose>
<xsl:when test="dc:creator.name.preferred/text()">
<xsl:value-of select="$prefNameDirect"/>
<xsl:if test="not(ends-with($prefNameDirect, '.'))">
<xsl:text>.</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<!-<xsl:value-of select="$fullNameDirect"/>
<xsl:if test="not(ends-with($fullNameDirect, '.'))">
<xsl:text>.</xsl:text>
</xsl:if>->
<!- TODO stuff below not tested; need to revise prefName above too ->
<xsl:for-each select="$fullNameDirect">
<xsl:value-of select="."/>
<xsl:if test="$fullNameDirect[position()!=last()]"> <!- TODO use not() instead of != ->
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test="not(ends-with($fullNameDirect[position()=last()], '.'))">
<xsl:text>.</xsl:text>
</xsl:if>
<!- TODO rewrite and test for multiple full names ->
</xsl:otherwise>
</xsl:choose>-->
</marc:subfield>
</marc:datafield>
<!-- Insert 264 with publication (embargo) date -->
<marc:datafield tag="264" ind1=" " ind2="1">
<marc:subfield code="a">
<xsl:text>[Harrisonburg, Virginia] :</xsl:text>
</marc:subfield>
<marc:subfield code="b">
<xsl:text>James Madison University,</xsl:text>
</marc:subfield>
<marc:subfield code="c">
<xsl:value-of select="substring(dc:date.available, 1, 4)"/>
<xsl:text>.</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 264 with copyright (submission) date -->
<marc:datafield tag="264" ind1=" " ind2="4">
<marc:subfield code="c">
<xsl:text>©</xsl:text>
<xsl:value-of select="substring(dc:date.dateSubmitted, 1, 4)"/>
</marc:subfield>
</marc:datafield>
<!-- Insert 300 -->
<marc:datafield tag="300" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>1 online resource [TODO]</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 336, 337, 338, 347 -->
<marc:datafield tag="336" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>text</xsl:text>
</marc:subfield>
<marc:subfield code="b">
<xsl:text>txt</xsl:text>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>rdacontent</xsl:text>
</marc:subfield>
</marc:datafield>
<marc:datafield tag="337" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>computer</xsl:text>
</marc:subfield>
<marc:subfield code="b">
<xsl:text>c</xsl:text>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>rdamedia</xsl:text>
</marc:subfield>
</marc:datafield>
<marc:datafield tag="338" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>online resource</xsl:text>
</marc:subfield>
<marc:subfield code="b">
<xsl:text>cr</xsl:text>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>rdacarrier</xsl:text>
</marc:subfield>
</marc:datafield>
<marc:datafield tag="347" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>text file</xsl:text>
</marc:subfield>
<marc:subfield code="b">
<xsl:text>pdf</xsl:text>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>rdaft</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 377 with default language English -->
<marc:datafield tag="377" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>eng</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 380 -->
<marc:datafield tag="380" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>Academic theses.</xsl:text>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>fast</xsl:text>
</marc:subfield>
<marc:subfield code="0">
<xsl:text>http://id.worldcat.org/fast/1726453</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 500 note for honors projects -->
<xsl:if test="starts-with('../../oai:header/oai:setSpec', 'publication:honors')">
<marc:datafield tag="500" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>Senior Honors Project.</xsl:text>
</marc:subfield>
</marc:datafield>
</xsl:if>
<!-- Insert 502 -->
<marc:datafield tag="502" ind1=" " ind2=" ">
<marc:subfield code="b">
<xsl:choose>
<xsl:when test="dc:publisher.degree.name='Master of Science (MS)'">M.S.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Doctor of Musical Arts (DMA)'">D.M.A.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Educational Specialist (EdS)'">Ed.S.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Doctor of Philosophy (PhD)'">Ph.D.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Master of Arts (MA)'">M.A.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Master of Science in Education (MSEd)'">M.S.Ed.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Master of Fine Arts (MFA)'">M.F.A.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Doctor of Audiology (AuD)'">Au.D.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Doctor of Psychology (PsyD)'">Psy.D.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Bachelor of Science in Nursing (BSN)'">B.S.N.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Bachelor of Science (BS)'">B.S.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Bachelor of Arts (BA)'">B.A.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Bachelor of Business Administration (BBA)'">B.B.A.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Bachelor of Fine Arts (BFA)'">B.F.A.</xsl:when>
<xsl:when test="dc:publisher.degree.name='Bachelor of Music (BM)'">B.M.</xsl:when>
<xsl:otherwise>
<xsl:value-of select="dc:publisher.degree.name"/>
</xsl:otherwise>
</xsl:choose>
</marc:subfield>
<marc:subfield code="c">
<xsl:text>James Madison University</xsl:text>
</marc:subfield>
<marc:subfield code="d">
<xsl:value-of select="substring(dc:date.dateSubmitted, 1, 4)"/>
<xsl:text>.</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 504 bibliographic references -->
<marc:datafield tag="504" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>Includes bibliographic references.</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 506 embargo date -->
<marc:datafield tag="506" ind1="1" ind2=" ">
<marc:subfield code="a">
<xsl:text>Embargo date: </xsl:text>
<xsl:value-of select="substring(dc:date.available, 1, 10)"/>
</marc:subfield>
</marc:datafield>
<!-- Insert 506s with use restrictions -->
<marc:datafield tag="506" ind1="0" ind2=" ">
<marc:subfield code="a">
<xsl:text>James Madison University Libraries is providing a metadata record and hyperlink to this full-text resource.</xsl:text>
</marc:subfield>
<marc:subfield code="f">
<xsl:text>Unrestricted online access</xsl:text>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>star</xsl:text>
</marc:subfield>
</marc:datafield>
<marc:datafield tag="506" ind1="0" ind2=" ">
<marc:subfield code="a">
<xsl:text>Open access content</xsl:text>
</marc:subfield>
<marc:subfield code="f">
<xsl:text>Unrestricted online access</xsl:text>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>star</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 516 -->
<marc:datafield tag="516" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>Electronic text.</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 520 abstract -->
<marc:datafield tag="520" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:value-of select='functx:replace-multi(replace(replace(dc:description.abstract, "‘", "'"), "’", "'"),$fr,$to)'/>
</marc:subfield>
</marc:datafield>
<!-- Insert 538 -->
<marc:datafield tag="538" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>System requirements: PDF reader.</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 540 -->
<marc:datafield tag="540" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 License.</xsl:text>
</marc:subfield>
<marc:subfield code="u">
<xsl:text>https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 500 with dissertant-supplied bepress disciplines -->
<marc:datafield tag="500" ind1=" " ind2=" ">
<marc:subfield code="a">
<xsl:text>Dissertant-supplied disciplines: </xsl:text>
<xsl:for-each select="dc:subject.disciplines">
<xsl:value-of select="."/>
<xsl:if test="not(position() = last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</marc:subfield>
</marc:datafield>
<!-- Insert 653 dissertant-supplied keywords as uncontrolled subject headings -->
<xsl:for-each select="dc:subject.keywords">
<marc:datafield tag="653" ind1=" " ind2=" ">
<marc:subfield code="a">
<!-- Capitalize first letter -->
<xsl:value-of select="concat(upper-case(substring(., 1, 1)), substring(., 2))"/>
</marc:subfield>
<marc:subfield code="7">
<xsl:text>(dpeaa)Dissertant-supplied subject heading</xsl:text>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
<!-- Insert 655 -->
<marc:datafield tag="655" ind1=" " ind2="7">
<marc:subfield code="a">
<xsl:text>Academic theses.</xsl:text>
</marc:subfield>
<marc:subfield code="2">
<xsl:text>fast</xsl:text>
</marc:subfield>
<marc:subfield code="0">
<xsl:text>http://id.worldcat.org/fast/1726453</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 700 for each author after the first -->
<xsl:if test="count($fullNameInverted)>1">
<xsl:for-each select="$fullNameInverted[not(position()=1)]">
<marc:datafield tag="700" ind1="1" ind2=" ">
<marc:subfield code="a">
<xsl:value-of select="."/>
<xsl:text>,</xsl:text>
</marc:subfield>
<marc:subfield code="e">
<xsl:text>dissertant.</xsl:text>
</marc:subfield>
</marc:datafield>
<marc:subfield code="4">
<xsl:text>http://id.loc.gov/vocabulary/relators/dis</xsl:text>
</marc:subfield>
</xsl:for-each>
</xsl:if>
<!-- Insert 700 for advisor -->
<!--<xsl:for-each select="dc:contributor.advisor">
<marc:datafield tag="700" ind1="1" ind2=" ">
<marc:subfield code="a">
<xsl:value-of select="functx:replace-multi(., $degFr, $degTo)"/>
</marc:subfield>
<marc:subfield code="e">
<xsl:text>thesis advisor.</xsl:text>
</marc:subfield>
</marc:datafield>
</xsl:for-each>-->
<xsl:for-each select="$advisorNameInverted">
<marc:datafield tag="700" ind1="1" ind2=" ">
<marc:subfield code="a">
<xsl:value-of select="."/>
<xsl:text>,</xsl:text>
</marc:subfield>
<marc:subfield code="e">
<xsl:text>thesis advisor.</xsl:text>
</marc:subfield>
<marc:subfield code="4">
<xsl:text>http://www.rdaregistry.info/Elements/a/#P50091</xsl:text>
</marc:subfield>
</marc:datafield>
</xsl:for-each>
<!-- Insert 710 degree granting institution -->
<marc:datafield tag="710" ind1="2" ind2=" ">
<marc:subfield code="a">
<xsl:text>James Madison University,</xsl:text>
</marc:subfield>
<marc:subfield code="e">
<xsl:text>degree granting institution.</xsl:text>
</marc:subfield>
<marc:subfield code="4">
<xsl:text>http://www.rdaregistry.info/Elements/a/#P50003</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 710 JMU department -->
<marc:datafield tag="710" ind1="2" ind2=" ">
<marc:subfield code="a">
<xsl:text>James Madison University.</xsl:text>
</marc:subfield>
<marc:subfield code="b">
<xsl:value-of select="dc:publisher.department"/>
<xsl:if test="not(ends-with(dc:publisher.department, ')'))">
<xsl:text>,</xsl:text>
</xsl:if>
</marc:subfield>
<marc:subfield code="e">
<xsl:text>sponsoring body.</xsl:text>
</marc:subfield>
<marc:subfield code="4">
<xsl:text>http://www.rdaregistry.info/Elements/a/#P50009</xsl:text>
</marc:subfield>
</marc:datafield>
<!-- Insert 856 with URL, using DOI if available -->
<xsl:choose>
<xsl:when test="dc:identifier.doi/text()">
<marc:datafield tag="856" ind1="4" ind2="0">
<marc:subfield code="z">
<xsl:text>Full-text of dissertation on the Internet</xsl:text>
</marc:subfield>
<marc:subfield code="u">
<xsl:value-of select="dc:identifier.doi"/>
</marc:subfield>
</marc:datafield>
</xsl:when>
<xsl:when test="dc:identifier.url/text()">
<marc:datafield tag="856" ind1="4" ind2="0">
<marc:subfield code="z">
<xsl:text>Full-text of dissertation on the Internet</xsl:text>
</marc:subfield>
<marc:subfield code="u">
<xsl:value-of select="dc:identifier.url"/>
</marc:subfield>
</marc:datafield>
</xsl:when>
</xsl:choose>
<!-- Testing names
<xsl:if test="dc:creator.name.preferred/text()">
<marc:datafield tag="500" ind1=" " ind2=" ">
<marc:subfield code="a"><xsl:text>prefNameDirect: </xsl:text>
<xsl:value-of select="$prefNameDirect"/></marc:subfield>
</marc:datafield>
<marc:datafield tag="500" ind1=" " ind2=" ">
<marc:subfield code="a"><xsl:text>prefNameInverted: </xsl:text>
<xsl:value-of select="$prefNameInverted"/></marc:subfield>
</marc:datafield>
</xsl:if>
<marc:datafield tag="500" ind1=" " ind2=" ">
<marc:subfield code="a"><xsl:text>fullNameDirect: </xsl:text>
<xsl:value-of select="$fullNameDirect"/></marc:subfield>
</marc:datafield>
<marc:datafield tag="500" ind1=" " ind2=" ">
<marc:subfield code="a"><xsl:text>fullNameInverted: </xsl:text>
<xsl:value-of select="$fullNameInverted"/></marc:subfield>
</marc:datafield>-->
</marc:record>
</xsl:template>
</xsl:stylesheet>