Bug 26150: Remove the use of jquery.checkboxes plugin from inventory page
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / xslt / UNIMARCslim2intranetDetail.xsl
blob5f6e2b1782271168085f2555115246ef5d44f8e3
1 <?xml version="1.0" encoding="UTF-8"?>
3 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
5 <xsl:stylesheet version="1.0"
6 xmlns:marc="http://www.loc.gov/MARC21/slim"
7 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8 xmlns:str="http://exslt.org/strings"
9 exclude-result-prefixes="marc str">
11 <xsl:import href="UNIMARCslimUtils.xsl"/>
12 <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13 <xsl:template match="/">
14 <xsl:apply-templates/>
15 </xsl:template>
17 <xsl:template match="marc:record">
18 <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
19 <xsl:variable name="leader" select="marc:leader"/>
20 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
21 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
22 <xsl:variable name="biblionumber" select="marc:controlfield[@tag=001]"/>
25 <xsl:if test="marc:datafield[@tag=200]">
26 <xsl:for-each select="marc:datafield[@tag=200]">
27 <h1>
28 <xsl:call-template name="addClassRtl" />
29 <xsl:variable name="title" select="marc:subfield[@code='a']"/>
30 <xsl:variable name="ntitle"
31 select="translate($title, '&#x0098;&#x009C;&#xC29C;&#xC29B;&#xC298;&#xC288;&#xC289;','')"/>
32 <xsl:value-of select="$ntitle" />
33 <xsl:if test="marc:subfield[@code='e']">
34 <xsl:text> : </xsl:text>
35 <xsl:for-each select="marc:subfield[@code='e']">
36 <xsl:value-of select="."/>
37 </xsl:for-each>
38 </xsl:if>
39 <xsl:if test="marc:subfield[@code='b']">
40 <xsl:text> [</xsl:text>
41 <xsl:value-of select="marc:subfield[@code='b']"/>
42 <xsl:text>]</xsl:text>
43 </xsl:if>
44 <xsl:if test="marc:subfield[@code='f']">
45 <xsl:text> / </xsl:text>
46 <xsl:value-of select="marc:subfield[@code='f']"/>
47 </xsl:if>
48 <xsl:if test="marc:subfield[@code='g']">
49 <xsl:text> ; </xsl:text>
50 <xsl:value-of select="marc:subfield[@code='g']"/>
51 </xsl:if>
52 </h1>
53 </xsl:for-each>
54 </xsl:if>
55 <xsl:call-template name="tag_4xx" />
57 <xsl:call-template name="tag_7xx">
58 <xsl:with-param name="tag">700</xsl:with-param>
59 <xsl:with-param name="label">Main Author</xsl:with-param>
60 </xsl:call-template>
62 <xsl:call-template name="tag_7xx">
63 <xsl:with-param name="tag">710</xsl:with-param>
64 <xsl:with-param name="label">Corporate Author (Main)</xsl:with-param>
65 </xsl:call-template>
67 <xsl:call-template name="tag_7xx">
68 <xsl:with-param name="tag">701</xsl:with-param>
69 <xsl:with-param name="label">Coauthor</xsl:with-param>
70 </xsl:call-template>
72 <xsl:call-template name="tag_7xx">
73 <xsl:with-param name="tag">702</xsl:with-param>
74 <xsl:with-param name="label">Secondary Author</xsl:with-param>
75 </xsl:call-template>
77 <xsl:call-template name="tag_7xx">
78 <xsl:with-param name="tag">711</xsl:with-param>
79 <xsl:with-param name="label">Corporate Author (Coauthor)</xsl:with-param>
80 </xsl:call-template>
82 <xsl:call-template name="tag_7xx">
83 <xsl:with-param name="tag">712</xsl:with-param>
84 <xsl:with-param name="label">Corporate Author (Secondary)</xsl:with-param>
85 </xsl:call-template>
87 <xsl:if test="marc:datafield[@tag=101]">
88 <li>
89 <strong>Language: </strong>
90 <xsl:for-each select="marc:datafield[@tag=101]">
91 <xsl:for-each select="marc:subfield">
92 <xsl:choose>
93 <xsl:when test="@code='b'">of intermediate text, </xsl:when>
94 <xsl:when test="@code='c'">of original work, </xsl:when>
95 <xsl:when test="@code='d'">of summary, </xsl:when>
96 <xsl:when test="@code='e'">of contents page, </xsl:when>
97 <xsl:when test="@code='f'">of title page, </xsl:when>
98 <xsl:when test="@code='g'">of title proper, </xsl:when>
99 <xsl:when test="@code='h'">of libretto, </xsl:when>
100 <xsl:when test="@code='i'">of accompanying material, </xsl:when>
101 <xsl:when test="@code='j'">of subtitles, </xsl:when>n>
102 </xsl:choose>
103 <xsl:value-of select="text()"/>
104 <xsl:choose>
105 <xsl:when test="position()=last()">
106 <xsl:text>.</xsl:text>
107 </xsl:when>
108 <xsl:otherwise>
109 <xsl:text> ; </xsl:text>
110 </xsl:otherwise>
111 </xsl:choose>
112 </xsl:for-each>
113 </xsl:for-each>
114 </li>
115 </xsl:if>
117 <xsl:if test="marc:datafield[@tag=102]">
118 <li>
119 <strong>Country: </strong>
120 <xsl:for-each select="marc:datafield[@tag=102]">
121 <xsl:for-each select="marc:subfield">
122 <xsl:value-of select="text()"/>
123 <xsl:choose>
124 <xsl:when test="position()=last()">
125 <xsl:text>.</xsl:text>
126 </xsl:when>
127 <xsl:otherwise><xsl:text>, </xsl:text>
128 </xsl:otherwise>
129 </xsl:choose>
130 </xsl:for-each>
131 </xsl:for-each>
132 </li>
133 </xsl:if>
135 <xsl:call-template name="tag_210" />
137 <xsl:call-template name="tag_215" />
139 <xsl:if test="marc:controlfield[@tag=009]">
140 <li><strong>Tag 009: </strong>
141 <xsl:value-of select="marc:controlfield[@tag=009]"/>
142 </li>
143 </xsl:if>
145 <!-- Build ISBN -->
146 <xsl:if test="marc:datafield[@tag=010]/marc:subfield[@code='a']">
147 <li><strong>ISBN: </strong>
148 <xsl:for-each select="marc:datafield[@tag=010]/marc:subfield[@code='a']">
149 <span property="isbn">
150 <xsl:value-of select="."/>
151 <xsl:choose>
152 <xsl:when test="position()=last()">
153 <xsl:text>.</xsl:text>
154 </xsl:when>
155 <xsl:otherwise>
156 <xsl:text>; </xsl:text>
157 </xsl:otherwise>
158 </xsl:choose>
159 </span>
160 </xsl:for-each>
161 </li>
162 </xsl:if>
164 <!-- Build ISSN -->
165 <xsl:if test="marc:datafield[@tag=011]/marc:subfield[@code='a']">
166 <li>
167 <strong>ISSN: </strong>
168 <xsl:for-each select="marc:datafield[@tag=011]/marc:subfield[@code='a']">
169 <span property="issn">
170 <xsl:value-of select="."/>
171 <xsl:choose>
172 <xsl:when test="position()=last()">
173 <xsl:text>.</xsl:text>
174 </xsl:when>
175 <xsl:otherwise>
176 <xsl:text>; </xsl:text>
177 </xsl:otherwise>
178 </xsl:choose>
179 </span>
180 </xsl:for-each>
181 </li>
182 </xsl:if>
184 <xsl:call-template name="tag_title">
185 <xsl:with-param name="tag">225</xsl:with-param>
186 <xsl:with-param name="label">Series</xsl:with-param>
187 </xsl:call-template>
189 <xsl:if test="marc:datafield[@tag=676]">
190 <li>
191 <strong>Dewey: </strong>
192 <xsl:for-each select="marc:datafield[@tag=676]">
193 <xsl:value-of select="marc:subfield[@code='a']"/>
194 <xsl:if test="marc:subfield[@code='v']">
195 <xsl:text>, </xsl:text>
196 <xsl:value-of select="marc:subfield[@code='v']"/>
197 </xsl:if>
198 <xsl:if test="marc:subfield[@code='z']">
199 <xsl:text>, </xsl:text>
200 <xsl:value-of select="marc:subfield[@code='z']"/>
201 </xsl:if>
202 <xsl:if test="not (position()=last())">
203 <xsl:text> ; </xsl:text>
204 </xsl:if>
205 </xsl:for-each>
206 </li>
207 </xsl:if>
209 <xsl:if test="marc:datafield[@tag=686]">
210 <li>
211 <strong>Classification: </strong>
212 <xsl:for-each select="marc:datafield[@tag=686]">
213 <xsl:value-of select="marc:subfield[@code='a']"/>
214 <xsl:if test="marc:subfield[@code='b']">
215 <xsl:text>, </xsl:text>
216 <xsl:value-of select="marc:subfield[@code='b']"/>
217 </xsl:if>
218 <xsl:if test="marc:subfield[@code='c']">
219 <xsl:text>, </xsl:text>
220 <xsl:value-of select="marc:subfield[@code='c']"/>
221 </xsl:if>
222 <xsl:if test="not (position()=last())"><xsl:text> ; </xsl:text></xsl:if>
223 </xsl:for-each>
224 </li>
225 </xsl:if>
227 <xsl:if test="marc:datafield[@tag=327]">
228 <li>
229 <strong>Contents note: </strong>
230 <xsl:for-each select="marc:datafield[@tag=327]">
231 <xsl:call-template name="chopPunctuation">
232 <xsl:with-param name="chopString">
233 <xsl:call-template name="subfieldSelect">
234 <xsl:with-param name="codes">abcdjpvxyz</xsl:with-param>
235 <xsl:with-param name="subdivCodes">jpxyz</xsl:with-param>
236 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
237 </xsl:call-template>
238 </xsl:with-param>
239 </xsl:call-template>
240 </xsl:for-each>
241 </li>
242 </xsl:if>
244 <xsl:if test="marc:datafield[@tag=330]">
245 <li>
246 <strong>Abstract: </strong>
247 <xsl:for-each select="marc:datafield[@tag=330]">
248 <xsl:value-of select="marc:subfield[@code='a']"/>
249 <xsl:choose>
250 <xsl:when test="position()=last()">
251 <xsl:text>.</xsl:text>
252 </xsl:when>
253 <xsl:otherwise>
254 <xsl:text>; </xsl:text>
255 </xsl:otherwise>
256 </xsl:choose>
257 </xsl:for-each>
258 </li>
259 </xsl:if>
261 <xsl:if test="marc:datafield[@tag=317]">
262 <li>
263 <strong>Provenance note: </strong>
264 <xsl:for-each select="marc:datafield[@tag=317]">
265 <xsl:value-of select="marc:subfield[@code='a']"/>
266 </xsl:for-each>
267 </li>
268 </xsl:if>
270 <xsl:if test="marc:datafield[@tag=320]">
271 <li>
272 <strong>Bibliography: </strong>
273 <xsl:for-each select="marc:datafield[@tag=320]">
274 <xsl:value-of select="marc:subfield[@code='a']"/>
275 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
276 </xsl:for-each>
277 </li>
278 </xsl:if>
280 <xsl:if test="marc:datafield[@tag=328]">
281 <li>
282 <strong>Thesis: </strong>
283 <xsl:for-each select="marc:datafield[@tag=328]">
284 <xsl:value-of select="marc:subfield[@code='a']"/>
285 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
286 </xsl:for-each>
287 </li>
288 </xsl:if>
290 <xsl:if test="marc:datafield[@tag=333]">
291 <li>
292 <strong>Audience: </strong>
293 <xsl:for-each select="marc:datafield[@tag=333]">
294 <xsl:value-of select="marc:subfield[@code='a']"/>
295 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
296 </xsl:for-each>
297 </li>
298 </xsl:if>
300 <xsl:if test="marc:datafield[@tag=955]">
301 <li>
302 <strong>SUDOC serial history: </strong>
303 <xsl:for-each select="marc:datafield[@tag=955]">
304 <xsl:value-of select="marc:subfield[@code='9']"/>:
305 <xsl:value-of select="marc:subfield[@code='r']"/>
306 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
307 </xsl:for-each>
308 </li>
309 </xsl:if>
311 <xsl:call-template name="tag_subject">
312 <xsl:with-param name="tag">600</xsl:with-param>
313 <xsl:with-param name="label">Subject - Personal Name</xsl:with-param>
314 </xsl:call-template>
316 <xsl:call-template name="tag_subject">
317 <xsl:with-param name="tag">601</xsl:with-param>
318 <xsl:with-param name="label">Subject - Corporate Author</xsl:with-param>
319 </xsl:call-template>
321 <xsl:call-template name="tag_subject">
322 <xsl:with-param name="tag">602</xsl:with-param>
323 <xsl:with-param name="label">Subject - Family</xsl:with-param>
324 </xsl:call-template>
326 <xsl:call-template name="tag_subject">
327 <xsl:with-param name="tag">604</xsl:with-param>
328 <xsl:with-param name="label">Subject - Author/Title</xsl:with-param>
329 </xsl:call-template>
331 <xsl:call-template name="tag_subject">
332 <xsl:with-param name="tag">606</xsl:with-param>
333 <xsl:with-param name="label">Subject - Topical Name</xsl:with-param>
334 </xsl:call-template>
336 <xsl:call-template name="tag_subject">
337 <xsl:with-param name="tag">607</xsl:with-param>
338 <xsl:with-param name="label">Subject - Geographical Name</xsl:with-param>
339 </xsl:call-template>
341 <xsl:call-template name="tag_subject">
342 <xsl:with-param name="tag">608</xsl:with-param>
343 <xsl:with-param name="label">Subject - Form</xsl:with-param>
344 </xsl:call-template>
346 <xsl:call-template name="tag_subject">
347 <xsl:with-param name="tag">610</xsl:with-param>
348 <xsl:with-param name="label">Subject</xsl:with-param>
349 </xsl:call-template>
351 <xsl:call-template name="tag_subject">
352 <xsl:with-param name="tag">615</xsl:with-param>
353 <xsl:with-param name="label">Subject Category</xsl:with-param>
354 </xsl:call-template>
356 <xsl:call-template name="tag_subject">
357 <xsl:with-param name="tag">616</xsl:with-param>
358 <xsl:with-param name="label">Trademark</xsl:with-param>
359 </xsl:call-template>
361 <xsl:if test="marc:datafield[@tag=856]">
362 <li>
363 <strong>Online Resources: </strong>
364 <xsl:for-each select="marc:datafield[@tag=856]">
365 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
367 <xsl:attribute name="href">
368 <xsl:value-of select="marc:subfield[@code='u']"/>
369 </xsl:attribute>
370 <xsl:choose>
371 <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')">
372 <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text>
373 </xsl:when>
374 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
375 <xsl:call-template name="subfieldSelect">
376 <xsl:with-param name="codes">y3z</xsl:with-param>
377 </xsl:call-template>
378 </xsl:when>
379 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
380 Click here to access online
381 </xsl:when>
382 </xsl:choose>
383 </a>
384 <xsl:choose>
385 <xsl:when test="position()=last()"></xsl:when>
386 <xsl:otherwise> | </xsl:otherwise>
387 </xsl:choose>
388 </xsl:for-each>
389 </li>
390 </xsl:if>
391 </xsl:template>
393 <xsl:template name="nameABCDQ">
394 <xsl:call-template name="chopPunctuation">
395 <xsl:with-param name="chopString">
396 <xsl:call-template name="subfieldSelect">
397 <xsl:with-param name="codes">aq</xsl:with-param>
398 </xsl:call-template>
399 </xsl:with-param>
400 <xsl:with-param name="punctuation">
401 <xsl:text>:,;/ </xsl:text>
402 </xsl:with-param>
403 </xsl:call-template>
404 <xsl:call-template name="termsOfAddress"/>
405 </xsl:template>
407 <xsl:template name="nameABCDN">
408 <xsl:for-each select="marc:subfield[@code='a']">
409 <xsl:call-template name="chopPunctuation">
410 <xsl:with-param name="chopString" select="."/>
411 </xsl:call-template>
412 </xsl:for-each>
413 <xsl:for-each select="marc:subfield[@code='b']">
414 <xsl:value-of select="."/>
415 </xsl:for-each>
416 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
417 <xsl:call-template name="subfieldSelect">
418 <xsl:with-param name="codes">cdn</xsl:with-param>
419 </xsl:call-template>
420 </xsl:if>
421 </xsl:template>
423 <xsl:template name="nameACDEQ">
424 <xsl:call-template name="subfieldSelect">
425 <xsl:with-param name="codes">acdeq</xsl:with-param>
426 </xsl:call-template>
427 </xsl:template>
428 <xsl:template name="termsOfAddress">
429 <xsl:if test="marc:subfield[@code='b' or @code='c']">
430 <xsl:call-template name="chopPunctuation">
431 <xsl:with-param name="chopString">
432 <xsl:call-template name="subfieldSelect">
433 <xsl:with-param name="codes">bc</xsl:with-param>
434 </xsl:call-template>
435 </xsl:with-param>
436 </xsl:call-template>
437 </xsl:if>
438 </xsl:template>
440 <xsl:template name="part">
441 <xsl:variable name="partNumber">
442 <xsl:call-template name="specialSubfieldSelect">
443 <xsl:with-param name="axis">n</xsl:with-param>
444 <xsl:with-param name="anyCodes">n</xsl:with-param>
445 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
446 </xsl:call-template>
447 </xsl:variable>
448 <xsl:variable name="partName">
449 <xsl:call-template name="specialSubfieldSelect">
450 <xsl:with-param name="axis">p</xsl:with-param>
451 <xsl:with-param name="anyCodes">p</xsl:with-param>
452 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
453 </xsl:call-template>
454 </xsl:variable>
455 <xsl:if test="string-length(normalize-space($partNumber))">
456 <xsl:call-template name="chopPunctuation">
457 <xsl:with-param name="chopString" select="$partNumber"/>
458 </xsl:call-template>
459 </xsl:if>
460 <xsl:if test="string-length(normalize-space($partName))">
461 <xsl:call-template name="chopPunctuation">
462 <xsl:with-param name="chopString" select="$partName"/>
463 </xsl:call-template>
464 </xsl:if>
465 </xsl:template>
467 <xsl:template name="specialSubfieldSelect">
468 <xsl:param name="anyCodes"/>
469 <xsl:param name="axis"/>
470 <xsl:param name="beforeCodes"/>
471 <xsl:param name="afterCodes"/>
472 <xsl:variable name="str">
473 <xsl:for-each select="marc:subfield">
474 <xsl:if test="contains($anyCodes, @code) or (contains($beforeCodes,@code) and following-sibling::marc:subfield[@code=$axis]) or (contains($afterCodes,@code) and preceding-sibling::marc:subfield[@code=$axis])">
475 <xsl:value-of select="text()"/>
476 <xsl:text> </xsl:text>
477 </xsl:if>
478 </xsl:for-each>
479 </xsl:variable>
480 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
481 </xsl:template>
483 </xsl:stylesheet>