View | Details | Raw Unified | Return to bug 37196
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21_245.xsl (+97 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
3
<!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com  -->
4
<!DOCTYPE stylesheet>
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">
10
11
<xsl:template name="show-title-245">
12
    <!-- get leader 18: -->
13
    <xsl:variable name="leader" select="marc:leader"/>
14
    <xsl:variable name="leader18" select="substring($leader,19,1)"/>
15
    <!-- if $leader18 == c or n: add punctuation -->
16
17
    <!--Bug 13381 -->
18
    <xsl:if test="marc:datafield[@tag=245]">
19
        <!--
20
        <h1 class="title" property="name">
21
        -->
22
            <xsl:for-each select="marc:datafield[@tag=245]">
23
                <xsl:call-template name="subfieldSelect">
24
                    <xsl:with-param name="codes">a</xsl:with-param>
25
                </xsl:call-template>
26
                <xsl:text> </xsl:text>
27
                <!-- 13381 add additional subfields-->
28
                <!-- bug17625 adding f and g subfields -->
29
                <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
30
                    <xsl:choose>
31
                        <xsl:when test="@code='b'">
32
                            <!--  13381 Span class around subfield h so it can be suppressed via css -->
33
                            <span class="title_remainder">
34
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text> : </xsl:text> </xsl:if>
35
                            <xsl:apply-templates/> <xsl:text> </xsl:text> </span>
36
                        </xsl:when>
37
                        <xsl:when test="@code='c'">
38
                            <!--  13381 Span class around subfield c so it can be suppressed via css -->
39
                            <span class="title_resp_stmt">
40
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text> / </xsl:text> </xsl:if>
41
                            <xsl:apply-templates/> <xsl:text> </xsl:text> </span>
42
                        </xsl:when>
43
                        <xsl:when test="@code='f'">
44
                            <span class="title_incldat">
45
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>, </xsl:text> </xsl:if>
46
                            <xsl:apply-templates/></span>
47
                        </xsl:when>
48
                        <xsl:when test="@code='g'">
49
                            <span class="title_bulkdat">
50
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>, </xsl:text> </xsl:if>
51
                            <xsl:apply-templates/></span>
52
                        </xsl:when>
53
                        <xsl:when test="@code='h'">
54
                            <!--  13381 Span class around subfield h so it can be suppressed via css -->
55
                            <span class="title_medium">
56
                            <xsl:text> </xsl:text>
57
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>[</xsl:text> </xsl:if>
58
                            <xsl:apply-templates/>
59
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>]</xsl:text> </xsl:if>
60
                            </span>
61
                        </xsl:when>
62
63
                        <xsl:when test="@code='k'">
64
                            <span class="title_form">
65
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text> : </xsl:text> </xsl:if>
66
                            <xsl:apply-templates/> <xsl:text> </xsl:text> </span>
67
                        </xsl:when>
68
                        <xsl:when test="@code='n'">
69
                            <span class="title_n">
70
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text> : </xsl:text> </xsl:if>
71
                            <xsl:apply-templates/></span>
72
                        </xsl:when>
73
                        <xsl:when test="@code='p'">
74
                            <span class="title_p">
75
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>, </xsl:text> </xsl:if>
76
                            <xsl:apply-templates/></span>
77
                        </xsl:when>
78
                        <xsl:when test="@code='s'">
79
                            <span class="title_s">
80
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>. </xsl:text> </xsl:if>
81
                            <xsl:apply-templates/></span>
82
                        </xsl:when>
83
84
                        <xsl:otherwise>
85
                            <xsl:apply-templates/>
86
                            <xsl:text> </xsl:text>
87
                        </xsl:otherwise>
88
                    </xsl:choose>
89
                </xsl:for-each>
90
            </xsl:for-each>
91
            <!--
92
        </h1>
93
        -->
94
    </xsl:if>
95
</xsl:template>
96
97
</xsl:stylesheet>
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (-25 / +4 lines)
Lines 10-15 Link Here
10
  xmlns:str="http://exslt.org/strings"
10
  xmlns:str="http://exslt.org/strings"
11
  exclude-result-prefixes="marc str">
11
  exclude-result-prefixes="marc str">
12
    <xsl:import href="MARC21slimUtils.xsl"/>
12
    <xsl:import href="MARC21slimUtils.xsl"/>
13
    <xsl:include href="MARC21_245.xsl"/>
14
13
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
15
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14
    <xsl:template match="/">
16
    <xsl:template match="/">
15
            <xsl:apply-templates/>
17
            <xsl:apply-templates/>
Lines 110-142 Link Here
110
            </h1>
112
            </h1>
111
        </xsl:if>
113
        </xsl:if>
112
114
113
        <!--Bug 13381 -->
115
        <!-- Bug 37196 -->
114
        <xsl:if test="marc:datafield[@tag=245]">
116
        <xsl:if test="marc:datafield[@tag=245]">
115
            <h1 class="title" property="name">
117
            <h1 class="title" property="name">
116
                <xsl:for-each select="marc:datafield[@tag=245]">
118
            <xsl:call-template name="show-title-245"/>
117
                    <xsl:call-template name="subfieldSelect">
118
                        <xsl:with-param name="codes">a</xsl:with-param>
119
                    </xsl:call-template>
120
                    <xsl:text> </xsl:text>
121
                    <!-- 13381 add additional subfields-->
122
                    <!-- bz 17625 adding subfields f and g -->
123
                    <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
124
                        <xsl:choose>
125
                            <xsl:when test="@code='h'">
126
                                <!--  13381 Span class around subfield h so it can be suppressed via css -->
127
                                <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
128
                            </xsl:when>
129
                            <xsl:when test="@code='c'">
130
                                <!--  13381 Span class around subfield c so it can be suppressed via css -->
131
                                <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
132
                            </xsl:when>
133
                            <xsl:otherwise>
134
                                <xsl:apply-templates/>
135
                                <xsl:text> </xsl:text>
136
                            </xsl:otherwise>
137
                        </xsl:choose>
138
                    </xsl:for-each>
139
                </xsl:for-each>
140
            </h1>
119
            </h1>
141
        </xsl:if>
120
        </xsl:if>
142
121
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl (-26 / +2 lines)
Lines 7-12 Link Here
7
  xmlns:str="http://exslt.org/strings"
7
  xmlns:str="http://exslt.org/strings"
8
  exclude-result-prefixes="marc str">
8
  exclude-result-prefixes="marc str">
9
    <xsl:import href="MARC21slimUtils.xsl"/>
9
    <xsl:import href="MARC21slimUtils.xsl"/>
10
    <xsl:include href="MARC21_245.xsl"/>
10
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
11
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
11
12
12
    <xsl:template match="/">
13
    <xsl:template match="/">
Lines 308-339 Link Here
308
        </xsl:attribute>
309
        </xsl:attribute>
309
        <xsl:attribute name="class">title</xsl:attribute>
310
        <xsl:attribute name="class">title</xsl:attribute>
310
311
311
        <xsl:if test="marc:datafield[@tag=245]">
312
        <xsl:call-template name="show-title-245"/>
312
            <xsl:for-each select="marc:datafield[@tag=245]">
313
                <xsl:call-template name="subfieldSelect">
314
                    <xsl:with-param name="codes">a</xsl:with-param>
315
                </xsl:call-template>
316
                <xsl:text> </xsl:text>
317
                <!-- 13381 add additional subfields-->
318
                <!-- bz 17625 adding subfields f and g -->
319
                <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
320
                    <xsl:choose>
321
                        <xsl:when test="@code='h'">
322
                            <!--  13381 Span class around subfield h so it can be suppressed via css -->
323
                            <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
324
                        </xsl:when>
325
                        <xsl:when test="@code='c'">
326
                            <!--  13381 Span class around subfield c so it can be suppressed via css -->
327
                            <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
328
                        </xsl:when>
329
                        <xsl:otherwise>
330
                            <xsl:apply-templates/>
331
                            <xsl:text> </xsl:text>
332
                        </xsl:otherwise>
333
                    </xsl:choose>
334
                </xsl:for-each>
335
            </xsl:for-each>
336
        </xsl:if>
337
    </a>
313
    </a>
338
314
339
    <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
315
    <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21_245.xsl (+97 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
3
<!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com  -->
4
<!DOCTYPE stylesheet>
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">
10
11
<xsl:template name="show-title-245">
12
    <!-- get leader 18: -->
13
    <xsl:variable name="leader" select="marc:leader"/>
14
    <xsl:variable name="leader18" select="substring($leader,19,1)"/>
15
    <!-- if $leader18 == c or n: add punctuation -->
16
17
    <!--Bug 13381 -->
18
    <xsl:if test="marc:datafield[@tag=245]">
19
        <!--
20
        <h1 class="title" property="name">
21
        -->
22
            <xsl:for-each select="marc:datafield[@tag=245]">
23
                <xsl:call-template name="subfieldSelect">
24
                    <xsl:with-param name="codes">a</xsl:with-param>
25
                </xsl:call-template>
26
                <xsl:text> </xsl:text>
27
                <!-- 13381 add additional subfields-->
28
                <!-- bug17625 adding f and g subfields -->
29
                <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
30
                    <xsl:choose>
31
                        <xsl:when test="@code='b'">
32
                            <!--  13381 Span class around subfield h so it can be suppressed via css -->
33
                            <span class="title_remainder">
34
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text> : </xsl:text> </xsl:if>
35
                            <xsl:apply-templates/> <xsl:text> </xsl:text> </span>
36
                        </xsl:when>
37
                        <xsl:when test="@code='c'">
38
                            <!--  13381 Span class around subfield c so it can be suppressed via css -->
39
                            <span class="title_resp_stmt">
40
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text> / </xsl:text> </xsl:if>
41
                            <xsl:apply-templates/> <xsl:text> </xsl:text> </span>
42
                        </xsl:when>
43
                        <xsl:when test="@code='f'">
44
                            <span class="title_incldat">
45
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>, </xsl:text> </xsl:if>
46
                            <xsl:apply-templates/></span>
47
                        </xsl:when>
48
                        <xsl:when test="@code='g'">
49
                            <span class="title_bulkdat">
50
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>, </xsl:text> </xsl:if>
51
                            <xsl:apply-templates/></span>
52
                        </xsl:when>
53
                        <xsl:when test="@code='h'">
54
                            <!--  13381 Span class around subfield h so it can be suppressed via css -->
55
                            <span class="title_medium">
56
                            <xsl:text> </xsl:text>
57
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>[</xsl:text> </xsl:if>
58
                            <xsl:apply-templates/>
59
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>]</xsl:text> </xsl:if>
60
                            </span>
61
                        </xsl:when>
62
63
                        <xsl:when test="@code='k'">
64
                            <span class="title_form">
65
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text> : </xsl:text> </xsl:if>
66
                            <xsl:apply-templates/> <xsl:text> </xsl:text> </span>
67
                        </xsl:when>
68
                        <xsl:when test="@code='n'">
69
                            <span class="title_n">
70
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text> : </xsl:text> </xsl:if>
71
                            <xsl:apply-templates/></span>
72
                        </xsl:when>
73
                        <xsl:when test="@code='p'">
74
                            <span class="title_p">
75
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>, </xsl:text> </xsl:if>
76
                            <xsl:apply-templates/></span>
77
                        </xsl:when>
78
                        <xsl:when test="@code='s'">
79
                            <span class="title_s">
80
                            <xsl:if test="$leader18='c' or $leader18='n'"> <xsl:text>. </xsl:text> </xsl:if>
81
                            <xsl:apply-templates/></span>
82
                        </xsl:when>
83
84
                        <xsl:otherwise>
85
                            <xsl:apply-templates/>
86
                            <xsl:text> </xsl:text>
87
                        </xsl:otherwise>
88
                    </xsl:choose>
89
                </xsl:for-each>
90
            </xsl:for-each>
91
            <!--
92
        </h1>
93
        -->
94
    </xsl:if>
95
</xsl:template>
96
97
</xsl:stylesheet>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (-30 / +8 lines)
Lines 8-13 Link Here
8
  xmlns:str="http://exslt.org/strings"
8
  xmlns:str="http://exslt.org/strings"
9
  exclude-result-prefixes="marc str">
9
  exclude-result-prefixes="marc str">
10
    <xsl:import href="MARC21slimUtils.xsl"/>
10
    <xsl:import href="MARC21slimUtils.xsl"/>
11
    <xsl:include href="MARC21_245.xsl"/>
12
11
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
12
14
13
    <xsl:template match="/">
15
    <xsl:template match="/">
Lines 129-164 Link Here
129
            </h2>
131
            </h2>
130
        </xsl:if>
132
        </xsl:if>
131
133
132
            <!--Bug 13381 -->
134
        <!-- Bug 37196 -->
133
            <xsl:if test="marc:datafield[@tag=245]">
135
        <xsl:if test="marc:datafield[@tag=245]">
134
                <h1 class="title" property="name">
136
            <h1 class="title" property="name">
135
                    <xsl:for-each select="marc:datafield[@tag=245]">
137
            <xsl:call-template name="show-title-245"/>
136
                        <xsl:call-template name="subfieldSelect">
138
            </h1>
137
                            <xsl:with-param name="codes">a</xsl:with-param>
139
        </xsl:if>
138
                        </xsl:call-template>
139
                        <xsl:text> </xsl:text>
140
                        <!-- 13381 add additional subfields-->
141
                        <!-- bug17625 adding f and g subfields -->
142
                        <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
143
                            <xsl:choose>
144
                                <xsl:when test="@code='h'">
145
                                    <!--  13381 Span class around subfield h so it can be suppressed via css -->
146
                                    <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
147
                                </xsl:when>
148
                                <xsl:when test="@code='c'">
149
                                    <!--  13381 Span class around subfield c so it can be suppressed via css -->
150
                                    <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
151
                                </xsl:when>
152
                                <xsl:otherwise>
153
                                    <xsl:apply-templates/>
154
                                    <xsl:text> </xsl:text>
155
                                </xsl:otherwise>
156
                            </xsl:choose>
157
                        </xsl:for-each>
158
                    </xsl:for-each>
159
                </h1>
160
            </xsl:if>
161
162
140
163
        <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
141
        <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
164
        <xsl:if test="$display880">
142
        <xsl:if test="$display880">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl (-27 / +2 lines)
Lines 9-14 Link Here
9
  xmlns:str="http://exslt.org/strings"
9
  xmlns:str="http://exslt.org/strings"
10
  exclude-result-prefixes="marc items str" extension-element-prefixes="exsl">
10
  exclude-result-prefixes="marc items str" extension-element-prefixes="exsl">
11
    <xsl:import href="MARC21slimUtils.xsl"/>
11
    <xsl:import href="MARC21slimUtils.xsl"/>
12
    <xsl:include href="MARC21_245.xsl"/>
12
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13
14
14
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
15
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
Lines 431-462 Link Here
431
        </xsl:attribute>
432
        </xsl:attribute>
432
        <xsl:attribute name="class"><xsl:value-of select="'title'" /></xsl:attribute>
433
        <xsl:attribute name="class"><xsl:value-of select="'title'" /></xsl:attribute>
433
434
434
        <xsl:if test="marc:datafield[@tag=245]">
435
        <xsl:call-template name="show-title-245"/>
435
            <xsl:for-each select="marc:datafield[@tag=245]">
436
                <xsl:call-template name="subfieldSelect">
437
                    <xsl:with-param name="codes">a</xsl:with-param>
438
                </xsl:call-template>
439
                <xsl:text> </xsl:text>
440
                <!-- 13381 add additional subfields-->
441
                <!-- bz 17625 adding subfields f and g -->
442
                <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
443
                    <xsl:choose>
444
                        <xsl:when test="@code='h'">
445
                            <!--  13381 Span class around subfield h so it can be suppressed via css -->
446
                            <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
447
                        </xsl:when>
448
                        <xsl:when test="@code='c'">
449
                            <!--  13381 Span class around subfield c so it can be suppressed via css -->
450
                            <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
451
                        </xsl:when>
452
                        <xsl:otherwise>
453
                            <xsl:apply-templates/>
454
                            <xsl:text> </xsl:text>
455
                        </xsl:otherwise>
456
                    </xsl:choose>
457
                </xsl:for-each>
458
            </xsl:for-each>
459
        </xsl:if>
460
    </a>
436
    </a>
461
437
462
    <!-- OpenURL -->
438
    <!-- OpenURL -->
463
- 

Return to bug 37196