1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0"
3 xmlns:marc="http://www.loc.gov/MARC21/slim"
4 xmlns:dc="http://purl.org/dc/elements/1.1/"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 exclude-result-prefixes="marc">
7 <xsl:import href="MARC21slimUtils.xsl"/>
8 <xsl:output method="xml" indent="yes"/>
10 <xsl:template match="/">
11 <xsl:apply-templates/>
14 <xsl:template match="marc:record">
15 <xsl:variable name="leader" select="marc:leader"/>
16 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
17 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
18 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
21 <xsl:for-each select="marc:datafield[@tag=245]">
23 <xsl:call-template name="subfieldSelect">
24 <xsl:with-param name="codes">abfghk</xsl:with-param>
30 <xsl:for-each select="marc:datafield[@tag=100]|marc:datafield[@tag=110]|marc:datafield[@tag=111]|marc:datafield[@tag=700]|marc:datafield[@tag=710]|marc:datafield[@tag=711]|marc:datafield[@tag=720]">
32 <xsl:value-of select="."/>
37 <xsl:if test="$leader7='c'">
38 <xsl:attribute name="collection">yes</xsl:attribute>
41 <xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
42 <xsl:attribute name="manuscript">yes</xsl:attribute>
46 <xsl:when test="$leader6='a' or $leader6='t'">text</xsl:when>
47 <xsl:when test="$leader6='e' or $leader6='f'">cartographic</xsl:when>
48 <xsl:when test="$leader6='c' or $leader6='d'">notated music</xsl:when>
49 <xsl:when test="$leader6='i' or $leader6='j'">sound recording</xsl:when>
50 <xsl:when test="$leader6='k'">still image</xsl:when>
51 <xsl:when test="$leader6='g'">moving image</xsl:when>
52 <xsl:when test="$leader6='r'">three dimensional object</xsl:when>
53 <xsl:when test="$leader6='m'">software, multimedia</xsl:when>
54 <xsl:when test="$leader6='p'">mixed material</xsl:when>
58 <xsl:for-each select="marc:datafield[@tag=655]">
60 <xsl:value-of select="."/>
64 <xsl:for-each select="marc:datafield[@tag=260]">
66 <xsl:call-template name="subfieldSelect">
67 <xsl:with-param name="codes">ab</xsl:with-param>
72 <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='c']">
74 <xsl:value-of select="."/>
79 <xsl:value-of select="substring($controlField008,36,3)"/>
82 <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q']">
84 <xsl:value-of select="."/>
88 <xsl:for-each select="marc:datafield[@tag=520]">
90 <xsl:value-of select="marc:subfield[@code='a']"/>
94 <xsl:for-each select="marc:datafield[@tag=521]">
96 <xsl:value-of select="marc:subfield[@code='a']"/>
100 <xsl:for-each select="marc:datafield[500<@tag][@tag<=599][not(@tag=506 or @tag=530 or @tag=540 or @tag=546)]">
102 <xsl:value-of select="marc:subfield[@code='a']"/>
106 <xsl:for-each select="marc:datafield[@tag=600]">
108 <xsl:call-template name="subfieldSelect">
109 <xsl:with-param name="codes">abcdq</xsl:with-param>
114 <xsl:for-each select="marc:datafield[@tag=610]">
116 <xsl:call-template name="subfieldSelect">
117 <xsl:with-param name="codes">abcdq</xsl:with-param>
122 <xsl:for-each select="marc:datafield[@tag=611]">
124 <xsl:call-template name="subfieldSelect">
125 <xsl:with-param name="codes">abcdq</xsl:with-param>
130 <xsl:for-each select="marc:datafield[@tag=630]">
132 <xsl:call-template name="subfieldSelect">
133 <xsl:with-param name="codes">abcdq</xsl:with-param>
138 <xsl:for-each select="marc:datafield[@tag=650]">
140 <xsl:call-template name="subfieldSelect">
141 <xsl:with-param name="codes">abcdq</xsl:with-param>
146 <xsl:for-each select="marc:datafield[@tag=653]">
148 <xsl:call-template name="subfieldSelect">
149 <xsl:with-param name="codes">abcdq</xsl:with-param>
154 <xsl:for-each select="marc:datafield[@tag=752]">
156 <xsl:call-template name="subfieldSelect">
157 <xsl:with-param name="codes">abcd</xsl:with-param>
162 <xsl:for-each select="marc:datafield[@tag=530]">
163 <dc:relation type="original">
164 <xsl:call-template name="subfieldSelect">
165 <xsl:with-param name="codes">abcdu</xsl:with-param>
170 <xsl:for-each select="marc:datafield[@tag=760]|marc:datafield[@tag=762]|marc:datafield[@tag=765]|marc:datafield[@tag=767]|marc:datafield[@tag=770]|marc:datafield[@tag=772]|marc:datafield[@tag=773]|marc:datafield[@tag=774]|marc:datafield[@tag=775]|marc:datafield[@tag=776]|marc:datafield[@tag=777]|marc:datafield[@tag=780]|marc:datafield[@tag=785]|marc:datafield[@tag=786]|marc:datafield[@tag=787]">
172 <xsl:call-template name="subfieldSelect">
173 <xsl:with-param name="codes">ot</xsl:with-param>
178 <xsl:for-each select="marc:datafield[@tag=856]">
180 <xsl:value-of select="marc:subfield[@code='u']"/>
184 <xsl:for-each select="marc:datafield[@tag=506]">
186 <xsl:value-of select="marc:subfield[@code='a']"/>
190 <xsl:for-each select="marc:datafield[@tag=540]">
192 <xsl:value-of select="marc:subfield[@code='a']"/>