changes to OPAC results and detail XSLT

Various changes to OPAC search results and bib
detail display for MARC21.

* Search results

[1] 245 subfields will be displayed in order $a, $b, $h, then
    rest of subfields in the order they appear in the record.
[2] New edition field from 250$a, displayed under author
[3] New other title field from 246$a$b, displayed under call number

* Bib details

[1] 245 subfields will be displayed in order $a, $b, $h, then
    rest of subfields in the order they appear in the record.
[2] New edition field from 250$a$b, displayed under publisher
[3] New description field from 300$a$b$c$e$g, under the edition.
[4] New other title field from the 246$i$a$b$h$f$g$n$p, above the
    uniform title field.
[6] All 6XX fields are displayed in the subjects field.
[7] '--' now separates subdivisions in subject headings.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Galen Charlton 2009-02-11 17:01:01 -06:00
parent 2026c28797
commit 8f9618833e
3 changed files with 113 additions and 58 deletions

View file

@ -54,7 +54,22 @@
<h1> <h1>
<xsl:for-each select="marc:datafield[@tag=245]"> <xsl:for-each select="marc:datafield[@tag=245]">
<xsl:call-template name="subfieldSelect"> <xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abfghk</xsl:with-param> <xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
<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: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:call-template name="subfieldSelect">
<xsl:with-param name="codes">fgknps</xsl:with-param>
</xsl:call-template> </xsl:call-template>
</xsl:for-each> </xsl:for-each>
</h1> </h1>
@ -62,7 +77,6 @@
<xsl:choose> <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]"> <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 <h5 class="author">by
<xsl:for-each select="marc:datafield[@tag=100 or @tag=700]"> <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
<a> <a>
@ -169,7 +183,37 @@
</xsl:for-each> </xsl:for-each>
</span> </span>
</xsl:if> </xsl:if>
<xsl:if test="marc:datafield[@tag=020]"> <xsl:if test="marc:datafield[@tag=250]">
<span class="results_summary"><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>
<xsl:if test="marc:datafield[@tag=300]">
<span class="results_summary"><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">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>
</span>
</xsl:if>
<xsl:if test="marc:datafield[@tag=020]">
<span class="results_summary"><span class="label">ISBN: </span> <span class="results_summary"><span class="label">ISBN: </span>
<!-- unAPI <abbr/> tag --> <!-- unAPI <abbr/> tag -->
<xsl:for-each select="marc:datafield[@tag=020]"> <xsl:for-each select="marc:datafield[@tag=020]">
@ -189,6 +233,21 @@
</span> </span>
</xsl:if> </xsl:if>
<xsl:if test="marc:datafield[@tag=246]">
<span class="results_summary"><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">iabhfgnp</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=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]"> <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
<span class="results_summary"><span class="label">Uniform titles: </span> <span class="results_summary"><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:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
@ -211,9 +270,9 @@
</span> </span>
</xsl:if> </xsl:if>
<xsl:if test="marc:datafield[@tag=650]"> <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
<span class="results_summary"><span class="label">Related Subjects: </span> <span class="results_summary"><span class="label">Related Subjects: </span>
<xsl:for-each select="marc:datafield[@tag=650]"> <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
<a> <a>
<xsl:choose> <xsl:choose>
<xsl:when test="marc:subfield[@code=9]"> <xsl:when test="marc:subfield[@code=9]">
@ -227,6 +286,8 @@
<xsl:with-param name="chopString"> <xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect"> <xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcdvxyz</xsl:with-param> <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
<xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
<xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
</xsl:call-template> </xsl:call-template>
</xsl:with-param> </xsl:with-param>
</xsl:call-template> </xsl:call-template>

View file

@ -377,19 +377,24 @@
<xsl:if test="marc:datafield[@tag=245]"> <xsl:if test="marc:datafield[@tag=245]">
<xsl:for-each select="marc:datafield[@tag=245]"> <xsl:for-each select="marc:datafield[@tag=245]">
<xsl:variable name="title"> <xsl:variable name="title">
<xsl:choose> <xsl:call-template name="subfieldSelect">
<xsl:when test="marc:subfield[@code='b']"> <xsl:with-param name="codes">a</xsl:with-param>
<xsl:call-template name="specialSubfieldSelect">
<xsl:with-param name="axis">b</xsl:with-param>
<xsl:with-param name="beforeCodes">afghk</xsl:with-param>
</xsl:call-template> </xsl:call-template>
</xsl:when> <xsl:if test="marc:subfield[@code='b']">
<xsl:otherwise> <xsl:text> </xsl:text>
<xsl:call-template name="subfieldSelect"> <xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abfgk</xsl:with-param> <xsl:with-param name="codes">b</xsl:with-param>
</xsl:call-template> </xsl:call-template>
</xsl:otherwise> </xsl:if>
</xsl:choose> <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:call-template name="subfieldSelect">
<xsl:with-param name="codes">fgknps</xsl:with-param>
</xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:variable name="titleChop"> <xsl:variable name="titleChop">
<xsl:call-template name="chopPunctuation"> <xsl:call-template name="chopPunctuation">
@ -399,20 +404,6 @@
</xsl:call-template> </xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:value-of select="$titleChop"/> <xsl:value-of select="$titleChop"/>
<xsl:if test="marc:subfield[@code='b']">
<xsl:text> : </xsl:text>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="specialSubfieldSelect">
<xsl:with-param name="axis">b</xsl:with-param>
<xsl:with-param name="anyCodes">b</xsl:with-param>
<xsl:with-param name="afterCodes">afghk</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
<xsl:call-template name="part"/>
</xsl:for-each> </xsl:for-each>
</xsl:if> </xsl:if>
</a> </a>
@ -457,6 +448,18 @@
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</p> </p>
<xsl:if test="marc:datafield[@tag=250]">
<span class="results_summary">
<span class="label">Edition: </span>
<xsl:for-each select="marc:datafield[@tag=250]">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">ab</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</span>
</xsl:if>
<span class="results_summary"> <span class="results_summary">
<xsl:if test="$typeOf008"> <xsl:if test="$typeOf008">
<span class="label">Type: </span> <span class="label">Type: </span>
@ -805,6 +808,18 @@
</span> </span>
</xsl:if> </xsl:if>
<xsl:if test="marc:datafield[@tag=246]">
<span class="results_summary">
<span class="label">Other title: </span>
<xsl:for-each select="marc:datafield[@tag=246]">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">ab</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</span>
</xsl:if>
<span class="results_summary"> <span class="results_summary">
<span class="label">Availability: </span> <span class="label">Availability: </span>
<xsl:choose> <xsl:choose>
@ -1005,32 +1020,6 @@
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template name="part">
<xsl:variable name="partNumber">
<xsl:call-template name="specialSubfieldSelect">
<xsl:with-param name="axis">n</xsl:with-param>
<xsl:with-param name="anyCodes">n</xsl:with-param>
<xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="partName">
<xsl:call-template name="specialSubfieldSelect">
<xsl:with-param name="axis">p</xsl:with-param>
<xsl:with-param name="anyCodes">p</xsl:with-param>
<xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:if test="string-length(normalize-space($partNumber))">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString" select="$partNumber"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="string-length(normalize-space($partName))">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString" select="$partName"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="chopBrackets"> <xsl:template name="chopBrackets">
<xsl:param name="chopString"></xsl:param> <xsl:param name="chopString"></xsl:param>
<xsl:variable name="string"> <xsl:variable name="string">

View file

@ -22,9 +22,14 @@
<xsl:template name="subfieldSelect"> <xsl:template name="subfieldSelect">
<xsl:param name="codes"/> <xsl:param name="codes"/>
<xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="subdivCodes"/>
<xsl:param name="subdivDelimiter"/>
<xsl:variable name="str"> <xsl:variable name="str">
<xsl:for-each select="marc:subfield"> <xsl:for-each select="marc:subfield">
<xsl:if test="contains($codes, @code)"> <xsl:if test="contains($codes, @code)">
<xsl:if test="contains($subdivCodes, @code)">
<xsl:value-of select="$subdivDelimiter"/>
</xsl:if>
<xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/> <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>