[Koha] XSLT to add ISBD punctuation
Rubén Fernández Asensio
enseikou at gmail.com
Fri Sep 7 01:10:59 NZST 2018
Nevermind, this did the trick:
<xsl:if test="marc:datafield[@tag=245]">
<h1 class="title" property="name">
<xsl:for-each select="marc:datafield[@tag=245]">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
<!-- Subtítol -->
<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>
<!-- Responsabilitat -->
<xsl:if test="marc:subfield[@code='c']">
<xsl:text> / </xsl:text>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">c</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</h1>
</xsl:if>
Sorry to bother.
Rubén
El 06/09/18 a les 05:25, Rubén Fernández Asensio ha escrit:
> Hello all,
>
> Do any of you have any expertise on XSLT? I'm trying to have Koha add
> ISBD punctuation to my records in Detail view.
> I've started with MARC field 245. I've copied and modified my template
> to this:
>
> <xsl:if test="marc:datafield[@tag=245]">
> <h1 class="title" property="name">
> <xsl:for-each select="marc:datafield[@tag=245]">
> <xsl:call-template name="subfieldSelect">
> <xsl:with-param name="codes">a</xsl:with-param>
> </xsl:call-template>
> <xsl:text> </xsl:text>
> <!-- 13381 add additional subfields-->
> <!-- Subtítol -->
> <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='b']">
> <xsl:for-each select="marc:datafield[@tag=245]/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:text> </xsl:text>
> </xsl:for-each>
> </xsl:if>
> <!-- Menció de responsabilitat -->
> <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='c']">
> <xsl:for-each
> select="marc:datafield[@tag=245]/marc:subfield[@code='c']">
> <xsl:text>/ </xsl:text>
> <xsl:call-template name="subfieldSelect">
> <xsl:with-param name="codes">c</xsl:with-param>
> </xsl:call-template>
> <xsl:text> </xsl:text>
> </xsl:for-each>
> </xsl:if>
> </xsl:for-each>
> </h1>
> </xsl:if>
>
> And I've put its path in preference OPACXSLTDetailsDisplay, so that
> Detail View should now show something like this:
>
> Tuj apude : gvidilo tra la kvartalo de la Centra Oficejo de UEA /
> Humphrey Tonkin, en kunlaboro kun Peter Bulthuis kaj Francisco Veuthey
>
> But when I deploy it it doesn't work. The view appears blank in the
> beginning, and after a few refreshes it shows the record without
> punctuation.
>
> Any clues?
>
> Ruben
More information about the Koha
mailing list