Bug 14054: 246 XSLT Improvements

Adds other title type based on ind2 value. ind2 overridden by $i value.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
This commit is contained in:
Winona Salesky 2015-06-09 10:18:05 -04:00 committed by Tomas Cohen Arazi
parent 53dd856c66
commit 67fa231a74
2 changed files with 61 additions and 29 deletions

View file

@ -517,20 +517,36 @@
</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">iabhfgnp</xsl:with-param>
<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:with-param>
</xsl:call-template>
<!-- #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="@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>

View file

@ -551,23 +551,39 @@
</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]">
<span property="alternateName">
<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: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]">
<span property="alternateName">
<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>
</span>
<!-- #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>
<!-- #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>
<xsl:if test="marc:datafield[@tag=242]">