[Koha] XSLT to add ISBD punctuation

Rubén Fernández Asensio enseikou at gmail.com
Thu Sep 6 15:25:40 NZST 2018


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