-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMARC21slim2HTML_FLVC.xsl
71 lines (62 loc) · 1.87 KB
/
MARC21slim2HTML_FLVC.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
<?xml version="1.0" encoding="UTF-8"?>
<!-- MARC21Slim2HTML accessed from LOC April 2013,
revised for FLVC Islandora usage April 2013
by Caitlin Nelson
version 1.0 -->
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="marc:record">
<table>
<xsl:apply-templates select="marc:leader"/>
<!-- <xsl:apply-templates select="marc:datafield|marc:controlfield"/> -->
<!-- this makes the output appear in ascending numerical order by MARC tag -->
<xsl:apply-templates select="marc:controlfield">
<xsl:sort select="@tag"/>
</xsl:apply-templates>
<xsl:apply-templates select="marc:datafield">
<xsl:sort select="@tag"/>
</xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="marc:leader">
<tr>
<th NOWRAP="TRUE" ALIGN="RIGHT" VALIGN="TOP">
Leader
</th>
<td>
<xsl:value-of select="translate(.,' ','^')"/>
</td>
</tr>
</xsl:template>
<xsl:template match="marc:controlfield">
<tr>
<th NOWRAP="TRUE" ALIGN="RIGHT" VALIGN="TOP">
<xsl:value-of select="@tag"/>
</th>
<td>
<xsl:value-of select="translate(.,' ','^')"/>
</td>
</tr>
</xsl:template>
<xsl:template match="marc:datafield">
<tr>
<th NOWRAP="TRUE" ALIGN="RIGHT" VALIGN="TOP">
<xsl:value-of select="@tag"/>
</th>
<td>
<xsl:value-of select="translate(@ind1,' ','#')"/>
<xsl:value-of select="translate(@ind2,' ','#')"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="marc:subfield"/>
</td>
</tr>
</xsl:template>
<xsl:template match="marc:subfield">
<strong>|<xsl:value-of select="@code"/></strong><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>