ISBD custom template based on version 17.06 xslt
authorMarijana Glavica <mglavica@ffzg.hr>
Fri, 13 Oct 2017 12:32:03 +0000 (14:32 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 25 Mar 2019 14:43:16 +0000 (15:43 +0100)
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetailISBD.xsl

index e57094d..9769552 100644 (file)
@@ -3,6 +3,7 @@
 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
 
 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
+<!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com  -->
 <xsl:stylesheet version="1.0"
   xmlns:marc="http://www.loc.gov/MARC21/slim"
   xmlns:items="http://www.koha-community.org/items"
@@ -25,6 +26,8 @@
         <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
         <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
         <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
+        <xsl:variable name="DisplayIconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayIconsXSLT']"/>
+        <xsl:variable name="OpacSuppression" select="marc:sysprefs/marc:syspref[@name='OpacSuppression']"/>
         <xsl:variable name="TracingQuotesLeft">
            <xsl:choose>
              <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
@@ -69,7 +72,7 @@
                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
                         <xsl:when test="$leader7='i' or $leader7='s'">
                             <xsl:choose>
-                                <xsl:when test="substring($controlField008,22,1)!='m'">Continuing Resource</xsl:when>
+                                <xsl:when test="substring($controlField008,22,1)!='m'">Continuing resource</xsl:when>
                                 <xsl:otherwise>Series</xsl:otherwise>
                             </xsl:choose>
                         </xsl:when>
                 </xsl:when>
                 <xsl:when test="$leader6='t'">Book</xsl:when>
                 <xsl:when test="$leader6='o'">Kit</xsl:when>
-                <xsl:when test="$leader6='p'">Mixed Materials</xsl:when>
-                <xsl:when test="$leader6='m'">Computer File</xsl:when>
+                <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
+                <xsl:when test="$leader6='m'">Computer file</xsl:when>
                 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
-                <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual Material</xsl:when>
+                <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual material</xsl:when>
                 <xsl:when test="$leader6='j'">Music</xsl:when>
                 <xsl:when test="$leader6='i'">Sound</xsl:when>
                 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
             </xsl:choose>
         </xsl:variable>
 
+        <!-- Indicate if record is suppressed in OPAC -->
+        <xsl:if test="$OpacSuppression = 1">
+            <xsl:if test="marc:datafield[@tag=942][marc:subfield[@code='n'] = '1']">
+                <span class="results_summary suppressed_opac">Suppressed in OPAC</span>
+            </xsl:if>
+        </xsl:if>
+
+<!-- DDC classification -->
+    <xsl:if test="marc:datafield[@tag=082]">
+        <span class="results_summary ddc">
+            <span class="label">DDC classification: </span>
+            <xsl:for-each select="marc:datafield[@tag=082]">
+                <xsl:call-template name="subfieldSelect">
+                    <xsl:with-param name="codes">a</xsl:with-param>
+                    <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
+                </xsl:call-template>
+                <xsl:choose>
+                    <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
+                    <xsl:otherwise> | </xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
+        </span>
+    </xsl:if>
+
+<!-- UDC classification -->
+    <xsl:if test="marc:datafield[@tag=080]">
+        <span class="results_summary udc">
+            <span class="label">UDC classification: </span>
+            <xsl:for-each select="marc:datafield[@tag=080]">
+                <xsl:call-template name="subfieldSelect">
+                    <xsl:with-param name="codes">a</xsl:with-param>
+                    <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
+                </xsl:call-template>
+                <xsl:choose>
+                    <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
+                    <xsl:otherwise> | </xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
+        </span>
+    </xsl:if>
+
+<!-- Other classification -->
+    <xsl:if test="marc:datafield[@tag=084]">
+       <span class="results_summary oc">
+           <span class="label">Other classification: </span>
+          <xsl:for-each select="marc:datafield[@tag=084]">
+                <xsl:call-template name="subfieldSelect">
+                   <xsl:with-param name="codes">a</xsl:with-param>
+                   <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
+                </xsl:call-template>
+                <xsl:choose>
+                   <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
+                   <xsl:otherwise> | </xsl:otherwise>
+                </xsl:choose>
+          </xsl:for-each>
+       </span>
+    </xsl:if>
+
         <!-- Title Statement -->
         <!-- Alternate Graphic Representation (MARC 880) -->
         <xsl:if test="$display880">
             </h1>
         </xsl:if>
 
-       <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
-        <xsl:if test="$display880">
-            <xsl:call-template name="m880Select">
-                <xsl:with-param name="basetags">250</xsl:with-param>
-                <xsl:with-param name="codes">ab</xsl:with-param>
-                <xsl:with-param name="class">results_summary edition</xsl:with-param>
-                <xsl:with-param name="label">Edition: </xsl:with-param>
-            </xsl:call-template>
-        </xsl:if>
-
-       <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
-        <xsl:if test="$display880">
-            <xsl:call-template name="m880Select">
-                <xsl:with-param name="basetags">260</xsl:with-param>
-                <xsl:with-param name="codes">abcg</xsl:with-param>
-                <xsl:with-param name="class">results_summary publisher</xsl:with-param>
-                <xsl:with-param name="label">Publisher: </xsl:with-param>
-            </xsl:call-template>
-        </xsl:if>
-
-       <!--Series: Alternate Graphic Representation (MARC 880) -->
-        <xsl:if test="$display880">
-            <xsl:call-template name="m880Select">
-                <xsl:with-param name="basetags">440,490</xsl:with-param>
-                <xsl:with-param name="codes">av</xsl:with-param>
-                <xsl:with-param name="class">results_summary series</xsl:with-param>
-                <xsl:with-param name="label">Series: </xsl:with-param>
-                <xsl:with-param name="index">se</xsl:with-param>
-            </xsl:call-template>
-        </xsl:if>
-
-       <!-- Description: Alternate Graphic Representation (MARC 880) -->
-        <xsl:if test="$display880">
-            <xsl:call-template name="m880Select">
-                <xsl:with-param name="basetags">300</xsl:with-param>
-                <xsl:with-param name="codes">abceg</xsl:with-param>
-                <xsl:with-param name="class">results_summary description</xsl:with-param>
-                <xsl:with-param name="label">Description: </xsl:with-param>
-            </xsl:call-template>
-        </xsl:if>
-
-
-       <xsl:if test="marc:datafield[@tag=080]">
-        <span class="results_summary udc"><span class="label">UDC </span>
-        <xsl:for-each select="marc:datafield[@tag=080]">
-        <xsl:variable name="udc" select="marc:subfield[@code='a']"/>
-                <xsl:value-of select="marc:subfield[@code='a']"/>
-                <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-        </xsl:for-each>
-        </span>
-        </xsl:if>
-
-       <xsl:if test="marc:datafield[@tag=084]">
-        <span class="results_summary othercc">
-        <xsl:for-each select="marc:datafield[@tag=084]">
-                    <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">2</xsl:with-param>
-                    </xsl:call-template>
-                   <xsl:text> </xsl:text>
+        <!--Bug 13381 -->
+        <xsl:if test="marc:datafield[@tag=245]">
+            <h1 class="title" property="name">
+                <xsl:for-each select="marc:datafield[@tag=245]">
                     <xsl:call-template name="subfieldSelect">
                         <xsl:with-param name="codes">a</xsl:with-param>
                     </xsl:call-template>
-        </xsl:for-each>
-        </span>
+                    <xsl:text> </xsl:text>
+                    <!-- 13381 add additional subfields-->
+                    <xsl:for-each select="marc:subfield[contains('bchknps', @code)]">
+                        <xsl:choose>
+                            <xsl:when test="@code='h'">
+                                <!--  13381 Span class around subfield h so it can be suppressed via css -->
+                                <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
+                            </xsl:when>
+                            <xsl:when test="@code='c'">
+                                <!--  13381 Span class around subfield c so it can be suppressed via css -->
+                                <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
+                            </xsl:when>
+                            <xsl:otherwise>
+                                <xsl:apply-templates/>
+                                <xsl:text> </xsl:text>
+                            </xsl:otherwise>
+                        </xsl:choose>
+                    </xsl:for-each>
+                </xsl:for-each>
+            </h1>
         </xsl:if>
 
         <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
         </xsl:if>
 
         <!-- Author Statement -->
-        <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
-
-        <xsl:if test="marc:datafield[@tag=245]">
-        <span class="results_summary title">
-           <strong>
-            <xsl:for-each select="marc:datafield[@tag=245]">
-                    <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">a</xsl:with-param>
-                    </xsl:call-template>
-            </xsl:for-each>
-           </strong>
-            <xsl:for-each select="marc:datafield[@tag=245]">
-                    <xsl:if test="marc:subfield[@code='h']">
-                        <xsl:text> </xsl:text>
-                        <xsl:call-template name="subfieldSelect">
-                            <xsl:with-param name="codes">h</xsl:with-param>
-                        </xsl:call-template>
-                    </xsl:if>
-                    <xsl:if test="marc:subfield[@code='b']">
-                        <xsl:text> </xsl:text>
-                        <xsl:call-template name="subfieldSelect">
-                            <xsl:with-param name="codes">b</xsl:with-param>
-                        </xsl:call-template>
-                    </xsl:if>
-                    <xsl:text> </xsl:text>
-                    <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">cfgknps</xsl:with-param>
-                    </xsl:call-template>
-            </xsl:for-each>
-        </span>
-        </xsl:if>
+        <xsl:call-template name="showAuthor">
+            <xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/>
+            <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
+        </xsl:call-template>
 
-        <xsl:if test="marc:datafield[@tag=250]">
-        <span class="results_summary edition">
-       <xsl:text> - </xsl:text>
-            <xsl:for-each select="marc:datafield[@tag=250]">
-                <xsl:call-template name="chopPunctuation">
-                  <xsl:with-param name="chopString">
-                    <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">ab</xsl:with-param>
-                    </xsl:call-template>
-                   </xsl:with-param>
-               </xsl:call-template>
-                    <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-            </xsl:for-each>
-        </span>
-        </xsl:if>
-
-        <xsl:if test="marc:datafield[@tag=260]">
-        <span class="results_summary publisher">
-       <xsl:text> - </xsl:text>
-            <xsl:for-each select="marc:datafield[@tag=260]">
-                <xsl:if test="marc:subfield[@code='a']">
-                    <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">a</xsl:with-param>
-                    </xsl:call-template>
-                </xsl:if>
-                <xsl:text> </xsl:text>
-                <xsl:if test="marc:subfield[@code='b']">
-                <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:{marc:subfield[@code='b']}">
-                    <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">b</xsl:with-param>
-                    </xsl:call-template>
-               </a>
-               </xsl:if>
-               <xsl:text> </xsl:text>
-                <xsl:call-template name="chopPunctuation">
-                  <xsl:with-param name="chopString">
-                    <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">cg</xsl:with-param>
-                    </xsl:call-template>
-                   </xsl:with-param>
-               </xsl:call-template>
-                    <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-            </xsl:for-each>
-        </span>
-        </xsl:if>
+        <!-- #13382 Suppress 700$i and 7xx/@ind2=2 -->
+        <xsl:call-template name="showAuthor">
+            <xsl:with-param name="authorfield" select="marc:datafield[(@tag=700 or @tag=710 or @tag=711) and not(@ind2=2) and not(marc:subfield[@code='i'])]"/>
+            <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
+        </xsl:call-template>
 
-        <xsl:if test="marc:datafield[@tag=300]">
-        <span class="results_summary description">
-       <xsl:text> - </xsl:text>
-            <xsl:for-each select="marc:datafield[@tag=300]">
-                <xsl:call-template name="chopPunctuation">
-                  <xsl:with-param name="chopString">
-                    <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">abceg</xsl:with-param>
-                    </xsl:call-template>
-                   </xsl:with-param>
-               </xsl:call-template>
-                    <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-            </xsl:for-each>
+    <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">
+        <span class="results_summary type"><span class="label">Material type: </span>
+        <xsl:element name="img"><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="$materialTypeLabel"/>
         </span>
-       </xsl:if>
+    </xsl:if>
 
 
+        <!--Series: Alternate Graphic Representation (MARC 880) -->
+        <xsl:if test="$display880">
+            <xsl:call-template name="m880Select">
+                <xsl:with-param name="basetags">440,490</xsl:with-param>
+                <xsl:with-param name="codes">av</xsl:with-param>
+                <xsl:with-param name="class">results_summary series</xsl:with-param>
+                <xsl:with-param name="label">Series: </xsl:with-param>
+                <xsl:with-param name="index">se</xsl:with-param>
+            </xsl:call-template>
+        </xsl:if>
 
-       <!-- Series -->
+        <!-- Series -->
         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
-        <span class="results_summary series">
+        <span class="results_summary series"><span class="label">Series: </span>
         <!-- 440 -->
         <xsl:for-each select="marc:datafield[@tag=440]">
-       <xsl:text> - (</xsl:text>
             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
             <xsl:call-template name="chopPunctuation">
                             <xsl:with-param name="chopString">
                         </xsl:call-template>
             </a>
             <xsl:call-template name="part"/>
-            <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
-       <xsl:text>)</xsl:text>
+            <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
         </xsl:for-each>
 
         <!-- 490 Series not traced, Ind1 = 0 -->
         <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
-       <xsl:text> - (</xsl:text>
             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
                         <xsl:call-template name="chopPunctuation">
                             <xsl:with-param name="chopString">
             </a>
                     <xsl:call-template name="part"/>
         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-       <xsl:text>)</xsl:text>
         </xsl:for-each>
         <!-- 490 Series traced, Ind1 = 1 -->
         <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
         </span>
         </xsl:if>
 
-
-
         <!-- Analytics -->
         <xsl:if test="$leader7='s'">
         <span class="results_summary analytics"><span class="label">Analytics: </span>
             <a>
             <xsl:choose>
             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Local-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
         </xsl:for-each>
         </span>
         </xsl:if>
-                  <xsl:if test="$materialTypeCode!=''">
-                               <span class="results_summary type"><span class="label">Type: </span>
-                               <xsl:element name="img"><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
-                               <xsl:text> </xsl:text>
-                               <xsl:value-of select="$materialTypeLabel"/>
-                               </span>
-                  </xsl:if>
-
-        <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
-
-        <xsl:if test="marc:datafield[@tag=020]">
-        <span class="results_summary isbn"><span class="label">ISBN: </span>
-        <xsl:for-each select="marc:datafield[@tag=020]">
-        <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
-                <xsl:value-of select="marc:subfield[@code='a']"/>
-                <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-        </xsl:for-each>
-        </span>
+
+        <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
+        <xsl:if test="$display880">
+            <xsl:call-template name="m880Select">
+                <xsl:with-param name="basetags">260</xsl:with-param>
+                <xsl:with-param name="codes">abcg</xsl:with-param>
+                <xsl:with-param name="class">results_summary publisher</xsl:with-param>
+                <xsl:with-param name="label">Publisher: </xsl:with-param>
+            </xsl:call-template>
         </xsl:if>
 
-        <xsl:if test="marc:datafield[@tag=022]">
-        <span class="results_summary issn"><span class="label">ISSN: </span>
-        <xsl:for-each select="marc:datafield[@tag=022]">
-                <xsl:value-of select="marc:subfield[@code='a']"/>
-                <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-        </xsl:for-each>
+        <!-- Publisher info and RDA related info from tags 260, 264 -->
+        <xsl:choose>
+            <xsl:when test="marc:datafield[@tag=264]">
+                <xsl:call-template name="showRDAtag264">
+                   <xsl:with-param name="show_url">1</xsl:with-param>
+                </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="marc:datafield[@tag=260]">
+                <span class="results_summary publisher"><span class="label">Publisher: </span>
+                    <xsl:for-each select="marc:datafield[@tag=260]">
+                        <xsl:if test="marc:subfield[@code='a']">
+                            <xsl:call-template name="subfieldSelect">
+                                <xsl:with-param name="codes">a</xsl:with-param>
+                            </xsl:call-template>
+                        </xsl:if>
+                        <xsl:text> </xsl:text>
+                        <xsl:if test="marc:subfield[@code='b']">
+                        <a href="/cgi-bin/koha/catalogue/search.pl?q=Provider:{marc:subfield[@code='b']}">
+                            <xsl:call-template name="subfieldSelect">
+                                <xsl:with-param name="codes">b</xsl:with-param>
+                            </xsl:call-template>
+                       </a>
+                       </xsl:if>
+                       <xsl:text> </xsl:text>
+                        <xsl:call-template name="chopPunctuation">
+                          <xsl:with-param name="chopString">
+                            <xsl:call-template name="subfieldSelect">
+                                <xsl:with-param name="codes">cg</xsl:with-param>
+                            </xsl:call-template>
+                           </xsl:with-param>
+                       </xsl:call-template>
+                            <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
+                    </xsl:for-each>
+                </span>
+            </xsl:when>
+        </xsl:choose>
+
+        <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
+        <xsl:if test="$display880">
+            <xsl:call-template name="m880Select">
+                <xsl:with-param name="basetags">250</xsl:with-param>
+                <xsl:with-param name="codes">ab</xsl:with-param>
+                <xsl:with-param name="class">results_summary edition</xsl:with-param>
+                <xsl:with-param name="label">Edition: </xsl:with-param>
+            </xsl:call-template>
+        </xsl:if>
+
+        <xsl:if test="marc:datafield[@tag=250]">
+        <span class="results_summary edition"><span class="label">Edition: </span>
+            <xsl:for-each select="marc:datafield[@tag=250]">
+                <xsl:call-template name="chopPunctuation">
+                  <xsl:with-param name="chopString">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">ab</xsl:with-param>
+                    </xsl:call-template>
+                   </xsl:with-param>
+               </xsl:call-template>
+                    <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
+            </xsl:for-each>
         </span>
         </xsl:if>
 
-        <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
+        <!-- Description: Alternate Graphic Representation (MARC 880) -->
         <xsl:if test="$display880">
             <xsl:call-template name="m880Select">
-                <xsl:with-param name="basetags">246</xsl:with-param>
-                <xsl:with-param name="codes">abhfgnp</xsl:with-param>
-                <xsl:with-param name="class">results_summary other_title</xsl:with-param>
-                <xsl:with-param name="label">Other Title: </xsl:with-param>
+                <xsl:with-param name="basetags">300</xsl:with-param>
+                <xsl:with-param name="codes">abceg</xsl:with-param>
+                <xsl:with-param name="class">results_summary description</xsl:with-param>
+                <xsl:with-param name="label">Description: </xsl:with-param>
             </xsl:call-template>
         </xsl:if>
 
-        <xsl:if test="marc:datafield[@tag=246]">
-        <span class="results_summary other_title"><span class="label">Other Title: </span>
-            <xsl:for-each select="marc:datafield[@tag=246]">
+        <xsl:if test="marc:datafield[@tag=300]">
+        <span class="results_summary description"><span class="label">Description: </span>
+            <xsl:for-each select="marc:datafield[@tag=300]">
                 <xsl:call-template name="chopPunctuation">
                   <xsl:with-param name="chopString">
                     <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
+                        <xsl:with-param name="codes">abceg</xsl:with-param>
                     </xsl:call-template>
                    </xsl:with-param>
                </xsl:call-template>
         </span>
        </xsl:if>
 
+        <!-- Content Type -->
+        <xsl:if test="marc:datafield[@tag=336] or marc:datafield[@tag=337] or marc:datafield[@tag=338]">
+            <span class="results_summary" id="content_type">
+                <xsl:if test="marc:datafield[@tag=336]">
+                    <span class="label">Content type: </span>
+                    <xsl:for-each select="marc:datafield[@tag=336]">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">a</xsl:with-param>
+                            <xsl:with-param name="delimeter">, </xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
+                    </xsl:for-each>
+                </xsl:if>
+                <xsl:text> </xsl:text>
+                <!-- Media Type -->
+                <xsl:if test="marc:datafield[@tag=337]">
+                    <span class="label">Media type: </span>
+                    <xsl:for-each select="marc:datafield[@tag=337]">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">a</xsl:with-param>
+                            <xsl:with-param name="delimeter">, </xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
+                    </xsl:for-each>
+                </xsl:if>
+                <xsl:text> </xsl:text>
+                <!-- Media Type -->
+                <xsl:if test="marc:datafield[@tag=338]">
+                    <span class="label">Carrier type: </span>
+                    <xsl:for-each select="marc:datafield[@tag=338]">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">a</xsl:with-param>
+                            <xsl:with-param name="delimeter">, </xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
+                    </xsl:for-each>
+                </xsl:if>
+            </span>
+        </xsl:if>
+
+
+        <!-- Build ISBN -->
+        <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']">
+          <span class="results_summary isbn"><span class="label">ISBN: </span>
+            <xsl:for-each select="marc:datafield[@tag=020]/marc:subfield[@code='a']">
+              <span property="isbn">
+                <xsl:value-of select="."/>
+                <xsl:choose>
+                  <xsl:when test="position()=last()">
+                    <xsl:text>.</xsl:text>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:text>; </xsl:text>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </span>
+            </xsl:for-each>
+          </span>
+        </xsl:if>
+
+        <!-- Build ISSN -->
+        <xsl:if test="marc:datafield[@tag=022]/marc:subfield[@code='a']">
+          <span class="results_summary issn"><span class="label">ISSN: </span>
+            <xsl:for-each select="marc:datafield[@tag=022]/marc:subfield[@code='a']">
+              <span property="issn">
+                <xsl:value-of select="."/>
+                <xsl:choose>
+                  <xsl:when test="position()=last()">
+                    <xsl:text>.</xsl:text>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:text>; </xsl:text>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </span>
+            </xsl:for-each>
+          </span>
+        </xsl:if>
+
+        <xsl:if test="marc:datafield[@tag=013]">
+            <span class="results_summary patent_info">
+                <span class="label">Patent information: </span>
+                <xsl:for-each select="marc:datafield[@tag=013]">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">acdef</xsl:with-param>
+                        <xsl:with-param name="delimeter">, </xsl:with-param>
+                    </xsl:call-template>
+                <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
+                </xsl:for-each>
+            </span>
+        </xsl:if>
+
+        <xsl:if test="marc:datafield[@tag=088]">
+            <span class="results_summary report_number">
+                <span class="label">Report number: </span>
+                <xsl:for-each select="marc:datafield[@tag=088]">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">a</xsl:with-param>
+                    </xsl:call-template>
+                <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
+                </xsl:for-each>
+            </span>
+        </xsl:if>
+
+        <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
+        <xsl:if test="$display880">
+            <xsl:call-template name="m880Select">
+                <xsl:with-param name="basetags">246</xsl:with-param>
+                <xsl:with-param name="codes">abhfgnp</xsl:with-param>
+                <xsl:with-param name="class">results_summary other_title</xsl:with-param>
+                <xsl:with-param name="label">Other title: </xsl:with-param>
+            </xsl:call-template>
+        </xsl:if>
+
+        <xsl:if test="marc:datafield[@tag=246]">
+            <span class="results_summary other_title"><span class="label">Other title: </span>
+                <xsl:for-each select="marc:datafield[@tag=246]">
+                    <xsl:call-template name="chopPunctuation">
+                        <xsl:with-param name="chopString">
+                            <xsl:call-template name="subfieldSelect">
+                                <xsl:with-param name="codes">abhfgnp</xsl:with-param>
+                            </xsl:call-template>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    <xsl:if test="@ind1=1 and not(marc:subfield[@code='i'])">
+                        <xsl:choose>
+                            <xsl:when test="@ind2=0"> [Portion of title]</xsl:when>
+                            <xsl:when test="@ind2=1"> [Parallel title]</xsl:when>
+                            <xsl:when test="@ind2=2"> [Distinctive title]</xsl:when>
+                            <xsl:when test="@ind2=3"> [Other title]</xsl:when>
+                            <xsl:when test="@ind2=4"> [Cover title]</xsl:when>
+                            <xsl:when test="@ind2=5"> [Added title page title]</xsl:when>
+                            <xsl:when test="@ind2=6"> [Caption title]</xsl:when>
+                            <xsl:when test="@ind2=7"> [Running title]</xsl:when>
+                            <xsl:when test="@ind2=8"> [Spine title]</xsl:when>
+                        </xsl:choose>
+                    </xsl:if>
+                    <xsl:if test="marc:subfield[@code='i']">
+                        <xsl:value-of select="concat(' [',marc:subfield[@code='i'],']')"/>
+                    </xsl:if>
+                    <!-- #13386 added separator | -->
+                    <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise></xsl:choose>
+                </xsl:for-each>
+            </span>
+        </xsl:if>
+
         <xsl:if test="marc:datafield[@tag=242]">
         <span class="results_summary translated_title"><span class="label">Title translated: </span>
             <xsl:for-each select="marc:datafield[@tag=242]">
                 <xsl:with-param name="basetags">130,240</xsl:with-param>
                 <xsl:with-param name="codes">adfklmor</xsl:with-param>
                 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
-                <xsl:with-param name="label">Uniform Title: </xsl:with-param>
+                <xsl:with-param name="label">Uniform title: </xsl:with-param>
             </xsl:call-template>
         </xsl:if>
 
         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
-        <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
-        <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
-            <xsl:variable name="str">
-                <xsl:for-each select="marc:subfield">
-                    <xsl:if test="(contains('adfklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))">
-                        <xsl:value-of select="text()"/>
-                        <xsl:text> </xsl:text>
-                     </xsl:if>
+            <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
+                <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
+                    <xsl:for-each select="marc:subfield">
+                        <xsl:if test="contains('adfghklmnoprst',@code)">
+                            <xsl:value-of select="text()"/>
+                            <xsl:text> </xsl:text>
+                        </xsl:if>
+                    </xsl:for-each>
+                    <xsl:if test="position() != last()">
+                        <span class="separator"><xsl:text> | </xsl:text></span>
+                    </xsl:if>
                 </xsl:for-each>
-            </xsl:variable>
-            <xsl:call-template name="chopPunctuation">
-                <xsl:with-param name="chopString">
-                    <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+            </span>
+        </xsl:if>
 
-                </xsl:with-param>
-            </xsl:call-template>
-            <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-        </xsl:for-each>
-        </span>
+        <!-- #13382 Added Related works 700$i -->
+        <xsl:if test="marc:datafield[@tag=700][marc:subfield[@code='i']] or marc:datafield[@tag=710][marc:subfield[@code='i']] or marc:datafield[@tag=711][marc:subfield[@code='i']]">
+            <span class="results_summary related_works"><span class="label">Related works: </span>
+                <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='i']] | marc:datafield[@tag=710][marc:subfield[@code='i']] | marc:datafield[@tag=711][marc:subfield[@code='i']]">
+                    <xsl:variable name="str">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
+                        </xsl:call-template>
+                    </xsl:variable>
+                    <xsl:call-template name="chopPunctuation">
+                        <xsl:with-param name="chopString">
+                            <xsl:value-of select="$str"/>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    <!-- add relator code too between brackets-->
+                    <xsl:if test="marc:subfield[@code='4' or @code='e']">
+                        <span class="relatorcode">
+                            <xsl:text> [</xsl:text>
+                            <xsl:choose>
+                                <xsl:when test="marc:subfield[@code='e']">
+                                    <xsl:for-each select="marc:subfield[@code='e']">
+                                        <xsl:value-of select="."/>
+                                        <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
+                                    </xsl:for-each>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:for-each select="marc:subfield[@code='4']">
+                                        <xsl:value-of select="."/>
+                                        <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
+                                    </xsl:for-each>
+                                </xsl:otherwise>
+                            </xsl:choose>
+                            <xsl:text>]</xsl:text>
+                        </span>
+                    </xsl:if>
+                    <xsl:choose>
+                        <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
+                    </xsl:choose>
+                </xsl:for-each>
+            </span>
+        </xsl:if>
+
+        <!-- #13382 Added Contained Works 7xx@ind2=2 -->
+        <xsl:if test="marc:datafield[@tag=700][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=710][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=711][@ind2=2 and not(marc:subfield[@code='i'])]">
+            <span class="results_summary contained_works"><span class="label">Contained works: </span>
+                <xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]">
+                    <xsl:variable name="str">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
+                        </xsl:call-template>
+                    </xsl:variable>
+                    <xsl:call-template name="chopPunctuation">
+                        <xsl:with-param name="chopString">
+                            <xsl:value-of select="$str"/>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    <!-- add relator code too between brackets-->
+                    <xsl:if test="marc:subfield[@code='4' or @code='e']">
+                        <span class="relatorcode">
+                            <xsl:text> [</xsl:text>
+                            <xsl:choose>
+                                <xsl:when test="marc:subfield[@code='e']">
+                                    <xsl:for-each select="marc:subfield[@code='e']">
+                                        <xsl:value-of select="."/>
+                                        <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
+                                    </xsl:for-each>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:for-each select="marc:subfield[@code='4']">
+                                        <xsl:value-of select="."/>
+                                        <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
+                                    </xsl:for-each>
+                                </xsl:otherwise>
+                            </xsl:choose>
+                            <xsl:text>]</xsl:text>
+                        </span>
+                    </xsl:if>
+                    <xsl:choose>
+                        <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
+                    </xsl:choose>
+                </xsl:for-each>
+            </span>
         </xsl:if>
 
-        <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
+
+        <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6' and not(@tag=655)]">
             <span class="results_summary subjects"><span class="label">Subject(s): </span>
-            <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
+            <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6'][not(@tag=655)]">
             <a>
             <xsl:choose>
+            <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:when test="$TraceSubjectSubdivisions='1'">
-                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelectSubject">
                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
                     </xsl:call-template>
                 </xsl:attribute>
             </xsl:when>
+            <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
             <xsl:otherwise>
-               <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="translate(marc:subfield[@code='a'],'()','')"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
             </xsl:otherwise>
             </xsl:choose>
             <xsl:call-template name="chopPunctuation">
             </span>
         </xsl:if>
 
+        <!-- Genre/Form -->
+        <xsl:if test="marc:datafield[@tag=655]">
+            <span class="results_summary genre"><span class="label">Genre/Form: </span>
+                <xsl:for-each select="marc:datafield[@tag=655]">
+                    <a>
+                        <xsl:choose>
+                            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
+                                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+                            </xsl:when>
+                            <xsl:when test="$TraceSubjectSubdivisions='1'">
+                                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
+                                    <xsl:with-param name="codes">avxyz</xsl:with-param>
+                                    <xsl:with-param name="delimeter"> AND </xsl:with-param>
+                                    <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
+                                    <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
+                                </xsl:call-template>
+                                </xsl:attribute>
+                            </xsl:when>
+                            <xsl:otherwise>
+                                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
+                            </xsl:otherwise>
+                        </xsl:choose>
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">avxyz</xsl:with-param>
+                        <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
+                        <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
+                    </xsl:call-template>
+                    </a>
+                    <xsl:if test="position()!=last()"><span class="separator"> | </span></xsl:if>
+                </xsl:for-each>
+            </span>
+        </xsl:if>
+
+<!-- MARC21 776 Additional Physical Form Entry -->
+    <xsl:if test="marc:datafield[@tag=776]">
+        <span class="results_summary add_physical_form">
+            <span class="label">Additional physical formats: </span>
+            <xsl:for-each select="marc:datafield[@tag=776]">
+                <xsl:variable name="linktext">
+                    <xsl:choose>
+                    <xsl:when test="marc:subfield[@code='t']">
+                        <xsl:value-of select="marc:subfield[@code='t']"/>
+                    </xsl:when>
+                    <xsl:when test="marc:subfield[@code='a']">
+                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:text>No title</xsl:text>
+                    </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:variable>
+                <xsl:if test="@ind2=8 and marc:subfield[@code='i']">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">i</xsl:with-param>
+                    </xsl:call-template>
+                    <xsl:text>: </xsl:text>
+                </xsl:if>
+                <xsl:choose>
+                <xsl:when test="marc:subfield[@code='w']">
+                    <a>
+                    <xsl:attribute name="href">
+                        <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=control-number:</xsl:text>
+                        <xsl:call-template name="extractControlNumber">
+                            <xsl:with-param name="subfieldW">
+                                <xsl:value-of select="marc:subfield[@code='w']"/>
+                            </xsl:with-param>
+                        </xsl:call-template>
+                    </xsl:attribute>
+                    <xsl:value-of select="$linktext"/>
+                    </a>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="$linktext"/>
+                </xsl:otherwise>
+                </xsl:choose>
+                <xsl:if test="position() != last()">
+                    <xsl:text>; </xsl:text>
+                </xsl:if>
+            </xsl:for-each>
+        </span>
+    </xsl:if>
+
         <xsl:if test="marc:datafield[@tag=856]">
-        <span class="results_summary online_resources"><span class="label">Online Resources: </span>
+        <span class="results_summary online_resources"><span class="label">Online resources: </span>
         <xsl:for-each select="marc:datafield[@tag=856]">
                                    <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
                                    <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
             </div>
         </xsl:if>
 
+        <!-- 586 -->
+        <xsl:if test="marc:datafield[@tag=586]">
+            <span class="results_summary awardsnote">
+                <xsl:if test="marc:datafield[@tag=586]/@ind1=' '">
+                    <span class="label">Awards: </span>
+                </xsl:if>
+                <xsl:for-each select="marc:datafield[@tag=586]">
+                    <xsl:value-of select="marc:subfield[@code='a']"/>
+                    <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
+                </xsl:for-each>
+            </span>
+        </xsl:if>
+
+         <!-- 583 -->
+             <xsl:if test="marc:datafield[@tag=583]">
+                 <xsl:for-each select="marc:datafield[@tag=583]">
+                    <xsl:if test="@ind1=1 or @ind1=' '">
+                      <span class="results_summary actionnote">
+                          <span class="label">Action note: </span>
+                             <xsl:choose>
+                                 <xsl:when test="marc:subfield[@code='z']">
+                                     <xsl:value-of select="marc:subfield[@code='z']"/>
+                                 </xsl:when>
+                                 <xsl:otherwise>
+                                     <xsl:call-template name="subfieldSelect">
+                                         <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
+                                     </xsl:call-template>
+                                 </xsl:otherwise>
+                             </xsl:choose>
+                         </span>
+                     </xsl:if>
+                 </xsl:for-each>
+             </xsl:if>
+
+        <!-- 508 -->
+        <xsl:if test="marc:datafield[@tag=508]">
+            <div class="results_summary prod_credits">
+                <span class="label">Production credits: </span>
+                <xsl:for-each select="marc:datafield[@tag=508]">
+                    <xsl:call-template name="subfieldSelectSpan">
+                        <xsl:with-param name="codes">a</xsl:with-param>
+                    </xsl:call-template>
+                    <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
+                </xsl:for-each>
+            </div>
+        </xsl:if>
+
         <!-- 773 -->
         <xsl:if test="marc:datafield[@tag=773]">
         <xsl:for-each select="marc:datafield[@tag=773]">
-        <xsl:if test="@ind1=0">
+        <xsl:if test="@ind1 !=1">
         <span class="results_summary in"><span class="label">
         <xsl:choose>
         <xsl:when test="@ind2=' '">
         </span>
                 <xsl:variable name="f773">
                     <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">at</xsl:with-param>
+                        <xsl:with-param name="codes">a_t</xsl:with-param>
                     </xsl:call-template></xsl:with-param></xsl:call-template>
                 </xsl:variable>
             <xsl:choose>
                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Local-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
                         <xsl:value-of select="translate($f773, '()', '')"/>
                     </a>
                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
         </xsl:for-each>
         </xsl:if>
 
+        <xsl:if test="marc:datafield[@tag=502]">
+            <span class="results_summary diss_note">
+                <span class="label">Dissertation note: </span>
+                <xsl:for-each select="marc:datafield[@tag=502]">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">abcdgo</xsl:with-param>
+                    </xsl:call-template>
+                </xsl:for-each>
+                <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
+            </span>
+        </xsl:if>
+
         <!-- 866 textual holdings -->
         <xsl:if test="marc:datafield[@tag=866]">
-            <span class="results_summary holdings_note"><span class="label">Holdings Note: </span>
+            <span class="results_summary holdings_note"><span class="label">Holdings note: </span>
                 <xsl:for-each select="marc:datafield[@tag=866]">
                     <xsl:call-template name="subfieldSelect">
                         <xsl:with-param name="codes">axz</xsl:with-param>
 
         <!--  775 Other Edition  -->
         <xsl:if test="marc:datafield[@tag=775]">
-        <span class="results_summary other_editions"><span class="label">Other Editions: </span>
+        <span class="results_summary other_editions"><span class="label">Other editions: </span>
         <xsl:for-each select="marc:datafield[@tag=775]">
             <xsl:variable name="f775">
                 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
             <a>
             <xsl:choose>
             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Local-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
             <span class="label">Separated from:</span>
         </xsl:when>
         </xsl:choose>
+        <xsl:text> </xsl:text>
                 <xsl:variable name="f780">
                     <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">at</xsl:with-param>
+                        <xsl:with-param name="codes">a_t</xsl:with-param>
                     </xsl:call-template>
                 </xsl:variable>
             <xsl:choose>
                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Local-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
                         <xsl:value-of select="translate($f780, '()', '')"/>
                     </a>
                 </xsl:when>
                 <xsl:otherwise>
-                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
                         <xsl:value-of select="translate($f780, '()', '')"/>
                     </a>
                 </xsl:otherwise>
         <xsl:when test="@ind2=8">
             <span class="label">Changed back to:</span>
         </xsl:when>
-
         </xsl:choose>
+        <xsl:text> </xsl:text>
                    <xsl:variable name="f785">
                     <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">at</xsl:with-param>
+                        <xsl:with-param name="codes">a_t</xsl:with-param>
                     </xsl:call-template>
                 </xsl:variable>
 
             <xsl:choose>
                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Local-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
                         <xsl:value-of select="translate($f785, '()', '')"/>
                     </a>
                 </xsl:when>
                 <xsl:otherwise>
-                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
                         <xsl:value-of select="translate($f785, '()', '')"/>
                     </a>
                 </xsl:otherwise>
         </span>
         </xsl:if>
 
-       <xsl:if test="marc:datafield[@tag=942]">
+           <xsl:if test="marc:datafield[@tag=942]">
         <span class="results_summary local"><span class="label">Old Callnumber: </span>
         <xsl:for-each select="marc:datafield[@tag=942]">
                     <xsl:if test="marc:subfield[@code='d']">
 
     </xsl:template>
 
-    <xsl:template name="nameABCDQ">
+    <xsl:template name="nameABCQ">
             <xsl:call-template name="chopPunctuation">
                 <xsl:with-param name="chopString">
                     <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">aq</xsl:with-param>
+                        <xsl:with-param name="codes">abcq</xsl:with-param>
                     </xsl:call-template>
                 </xsl:with-param>
                 <xsl:with-param name="punctuation">
                     <xsl:text>:,;/ </xsl:text>
                 </xsl:with-param>
             </xsl:call-template>
-        <xsl:call-template name="termsOfAddress"/>
     </xsl:template>
 
     <xsl:template name="nameABCDN">
-        <xsl:for-each select="marc:subfield[@code='a']">
-                <xsl:call-template name="chopPunctuation">
-                    <xsl:with-param name="chopString" select="."/>
-                </xsl:call-template>
-        </xsl:for-each>
-        <xsl:for-each select="marc:subfield[@code='b']">
-            <xsl:value-of select="."/>
-            <xsl:choose>
-                <xsl:when test="position() != last()">
-                    <xsl:text> -- </xsl:text>
-                </xsl:when>
-            </xsl:choose>
-        </xsl:for-each>
-        <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
-                <xsl:call-template name="subfieldSelect">
-                    <xsl:with-param name="codes">cdn</xsl:with-param>
-                </xsl:call-template>
-        </xsl:if>
-    </xsl:template>
-
-    <xsl:template name="nameACDEQ">
-            <xsl:call-template name="subfieldSelect">
-                <xsl:with-param name="codes">acdeq</xsl:with-param>
-            </xsl:call-template>
-    </xsl:template>
-    <xsl:template name="termsOfAddress">
-        <xsl:if test="marc:subfield[@code='b' or @code='c']">
             <xsl:call-template name="chopPunctuation">
                 <xsl:with-param name="chopString">
                     <xsl:call-template name="subfieldSelect">
-                        <xsl:with-param name="codes">bc</xsl:with-param>
+                        <xsl:with-param name="codes">abcdn</xsl:with-param>
                     </xsl:call-template>
                 </xsl:with-param>
+                <xsl:with-param name="punctuation">
+                    <xsl:text>:,;/ </xsl:text>
+                </xsl:with-param>
+            </xsl:call-template>
+    </xsl:template>
+
+    <xsl:template name="nameACDEQ">
+            <xsl:call-template name="subfieldSelect">
+                <xsl:with-param name="codes">acdeq</xsl:with-param>
             </xsl:call-template>
-        </xsl:if>
     </xsl:template>
 
     <xsl:template name="part">
        <xsl:param name="authorfield"/>
     <xsl:param name="UseAuthoritiesForTracings"/>
        <xsl:if test="count($authorfield)&gt;0">
-        <span class="results_summary author">
+        <h5 class="author">
         <xsl:for-each select="$authorfield">
-       <!--
         <xsl:choose>
           <xsl:when test="position()&gt;1"/>
-          <xsl:when test="@tag&lt;700">Author(s): </xsl:when>
-          <xsl:otherwise>Additional author(s): </xsl:otherwise>
+          <!-- #13383 -->
+          <xsl:when test="@tag&lt;700">By: </xsl:when>
+          <!--#13382 Changed Additional author to contributor -->
+          <xsl:otherwise>Contributor(s): </xsl:otherwise>
         </xsl:choose>
-       -->
         <a>
         <xsl:choose>
             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
-                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> <span style="color: red"> * </span>
             </xsl:when>
             <xsl:otherwise>
             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
             </xsl:otherwise>
         </xsl:choose>
-       <xsl:choose>
-          <xsl:when test="(@tag=100 or @tag=700) and marc:subfield[@code=9]">
-                               <span style="color: green"><xsl:call-template name="nameABCDQ"/></span>
-                 </xsl:when>
-                 <xsl:otherwise><xsl:call-template name="nameABCDQ"/></xsl:otherwise>
-    </xsl:choose>
-       <xsl:choose>
-          <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
-          <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
-       </xsl:choose>
-       <!-- add relator code too between brackets-->
-       <xsl:if test="marc:subfield[@code='4' or @code='e']">
-      <span class="relatorcode">
-      <xsl:text> [</xsl:text>
-         <xsl:choose>
-           <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
-           <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
-         </xsl:choose>
-         <xsl:text>]</xsl:text>
-      </span>
-       </xsl:if>
-       </a>
         <xsl:choose>
-          <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
+            <xsl:when test="@tag=100 or @tag=110 or @tag=111">
+                <!-- #13383 -->
+                <xsl:call-template name="chopPunctuation">
+                    <xsl:with-param name="chopString">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">
+                                <xsl:choose>
+                                    <!-- #13383 include subfield e for field 111, Display only name portion in 1XX -->
+                                    <xsl:when test="@tag=111">aeq</xsl:when>
+                                    <xsl:when test="@tag=110">ab</xsl:when>
+                                    <xsl:otherwise>abcjq</xsl:otherwise>
+                                </xsl:choose>
+                            </xsl:with-param>
+                        </xsl:call-template>
+                    </xsl:with-param>
+                    <xsl:with-param name="punctuation">
+                        <xsl:text>:,;/ </xsl:text>
+                    </xsl:with-param>
+                </xsl:call-template>
+                    <!-- Display only name and title portion in 110 field -->
+                    <xsl:if test="@tag=110 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
+                    <span class="titleportion">
+                    <xsl:choose>
+                        <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
+                        <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
+                    </xsl:choose>
+                    <xsl:call-template name="chopPunctuation">
+                        <xsl:with-param name="chopString">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">cdnt</xsl:with-param>
+                        </xsl:call-template>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    </span>
+                    </xsl:if>
+                    <!-- Display only name and title portion in 111 field -->
+            <xsl:if test="@tag=111 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
+                    <span class="titleportion">
+                    <xsl:choose>
+                        <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
+                        <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
+                    </xsl:choose>
+
+                    <xsl:call-template name="chopPunctuation">
+                        <xsl:with-param name="chopString">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">cdgnt</xsl:with-param>
+                        </xsl:call-template>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    </span>
+            </xsl:if>
+            <!-- Display only dates in 100 field -->
+            <xsl:if test="@tag=100 and marc:subfield[@code='d']">
+                <span class="authordates">
+                <xsl:text>, </xsl:text>
+                <xsl:call-template name="chopPunctuation">
+                    <xsl:with-param name="chopString">
+                        <xsl:call-template name="subfieldSelect">
+                           <xsl:with-param name="codes">d</xsl:with-param>
+                        </xsl:call-template>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    </span>
+            </xsl:if>
+
+            </xsl:when>
+            <!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
+            <!--#13382 Added all relevant subfields 4, e, and d are handled separately -->
+            <xsl:when test="@tag=700 or @tag=710 or @tag=711">
+                    <!-- Includes major changes for 7XX fields; display name portion in 710 and 711 fields -->
+                    <xsl:if test="@tag=710 or @tag=711">
+                    <xsl:call-template name="chopPunctuation">
+                        <xsl:with-param name="chopString">
+                            <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">
+                            <xsl:choose>
+                                <xsl:when test="@tag=711">aeq</xsl:when>
+                                <xsl:otherwise>ab</xsl:otherwise>
+                            </xsl:choose>
+                            </xsl:with-param>
+                            </xsl:call-template>
+                        </xsl:with-param>
+                        <xsl:with-param name="punctuation">
+                            <xsl:text>:,;/ </xsl:text>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    <!-- Display only name and title portion in 711 field -->
+                    <xsl:if test="@tag=711 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
+                    <span class="titleportion">
+                    <xsl:choose>
+                        <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
+                        <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
+                    </xsl:choose>
+
+                    <xsl:call-template name="chopPunctuation">
+                        <xsl:with-param name="chopString">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">cdgnt</xsl:with-param>
+                        </xsl:call-template>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    </span>
+                    </xsl:if>
+                    <!-- Display only name and title portion in 710 field -->
+                    <xsl:if test="@tag=710 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
+                    <span class="titleportion">
+                    <xsl:choose>
+                        <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
+                        <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
+                    </xsl:choose>
+                    <xsl:call-template name="chopPunctuation">
+                        <xsl:with-param name="chopString">
+                        <xsl:call-template name="subfieldSelect">
+                            <xsl:with-param name="codes">cdnt</xsl:with-param>
+                        </xsl:call-template>
+                        </xsl:with-param>
+                    </xsl:call-template>
+                    </span>
+                    </xsl:if>
+
+                    </xsl:if>
+                        <!-- Display only name portion in 700 field -->
+                        <xsl:if test="@tag=700">
+                           <xsl:call-template name="chopPunctuation">
+                               <xsl:with-param name="chopString">
+                               <xsl:call-template name="subfieldSelect">
+                                  <xsl:with-param name="codes">abcq</xsl:with-param>
+                               </xsl:call-template>
+                               </xsl:with-param>
+                        </xsl:call-template>
+                        </xsl:if>
+                        <!-- Display class "authordates" in 700 field -->
+                        <xsl:if test="@tag=700 and marc:subfield[@code='d']">
+                        <span class="authordates">
+                        <xsl:text>, </xsl:text>
+                        <xsl:call-template name="chopPunctuation">
+                            <xsl:with-param name="chopString">
+                            <xsl:call-template name="subfieldSelect">
+                               <xsl:with-param name="codes">d</xsl:with-param>
+                            </xsl:call-template>
+                            </xsl:with-param>
+                        </xsl:call-template>
+                        </span>
+                        </xsl:if>
+                        <!-- Display class "titleportion" in 700 field -->
+                        <xsl:variable name="titleportionfields" select="boolean(marc:subfield[@code='t' or @code='j' or @code='k' or @code='u'])"/>
+                        <xsl:if test="@tag=700 and $titleportionfields">
+                        <span class="titleportion">
+                        <xsl:text>. </xsl:text>
+                        <xsl:call-template name="chopPunctuation">
+                            <xsl:with-param name="chopString">
+                            <xsl:call-template name="subfieldSelect">
+                                <xsl:with-param name="codes">fghjklmnoprstux</xsl:with-param>
+                            </xsl:call-template>
+                            </xsl:with-param>
+                        </xsl:call-template>
+                        </span>
+                        </xsl:if>
+
+        </xsl:when>
+        </xsl:choose>
+
+    <!-- add relator code too between brackets-->
+    <!-- #13383 include relator code j for field 111 -->
+            <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
+                <span class="relatorcode">
+                    <xsl:text> [</xsl:text>
+                    <xsl:choose>
+                        <xsl:when test="@tag=111 or @tag=711">
+                            <xsl:choose>
+                                <!-- Prefer j over 4 for fields 111 and 711-->
+                                <xsl:when test="marc:subfield[@code='j']">
+                                    <xsl:for-each select="marc:subfield[@code='j']">
+                                        <xsl:value-of select="."/>
+                                        <xsl:if test="position() != last()">, </xsl:if>
+                                    </xsl:for-each>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:for-each select="marc:subfield[@code=4]">
+                                        <xsl:value-of select="."/>
+                                        <xsl:if test="position() != last()">, </xsl:if>
+                                    </xsl:for-each>
+                                </xsl:otherwise>
+                            </xsl:choose>
+                        </xsl:when>
+                        <!-- Prefer e over 4 for fields 111 and 711-->
+                        <xsl:when test="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]">
+                            <xsl:for-each select="marc:subfield[@code='e']">
+                                <xsl:value-of select="."/>
+                                <xsl:if test="position() != last()">, </xsl:if>
+                            </xsl:for-each>
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:for-each select="marc:subfield[@code=4]">
+                                <xsl:value-of select="."/>
+                                <xsl:if test="position() != last()">, </xsl:if>
+                            </xsl:for-each>
+                        </xsl:otherwise>
+                    </xsl:choose>
+                    <xsl:text>]</xsl:text>
+                </span>
+            </xsl:if>
+        </a>
+        <xsl:choose>
+            <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
         </xsl:choose>
         </xsl:for-each>
-        </span>
-        </xsl:if>
+        </h5>
+
+       </xsl:if>
+    </xsl:template>
+
+    <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
+    <xsl:template name="subfieldSelectSubject">
+        <xsl:param name="codes"/>
+        <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
+        <xsl:param name="subdivCodes"/>
+        <xsl:param name="subdivDelimiter"/>
+        <xsl:param name="prefix"/>
+        <xsl:param name="suffix"/>
+        <xsl:variable name="str">
+            <xsl:for-each select="marc:subfield">
+                <xsl:if test="contains($codes, @code)">
+                    <xsl:if test="contains($subdivCodes, @code)">
+                        <xsl:value-of select="$subdivDelimiter"/>
+                    </xsl:if>
+                    <xsl:value-of select="$prefix"/><xsl:value-of select="translate(text(),'()','')"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/>
+                </xsl:if>
+            </xsl:for-each>
+        </xsl:variable>
+        <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
     </xsl:template>
 
 </xsl:stylesheet>