xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="marc items">
<xsl:import href="MARC21slimUtils.xsl"/>
- <xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" />
+ <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
<xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
<xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
- <xsl:variable name="ShowISBD" select="marc:sysprefs/marc:syspref[@name='viewISBD']"/>
<xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
<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='OPACDisplay856uAsImage']"/>
+ <xsl:variable name="TracingQuotesLeft">
+ <xsl:choose>
+ <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
+ <xsl:otherwise>"</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="TracingQuotesRight">
+ <xsl:choose>
+ <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
+ <xsl:otherwise>"</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:variable name="leader" select="marc:leader"/>
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
- <xsl:if test="marc:subfield[@code='b']">
+ <xsl:if test="marc:subfield[@code='h']">
<xsl:text> </xsl:text>
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">b</xsl:with-param>
+ <xsl:with-param name="codes">h</xsl:with-param>
</xsl:call-template>
</xsl:if>
- <xsl:if test="marc:subfield[@code='h']">
+ <xsl:if test="marc:subfield[@code='b']">
<xsl:text> </xsl:text>
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">h</xsl:with-param>
+ <xsl:with-param name="codes">b</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:text> </xsl:text>
</xsl:call-template>
</h5>
</xsl:if>
-
- <xsl:choose>
- <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
- <h5 class="author">by
- <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
- <a>
- <xsl:choose>
- <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="nameABCDQ"/></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>
-
- <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]">
- <a>
- <xsl:choose>
- <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="nameABCDN"/></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>
-
- <xsl:for-each select="marc:datafield[@tag=111 or @tag=711]">
- <xsl:choose>
- <xsl:when test="marc:subfield[@code='n']">
- <xsl:text> </xsl:text>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">n</xsl:with-param> </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:when>
- </xsl:choose>
- <a>
<xsl:choose>
- <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
+ <h5 class="author">by
+ <xsl:call-template name="showAuthor">
+ <xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111 or @tag=700 or @tag=710 or @tag=711]"/>
+ <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
+ </xsl:call-template>
+ </h5>
</xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="nameACDEQ"/></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>
- </h5>
- </xsl:when>
</xsl:choose>
<xsl:if test="$DisplayOPACiconsXSLT!='0'">
<span class="results_summary series"><span class="label">Series: </span>
<!-- 440 -->
<xsl:for-each select="marc:datafield[@tag=440]">
- <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-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 name="subfieldSelect">
</xsl:for-each>
<!-- 490 Series not traced, Ind1 = 0 -->
- <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
- <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
+ <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-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 name="subfieldSelect">
<xsl:if test="marc:datafield[@tag=490][@ind1=1]">
<xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
<xsl:choose>
- <xsl:when test="marc:subfield[@code='w']">
+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
<a href="/cgi-bin/koha/opac-search.pl?q=rcn:{marc:subfield[@code='w']}">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
</a>
</xsl:when>
<xsl:otherwise>
- <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-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 name="subfieldSelect">
<a>
<xsl:choose>
<xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/></xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
<a>
<xsl:choose>
<xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/></xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
<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:call-template>
</xsl:if>
+ <xsl:text> </xsl:text>
<xsl:if test="marc:subfield[@code='b']">
<a href="/cgi-bin/koha/opac-search.pl?q=pb:{marc:subfield[@code='b']}">
<xsl:call-template name="subfieldSelect">
</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: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>
</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:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abchnp</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>
+
<!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
<xsl:if test="$display880">
<xsl:call-template name="m880Select">
<xsl:when test="$TraceSubjectSubdivisions='1'">
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect">
<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:with-param>
- <xsl:with-param name="suffix">})</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/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:{<xsl:value-of select="marc:subfield[@code='a']"/>}</xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-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="chopPunctuation">
<!-- 505 -->
<xsl:if test="marc:datafield[@tag=505]">
+ <div class="results_summary contents">
<xsl:for-each select="marc:datafield[@tag=505]">
- <span class="results_summary contents">
- <xsl:choose>
- <xsl:when test="@ind1=1">
- <span class="label">Incomplete contents:</span>
- </xsl:when>
- <xsl:when test="@ind1=1">
- <span class="label">Partial contents:</span>
- </xsl:when>
- <xsl:otherwise>
- <span class="label">Contents:</span>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:if test="position()=1">
+ <xsl:choose>
+ <xsl:when test="@ind1=1">
+ <span class="label">Incomplete contents:</span>
+ </xsl:when>
+ <xsl:when test="@ind1=2">
+ <span class="label">Partial contents:</span>
+ </xsl:when>
+ <xsl:otherwise>
+ <span class="label">Contents:</span>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <div class='contentblock'>
<xsl:choose>
<xsl:when test="@ind2=0">
- <xsl:call-template name="subfieldSelect">
+ <xsl:call-template name="subfieldSelectSpan">
<xsl:with-param name="codes">tru</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">au</xsl:with-param>
+ <xsl:call-template name="subfieldSelectSpan">
+ <xsl:with-param name="codes">atru</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
- </span>
+ </div>
</xsl:for-each>
+ </div>
</xsl:if>
<!-- 583 -->
</span>
</xsl:for-each>
- <!-- 866 holdings public note -->
+ <!-- 866 textual holdings -->
<xsl:if test="marc:datafield[@tag=866]">
- <span class="results_summary holdings_note"><span class="label">Holdings Note: </span>
- <xsl:for-each select="marc:datafield[@tag=866]">
- <xsl:value-of select="marc:subfield[@code='z']"/>
- <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>
+ <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">az</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>
<!-- 775 Other Edition -->
<xsl:if test="marc:datafield[@tag=775]">
<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">
+ <xsl:with-param name="codes">a_t</xsl:with-param>
+ </xsl:call-template></xsl:with-param></xsl:call-template>
+ </xsl:variable>
<xsl:if test="marc:subfield[@code='i']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">i</xsl:with-param>
<xsl:attribute name="href">/cgi-bin/koha/opac-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/opac-search.pl?q=ti,phr:<xsl:value-of select="translate(marc:subfield[@code='t'], '.', '')"/></xsl:attribute>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">t</xsl:with-param>
+ <xsl:with-param name="codes">a_t</xsl:with-param>
</xsl:call-template>
</a>
<xsl:choose>
</xsl:template>
+ <xsl:template name="showAuthor">
+ <xsl:param name="authorfield" />
+ <xsl:param name="UseAuthoritiesForTracings" />
+ <xsl:for-each select="$authorfield">
+ <xsl:choose><xsl:when test="position()!=1"><xsl:text>; </xsl:text></xsl:when></xsl:choose>
+ <xsl:choose>
+ <xsl:when test="not(@tag=111 or @tag=711)" />
+ <xsl:when test="marc:subfield[@code='n']">
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">n</xsl:with-param>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ <a>
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-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"><xsl:call-template name="nameABCDQ"/></xsl:when>
+ <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']">
+ <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>
+ </xsl:if>
+ </a>
+ </xsl:for-each>
+ <xsl:text>.</xsl:text>
+ </xsl:template>
+
<xsl:template name="nameABCDQ">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
</xsl:call-template>
</xsl:for-each>
<xsl:for-each select="marc:subfield[@code='b']">
- <xsl:value-of select="."/>
+ <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">