[Koha-patches] [PATCH] Bugs 2822, 2551, 3163 fixes to XSLT

Jane Wagner jwagner at ptfs.com
Tue Apr 28 14:01:25 CEST 2009


Resent with additional comments.

Bug 2822 -- for leader6 types of i (nonmusical) or j (musical), the hitlist
uses an icon and label of Sound while the record display page uses
Music.  Modified record display to use Sound.

Bug 2551 -- for leader7 type of i says it's type Serial which is incorrect.
The bug report suggested Integrating Resource" but the latest install's
hitlist page uses Continuing Resource.  Changed the record display page
to also use Continuing Resource.

Bug 3163 -- if you have a 110 or 710 with a subfield a and a subfield b,
there's no space between them (on either hitlist or record display).
The two headings run together in the display.  Modified the utils file
to force a space.

The XSLT files referenced two icons which did not exist (globe.png and
drive_remote.png. Replaced those with icons from the same subject area
(world.png and drive_web.png).  Also, corrected spelling of icon name
from pencile.png to pencil.png.

---
 .../prog/en/xslt/MARC21slim2OPACDetail.xsl         |    4 +-
 .../prog/en/xslt/MARC21slim2OPACResults.xsl        |   12 +-
 .../opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl     |  141 ++++++++++----------
 3 files changed, 79 insertions(+), 78 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
index 34ff0c5..b237c64 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
@@ -37,7 +37,7 @@
                 <xsl:when test="$leader6='a'">
                     <xsl:choose>
                         <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
-                        <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">Serial</xsl:when>
+                        <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">Continuing Resource</xsl:when>
                     </xsl:choose>
                 </xsl:when>
                 <xsl:when test="$leader6='t'">Book</xsl:when>
@@ -45,7 +45,7 @@
                 <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='o' or $leader6='r'">Visual Material</xsl:when>
-                <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Music</xsl:when>
+                <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Sound</xsl:when>
             </xsl:choose>
         </xsl:variable>
 
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
index f027546..d2edb65 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
@@ -160,7 +160,7 @@
                 <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="optical disc" title="optical disc"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='r']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/drive_remote.png" alt="remote" title="remote"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/drive_web.png" alt="remote" title="remote"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='a']">
                 tape cartridge
@@ -173,16 +173,16 @@
             </xsl:if>
 
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='a']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/globe.png" alt="celestial globe" title="celestial globe"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="celestial globe" title="celestial globe"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='e']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/globe.png" alt="earth moon globe" title="earth moon globe"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="earth moon globe" title="earth moon globe"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='b']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/globe.png" alt="planetary or lunar globe" title="planetary or lunar globe"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="planetary or lunar globe" title="planetary or lunar globe"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='c']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/globe.png" alt="terrestrial globe" title="terrestrial globe"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="terrestrial globe" title="terrestrial globe"/>
             </xsl:if>
 
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='o'][substring(text(),2,1)='o']">
@@ -251,7 +251,7 @@
                 collage
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='d']">
-                 <img src="/opac-tmpl/prog/famfamfam/silk/pencile.png" alt="drawing" title="drawing"/>
+                 <img src="/opac-tmpl/prog/famfamfam/silk/pencil.png" alt="drawing" title="drawing"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='o']">
                 <img src="/opac-tmpl/prog/famfamfam/silk/note.png" alt="flash card" title="flash card"/>
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl
index edd28c3..917c10d 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl
@@ -1,70 +1,71 @@
-<?xml version='1.0'?>
-<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-	<xsl:template name="datafield">
-		<xsl:param name="tag"/>
-		<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
-		<xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
-		<xsl:param name="subfields"/>
-		<xsl:element name="datafield">
-			<xsl:attribute name="tag">
-				<xsl:value-of select="$tag"/>
-			</xsl:attribute>
-			<xsl:attribute name="ind1">
-				<xsl:value-of select="$ind1"/>
-			</xsl:attribute>
-			<xsl:attribute name="ind2">
-				<xsl:value-of select="$ind2"/>
-			</xsl:attribute>
-			<xsl:copy-of select="$subfields"/>
-		</xsl:element>
-	</xsl:template>
-
-	<xsl:template name="subfieldSelect">
-		<xsl:param name="codes"/>
-		<xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
-		<xsl:param name="subdivCodes"/>
-		<xsl:param name="subdivDelimiter"/>
-		<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="text()"/><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:template name="buildSpaces">
-		<xsl:param name="spaces"/>
-		<xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
-		<xsl:if test="$spaces>0">
-			<xsl:value-of select="$char"/>
-			<xsl:call-template name="buildSpaces">
-				<xsl:with-param name="spaces" select="$spaces - 1"/>
-				<xsl:with-param name="char" select="$char"/>
-			</xsl:call-template>
-		</xsl:if>
-	</xsl:template>
-
-	<xsl:template name="chopPunctuation">
-		<xsl:param name="chopString"/>
-		<xsl:variable name="length" select="string-length($chopString)"/>
-		<xsl:choose>
-			<xsl:when test="$length=0"/>
-			<xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">
-				<xsl:call-template name="chopPunctuation">
-					<xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
-				</xsl:call-template>
-			</xsl:when>
-			<xsl:when test="not($chopString)"/>
-			<xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
-		</xsl:choose>
-	</xsl:template>
-</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
-<metaInformation>
-<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
-</metaInformation>
--->
+<?xml version='1.0'?>
+<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:template name="datafield">
+		<xsl:param name="tag"/>
+		<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
+		<xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
+		<xsl:param name="subfields"/>
+		<xsl:element name="datafield">
+			<xsl:attribute name="tag">
+				<xsl:value-of select="$tag"/>
+			</xsl:attribute>
+			<xsl:attribute name="ind1">
+				<xsl:value-of select="$ind1"/>
+			</xsl:attribute>
+			<xsl:attribute name="ind2">
+				<xsl:value-of select="$ind2"/>
+			</xsl:attribute>
+			<xsl:copy-of select="$subfields"/>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template name="subfieldSelect">
+		<xsl:param name="codes"/>
+		<xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
+		<xsl:param name="subdivCodes"/>
+		<xsl:param name="subdivDelimiter"/>
+		<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="text()"/><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:template name="buildSpaces">
+		<xsl:param name="spaces"/>
+		<xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
+		<xsl:if test="$spaces>0">
+			<xsl:value-of select="$char"/>
+			<xsl:call-template name="buildSpaces">
+				<xsl:with-param name="spaces" select="$spaces - 1"/>
+				<xsl:with-param name="char" select="$char"/>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template name="chopPunctuation">
+		<xsl:param name="chopString"/>
+		<xsl:variable name="length" select="string-length($chopString)"/>
+		<xsl:choose>
+			<xsl:when test="$length=0"/>
+			<xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">
+				<xsl:call-template name="chopPunctuation">
+					<xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not($chopString)"/>
+			<xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
+		</xsl:choose>
+<xsl:text> </xsl:text>
+	</xsl:template>
+</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
+<metaInformation>
+<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
+</metaInformation>
+-->
-- 
1.5.6.5




More information about the Koha-patches mailing list