Lines 5-190
Link Here
|
5 |
<xsl:stylesheet version="1.0" |
5 |
<xsl:stylesheet version="1.0" |
6 |
xmlns:marc="http://www.loc.gov/MARC21/slim" |
6 |
xmlns:marc="http://www.loc.gov/MARC21/slim" |
7 |
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" |
7 |
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" |
8 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
8 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
9 |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
9 |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
10 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc"> |
10 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc"> |
11 |
<xsl:import href="MARC21slimUtils.xsl"/> |
11 |
<xsl:import href="MARC21slimUtils.xsl"/> |
12 |
<xsl:output method="xml" indent="yes"/> |
12 |
<xsl:output method="xml" indent="yes"/> |
13 |
<xsl:template match="/"> |
13 |
<xsl:template match="/"> |
14 |
<xsl:if test="marc:collection"> |
14 |
<xsl:if test="marc:collection"> |
15 |
<oai_dc:dcCollection xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> |
15 |
<oai_dc:dcCollection xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> |
16 |
<xsl:for-each select="marc:collection"> |
16 |
<xsl:for-each select="marc:collection"> |
17 |
<xsl:for-each select="marc:record"> |
17 |
<xsl:for-each select="marc:record"> |
18 |
<oai_dc:dc> |
18 |
<oai_dc:dc> |
19 |
<xsl:apply-templates select="."/> |
19 |
<xsl:apply-templates select="."/> |
20 |
</oai_dc:dc> |
20 |
</oai_dc:dc> |
21 |
</xsl:for-each> |
21 |
</xsl:for-each> |
22 |
</xsl:for-each> |
22 |
</xsl:for-each> |
23 |
</oai_dc:dcCollection> |
23 |
</oai_dc:dcCollection> |
24 |
</xsl:if> |
24 |
</xsl:if> |
25 |
<xsl:if test="marc:record"> |
25 |
<xsl:if test="marc:record"> |
26 |
<oai_dc:dc |
26 |
<oai_dc:dc |
27 |
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" |
27 |
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" |
28 |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
28 |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
29 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
29 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
30 |
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> |
30 |
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> |
31 |
<xsl:apply-templates/> |
31 |
<xsl:apply-templates/> |
32 |
</oai_dc:dc> |
32 |
</oai_dc:dc> |
33 |
</xsl:if> |
33 |
</xsl:if> |
34 |
</xsl:template> |
34 |
</xsl:template> |
35 |
<xsl:template match="marc:record"> |
35 |
<xsl:template match="marc:record"> |
36 |
<xsl:variable name="leader" select="marc:leader"/> |
36 |
<xsl:for-each select="marc:datafield[@tag=200]"> |
37 |
<xsl:variable name="leader6" select="substring($leader,7,1)"/> |
37 |
<dc:title> |
38 |
<xsl:variable name="leader7" select="substring($leader,8,1)"/> |
38 |
<xsl:call-template name="subfieldSelect"> |
39 |
<xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/> |
39 |
<xsl:with-param name="codes">a</xsl:with-param> |
40 |
|
40 |
</xsl:call-template> |
41 |
<xsl:for-each select="marc:datafield[@tag=200]"> |
41 |
</dc:title> |
42 |
<dc:title> |
42 |
</xsl:for-each> |
43 |
<xsl:call-template name="subfieldSelect"> |
43 |
<xsl:for-each select="marc:datafield[@tag=700]|marc:datafield[@tag=701]|marc:datafield[@tag=702]|marc:datafield[@tag=710]|marc:datafield[@tag=711]|marc:datafield[@tag=712]"> |
44 |
<xsl:with-param name="codes">a</xsl:with-param> |
44 |
<dc:creator> |
45 |
</xsl:call-template> |
45 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
46 |
</dc:title> |
46 |
<xsl:if test="marc:subfield[@code='b']"> |
47 |
</xsl:for-each> |
47 |
<xsl:text>, </xsl:text> |
48 |
<xsl:for-each select="marc:datafield[@tag=700]|marc:datafield[@tag=701]|marc:datafield[@tag=702]|marc:datafield[@tag=710]|marc:datafield[@tag=711]|marc:datafield[@tag=712]"> |
48 |
<xsl:value-of select="marc:subfield[@code='b']"/> |
49 |
<dc:creator> |
49 |
</xsl:if> |
50 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
50 |
<xsl:choose> |
51 |
<xsl:if test="marc:subfield[@code='b']"> |
51 |
<xsl:when test="marc:subfield[@code='4']='010'">, adapter</xsl:when> |
52 |
<xsl:text>, </xsl:text> |
52 |
<xsl:when test="marc:subfield[@code='4']='020'">, annotator</xsl:when> |
53 |
<xsl:value-of select="marc:subfield[@code='b']"/> |
53 |
<xsl:when test="marc:subfield[@code='4']='075'">, author of afterword</xsl:when> |
54 |
</xsl:if> |
54 |
<xsl:when test="marc:subfield[@code='4']='080'">, prefacer</xsl:when> |
55 |
<xsl:choose> |
55 |
<xsl:when test="marc:subfield[@code='4']='100'">, bibliographic antecedent</xsl:when> |
56 |
<xsl:when test="marc:subfield[@code='4']='010'">, adapter</xsl:when> |
56 |
<xsl:when test="marc:subfield[@code='4']='205'">, collaborator</xsl:when> |
57 |
<xsl:when test="marc:subfield[@code='4']='020'">, annotator</xsl:when> |
57 |
<xsl:when test="marc:subfield[@code='4']='212'">, commentator</xsl:when> |
58 |
<xsl:when test="marc:subfield[@code='4']='075'">, author of afterword</xsl:when> |
58 |
<xsl:when test="marc:subfield[@code='4']='220'">, compiler</xsl:when> |
59 |
<xsl:when test="marc:subfield[@code='4']='080'">, prefacer</xsl:when> |
59 |
<xsl:when test="marc:subfield[@code='4']='230'">, composer</xsl:when> |
60 |
<xsl:when test="marc:subfield[@code='4']='100'">, bibliographic antecedent</xsl:when> |
60 |
<xsl:when test="marc:subfield[@code='4']='245'">, conceptor</xsl:when> |
61 |
<xsl:when test="marc:subfield[@code='4']='205'">, collaborator</xsl:when> |
61 |
<xsl:when test="marc:subfield[@code='4']='295'">, degree-grantor</xsl:when> |
62 |
<xsl:when test="marc:subfield[@code='4']='212'">, commentator</xsl:when> |
62 |
<xsl:when test="marc:subfield[@code='4']='340'">, editor</xsl:when> |
63 |
<xsl:when test="marc:subfield[@code='4']='220'">, compiler</xsl:when> |
63 |
<xsl:when test="marc:subfield[@code='4']='370'">, film editor</xsl:when> |
64 |
<xsl:when test="marc:subfield[@code='4']='230'">, composer</xsl:when> |
64 |
<xsl:when test="marc:subfield[@code='4']='395'">, founder</xsl:when> |
65 |
<xsl:when test="marc:subfield[@code='4']='245'">, conceptor</xsl:when> |
65 |
<xsl:when test="marc:subfield[@code='4']='440'">, illustrator</xsl:when> |
66 |
<xsl:when test="marc:subfield[@code='4']='295'">, degree-grantor</xsl:when> |
66 |
<xsl:when test="marc:subfield[@code='4']='520'">, lyricist</xsl:when> |
67 |
<xsl:when test="marc:subfield[@code='4']='340'">, editor</xsl:when> |
67 |
<xsl:when test="marc:subfield[@code='4']='557'">, organiser of meeting</xsl:when> |
68 |
<xsl:when test="marc:subfield[@code='4']='370'">, film editor</xsl:when> |
68 |
<xsl:when test="marc:subfield[@code='4']='570'">, other</xsl:when> |
69 |
<xsl:when test="marc:subfield[@code='4']='395'">, founder</xsl:when> |
69 |
<xsl:when test="marc:subfield[@code='4']='600'">, photographer</xsl:when> |
70 |
<xsl:when test="marc:subfield[@code='4']='440'">, illustrator</xsl:when> |
70 |
<xsl:when test="marc:subfield[@code='4']='605'">, presenter</xsl:when> |
71 |
<xsl:when test="marc:subfield[@code='4']='520'">, lyricist</xsl:when> |
71 |
<xsl:when test="marc:subfield[@code='4']='650'">, publisher</xsl:when> |
72 |
<xsl:when test="marc:subfield[@code='4']='557'">, organiser of meeting</xsl:when> |
72 |
<xsl:when test="marc:subfield[@code='4']='651'">, publishing director</xsl:when> |
73 |
<xsl:when test="marc:subfield[@code='4']='570'">, other</xsl:when> |
73 |
<xsl:when test="marc:subfield[@code='4']='673'">, research team head</xsl:when> |
74 |
<xsl:when test="marc:subfield[@code='4']='600'">, photographer</xsl:when> |
74 |
<xsl:when test="marc:subfield[@code='4']='675'">, reviewer</xsl:when> |
75 |
<xsl:when test="marc:subfield[@code='4']='605'">, presenter</xsl:when> |
75 |
<xsl:when test="marc:subfield[@code='4']='710'">, redactor</xsl:when> |
76 |
<xsl:when test="marc:subfield[@code='4']='650'">, publisher</xsl:when> |
76 |
<xsl:when test="marc:subfield[@code='4']='723'">, sponsor</xsl:when> |
77 |
<xsl:when test="marc:subfield[@code='4']='651'">, publishing director</xsl:when> |
77 |
<xsl:when test="marc:subfield[@code='4']='727'">, thesis advisor</xsl:when> |
78 |
<xsl:when test="marc:subfield[@code='4']='673'">, research team head</xsl:when> |
78 |
<xsl:when test="marc:subfield[@code='4']='730'">, translator</xsl:when> |
79 |
<xsl:when test="marc:subfield[@code='4']='675'">, reviewer</xsl:when> |
79 |
</xsl:choose> |
80 |
<xsl:when test="marc:subfield[@code='4']='710'">, redactor</xsl:when> |
80 |
</dc:creator> |
81 |
<xsl:when test="marc:subfield[@code='4']='723'">, sponsor</xsl:when> |
81 |
</xsl:for-each> |
82 |
<xsl:when test="marc:subfield[@code='4']='727'">, thesis advisor</xsl:when> |
82 |
<dc:type> |
83 |
<xsl:when test="marc:subfield[@code='4']='730'">, translator</xsl:when> |
83 |
<xsl:value-of select="marc:datafield[@tag=200]/marc:subfield[@code='b']"/> |
84 |
</xsl:choose> |
84 |
</dc:type> |
85 |
</dc:creator> |
85 |
<xsl:for-each select="marc:datafield[@tag=210]/marc:subfield[@code='c']"> |
86 |
</xsl:for-each> |
86 |
<dc:publisher> |
87 |
<dc:type> |
87 |
<xsl:value-of select="."/> |
88 |
<xsl:value-of select="marc:datafield[@tag=200]/marc:subfield[@code='b']"/> |
88 |
</dc:publisher> |
89 |
</dc:type> |
89 |
</xsl:for-each> |
90 |
<xsl:for-each select="marc:datafield[@tag=210]/marc:subfield[@code='c']"> |
90 |
<xsl:for-each select="marc:datafield[@tag=210]/marc:subfield[@code='d']"> |
91 |
<dc:publisher> |
91 |
<dc:date> |
92 |
<xsl:value-of select="."/> |
92 |
<xsl:value-of select="."/> |
93 |
</dc:publisher> |
93 |
</dc:date> |
94 |
</xsl:for-each> |
94 |
</xsl:for-each> |
95 |
<xsl:for-each select="marc:datafield[@tag=210]/marc:subfield[@code='d']"> |
95 |
<xsl:for-each select="marc:datafield[@tag=101]/marc:subfield[@code='a']"> |
96 |
<dc:date> |
96 |
<dc:language> |
97 |
<xsl:value-of select="."/> |
97 |
<xsl:value-of select="."/> |
98 |
</dc:date> |
98 |
</dc:language> |
99 |
</xsl:for-each> |
99 |
</xsl:for-each> |
100 |
<xsl:for-each select="marc:datafield[@tag=101]/marc:subfield[@code='a']"> |
100 |
<xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q']"> |
101 |
<dc:language> |
101 |
<dc:format> |
102 |
<xsl:value-of select="."/> |
102 |
<xsl:value-of select="."/> |
103 |
</dc:language> |
103 |
</dc:format> |
104 |
</xsl:for-each> |
104 |
</xsl:for-each> |
105 |
<xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q']"> |
105 |
<xsl:for-each select="marc:datafield[@tag=520]"> |
106 |
<dc:format> |
106 |
<dc:description> |
107 |
<xsl:value-of select="."/> |
107 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
108 |
</dc:format> |
108 |
</dc:description> |
109 |
</xsl:for-each> |
109 |
</xsl:for-each> |
110 |
<xsl:for-each select="marc:datafield[@tag=520]"> |
110 |
<xsl:for-each select="marc:datafield[@tag=521]"> |
111 |
<dc:description> |
111 |
<dc:description> |
112 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
112 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
113 |
</dc:description> |
113 |
</dc:description> |
114 |
</xsl:for-each> |
114 |
</xsl:for-each> |
115 |
<xsl:for-each select="marc:datafield[@tag=521]"> |
115 |
<xsl:for-each select="marc:datafield[300<@tag][@tag<=345]"> |
116 |
<dc:description> |
116 |
<dc:description> |
117 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
117 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
118 |
</dc:description> |
118 |
</dc:description> |
119 |
</xsl:for-each> |
119 |
</xsl:for-each> |
120 |
<xsl:for-each select="marc:datafield[300<@tag][@tag<=345]"> |
120 |
<xsl:for-each select="marc:datafield[@tag=600]|marc:datafield[@tag=601]|marc:datafield[@tag=602]|marc:datafield[@tag=604]|marc:datafield[@tag=605]|marc:datafield[@tag=606]"> |
121 |
<dc:description> |
121 |
<dc:subject> |
122 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
122 |
<xsl:call-template name="subfieldSelect"> |
123 |
</dc:description> |
123 |
<xsl:with-param name="codes">abcdq</xsl:with-param> |
124 |
</xsl:for-each> |
124 |
</xsl:call-template> |
125 |
<xsl:for-each select="marc:datafield[@tag=600]|marc:datafield[@tag=601]|marc:datafield[@tag=602]|marc:datafield[@tag=604]|marc:datafield[@tag=605]|marc:datafield[@tag=606]"> |
125 |
</dc:subject> |
126 |
<dc:subject> |
126 |
</xsl:for-each> |
127 |
<xsl:call-template name="subfieldSelect"> |
127 |
<xsl:for-each select="marc:datafield[@tag=752]"> |
128 |
<xsl:with-param name="codes">abcdq</xsl:with-param> |
128 |
<dc:coverage> |
129 |
</xsl:call-template> |
129 |
<xsl:call-template name="subfieldSelect"> |
130 |
</dc:subject> |
130 |
<xsl:with-param name="codes">abcd</xsl:with-param> |
131 |
</xsl:for-each> |
131 |
</xsl:call-template> |
132 |
<xsl:for-each select="marc:datafield[@tag=752]"> |
132 |
</dc:coverage> |
133 |
<dc:coverage> |
133 |
</xsl:for-each> |
134 |
<xsl:call-template name="subfieldSelect"> |
134 |
<xsl:for-each select="marc:datafield[@tag=530]"> |
135 |
<xsl:with-param name="codes">abcd</xsl:with-param> |
135 |
<dc:relation type="original"> |
136 |
</xsl:call-template> |
136 |
<xsl:call-template name="subfieldSelect"> |
137 |
</dc:coverage> |
137 |
<xsl:with-param name="codes">abcdu</xsl:with-param> |
138 |
</xsl:for-each> |
138 |
</xsl:call-template> |
139 |
<xsl:for-each select="marc:datafield[@tag=530]"> |
139 |
</dc:relation> |
140 |
<dc:relation type="original"> |
140 |
</xsl:for-each> |
141 |
<xsl:call-template name="subfieldSelect"> |
141 |
<xsl:for-each select="marc:datafield[@tag=461]|marc:datafield[@tag=464]"> |
142 |
<xsl:with-param name="codes">abcdu</xsl:with-param> |
142 |
<dc:relation> |
143 |
</xsl:call-template> |
143 |
<xsl:call-template name="subfieldSelect"> |
144 |
</dc:relation> |
144 |
<xsl:with-param name="codes">t</xsl:with-param> |
145 |
</xsl:for-each> |
145 |
</xsl:call-template> |
146 |
<xsl:for-each select="marc:datafield[@tag=461]|marc:datafield[@tag=464]"> |
146 |
</dc:relation> |
147 |
<dc:relation> |
147 |
</xsl:for-each> |
148 |
<xsl:call-template name="subfieldSelect"> |
148 |
<xsl:for-each select="marc:datafield[@tag=856]"> |
149 |
<xsl:with-param name="codes">t</xsl:with-param> |
149 |
<dc:identifier> |
150 |
</xsl:call-template> |
150 |
<xsl:value-of select="marc:subfield[@code='u']"/> |
151 |
</dc:relation> |
151 |
</dc:identifier> |
152 |
</xsl:for-each> |
152 |
</xsl:for-each> |
153 |
<xsl:for-each select="marc:datafield[@tag=856]"> |
153 |
<xsl:for-each select="marc:datafield[@tag=010]"> |
154 |
<dc:identifier> |
154 |
<dc:identifier> |
155 |
<xsl:value-of select="marc:subfield[@code='u']"/> |
155 |
<xsl:text>URN:ISBN:</xsl:text> |
156 |
</dc:identifier> |
156 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
157 |
</xsl:for-each> |
157 |
</dc:identifier> |
158 |
<xsl:for-each select="marc:datafield[@tag=010]"> |
158 |
</xsl:for-each> |
159 |
<dc:identifier> |
159 |
<xsl:for-each select="marc:datafield[@tag=011]"> |
160 |
<xsl:text>URN:ISBN:</xsl:text> |
160 |
<dc:identifier> |
161 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
161 |
<xsl:text>URN:ISSN:</xsl:text> |
162 |
</dc:identifier> |
162 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
163 |
</xsl:for-each> |
163 |
</dc:identifier> |
164 |
<xsl:for-each select="marc:datafield[@tag=011]"> |
164 |
</xsl:for-each> |
165 |
<dc:identifier> |
165 |
<xsl:for-each select="marc:datafield[@tag=090]"> |
166 |
<xsl:text>URN:ISSN:</xsl:text> |
166 |
<dc:identifier> |
167 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
167 |
<xsl:text>http://opac.mylibrary.org/bib/</xsl:text> |
168 |
</dc:identifier> |
168 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
169 |
</xsl:for-each> |
169 |
</dc:identifier> |
170 |
<xsl:for-each select="marc:datafield[@tag=090]"> |
170 |
</xsl:for-each> |
171 |
<dc:identifier> |
171 |
<xsl:for-each select="marc:datafield[@tag=995]"> |
172 |
<xsl:text>http://opac.mylibrary.org/bib/</xsl:text> |
172 |
<dc:identifier> |
173 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
173 |
<xsl:text>LOC:</xsl:text> |
174 |
</dc:identifier> |
174 |
<xsl:choose> |
175 |
</xsl:for-each> |
175 |
<xsl:when test="marc:subfield[@code='c']='MAIN'">Main Branch</xsl:when> |
176 |
<xsl:for-each select="marc:datafield[@tag=995]"> |
176 |
<xsl:when test="marc:subfield[@code='c']='BIB2'">Library 2</xsl:when> |
177 |
<dc:identifier> |
177 |
</xsl:choose> |
178 |
<xsl:text>LOC:</xsl:text> |
178 |
<xsl:foreach select="marc:subfield[@code='k']"> |
179 |
<xsl:choose> |
179 |
<xsl:text>:</xsl:text> |
180 |
<xsl:when test="marc:subfield[@code='c']='MAIN'">Main Branch</xsl:when> |
180 |
<xsl:value-of select="."/> |
181 |
<xsl:when test="marc:subfield[@code='c']='BIB2'">Library 2</xsl:when> |
181 |
</xsl:foreach> |
182 |
</xsl:choose> |
182 |
</dc:identifier> |
183 |
<xsl:foreach select="marc:subfield[@code='k']"> |
183 |
</xsl:for-each> |
184 |
<xsl:text>:</xsl:text> |
184 |
</xsl:template> |
185 |
<xsl:value-of select="."/> |
|
|
186 |
</xsl:foreach> |
187 |
</dc:identifier> |
188 |
</xsl:for-each> |
189 |
</xsl:template> |
190 |
</xsl:stylesheet> |
185 |
</xsl:stylesheet> |
191 |
- |
|
|