Bug 20339: Unify MARC21 ISBN/ISSN handling in XSL
The code to show the ISBN and ISSN is repeated between the search results and the detail view. Create a function to show the ISBN/ISSN, and call that instead. Test plan: 1) Apply patch 2) Search for any records, check that the ISBN and ISSN are shown correctly 3) Go to biblio detail pages, check that the ISBN and ISSN are shown correctly Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi> Signed-off-by: claude <claude.brayer@cea.fr> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
e20238ab98
commit
bf86fdd92d
|
|
@ -448,43 +448,7 @@
|
|||
</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:call-template name="showISBNISSN"/>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag=013]">
|
||||
<span class="results_summary patent_info">
|
||||
|
|
|
|||
|
|
@ -895,24 +895,7 @@
|
|||
</span>
|
||||
</xsl:if>
|
||||
|
||||
<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>
|
||||
</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>
|
||||
</span>
|
||||
</xsl:if>
|
||||
<xsl:call-template name="showISBNISSN"/>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag=250]">
|
||||
<span class="results_summary edition">
|
||||
|
|
|
|||
|
|
@ -298,6 +298,46 @@
|
|||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="showISBNISSN">
|
||||
<xsl:call-template name="showSingleSubfield">
|
||||
<xsl:with-param name="tag">020</xsl:with-param>
|
||||
<xsl:with-param name="code">a</xsl:with-param>
|
||||
<xsl:with-param name="class">isbn</xsl:with-param>
|
||||
<xsl:with-param name="label">ISBN: </xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="showSingleSubfield">
|
||||
<xsl:with-param name="tag">022</xsl:with-param>
|
||||
<xsl:with-param name="code">a</xsl:with-param>
|
||||
<xsl:with-param name="class">issn</xsl:with-param>
|
||||
<xsl:with-param name="label">ISSN: </xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="showSingleSubfield">
|
||||
<xsl:param name="tag"/>
|
||||
<xsl:param name="code"/>
|
||||
<xsl:param name="class"/>
|
||||
<xsl:param name="label"/>
|
||||
<xsl:if test="marc:datafield[@tag=$tag]/marc:subfield[@code=$code]">
|
||||
<span><xsl:attribute name="class"><xsl:value-of select="concat('results_summary ', $class)"/></xsl:attribute>
|
||||
<span class="label"><xsl:value-of select="$label"/></span>
|
||||
<xsl:for-each select="marc:datafield[@tag=$tag]/marc:subfield[@code=$code]">
|
||||
<span><xsl:attribute name="property"><xsl:value-of select="$class"/></xsl:attribute>
|
||||
<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:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
|
||||
|
|
|
|||
Loading…
Reference in New Issue