[Koha] [EXTERNAL] Re: Another XSLT question: adding a line break between multiple names

Fridolin SOMERS fridolin.somers at biblibre.com
Thu Mar 2 18:25:16 NZDT 2023


Note the ending /
Tags generated by XSLT must be XTML so no <br> alone, <br/>
Otherwise you may do this with <div> tags and some CSS

Best regards,

Le 24/02/2023 à 08:01, King, Fred a écrit :
> Yep, that worked. I probably just *thought* I’d tried that.
> 
> Thanks,
> 
> --Fred
> 
> From: Coehoorn, Joel <jcoehoorn at york.edu>
> Sent: Thursday, February 23, 2023 12:02 PM
> To: King, Fred <Fred.King at Medstar.net>
> Cc: koha-US list <koha-us at koha-us.org>; koha <koha at lists.katipo.co.nz>
> Subject: [EXTERNAL] Re: [Koha] Another XSLT question: adding a line break between multiple names
> 
> 
> **ATTENTION: This email originated from outside the MedStar Health network.
> ** DO NOT CLICK links or attachments unless you recognize the sender and know the content is safe.
> 
> 
> 
> Try replacing all this:
> 
> <span class="separator"><xsl:text> | </xsl:text></span>
> 
> with this:
> 
> <br/>
> 
> Joel Coehoorn
> Director of Information Technology
> York University
> Office: 402-363-5603 | jcoehoorn at york.edu<mailto:jcoehoorn at york.edu> | york.edu<https://york.edu>
> 
> 
> On Wed, Feb 22, 2023 at 5:05 PM King, Fred <Fred.King at medstar.net<mailto:Fred.King at medstar.net>> wrote:
> Hi everyone,
> 
> I have another XLST question that I haven't been able to figure out: I'm using the 700 field for authors, and I want to start additional authors on a new line instead of separating them by |.
> 
> This is what I have now:
> 
>      <!-- arthurs -->
> <xsl:if test="marc:datafield[@tag=700]">
>             <span class="results_summary authors">
>                 <xsl:if test="marc:datafield[@tag=700]/@ind1=' '">
>                     <span class="label">MedStar authors: </span>
>                 </xsl:if>
>                 <xsl:for-each select="marc:datafield[@tag=700]">
>                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au<http://opac-search.pl?q=au>:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute><xsl:value-of select="marc:subfield[@code='a']"/></a>
>                    <xsl:if test="marc:subfield[@code='b']"><a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au<http://opac-search.pl?q=au>:"<xsl:value-of select="marc:subfield[@code='b']"/>"</xsl:attribute><xsl:text>, </xsl:text><xsl:value-of select="marc:subfield[@code='b']"/></a></xsl:if>
>                    <xsl:if test="marc:subfield[@code='c']"><a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au<http://opac-search.pl?q=au>:"<xsl:value-of select="marc:subfield[@code='c']"/>"</xsl:attribute><xsl:text>, </xsl:text><xsl:value-of select="marc:subfield[@code='c']"/></a></xsl:if>
>                               <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
>                 </xsl:for-each>
>             </span>
>         </xsl:if>
> 
> And it shows on the OPAC details page the way it should:
>     Arthur, King, field_b, field_c | Doyle, Arthur Conan | Arthur, Chester Alan, field_b | Murray, Arthur, field_c
> 
> But what I'd really like is this:
>     Arthur, King, field_b, field_c
>     Doyle, Arthur Conan
>     Arthur, Chester Alan, field_b
>    Murray, Arthur, field_c
> 
> Nothing I've tried so far has worked. Any suggestions?
> 
> Thanks!
> 
> --Fred
> 
> Fred King, MSLS, AHIP
> Medical Librarian, MedStar Washington Hospital Center
> fred.king at medstar.net<mailto:fred.king at medstar.net>
> 202-877-6670
> ORCID 0000-0001-5266-0279
> MedStar Authors Catalog: http://medstarauthors.org
> 
> You know it's cold outside when you go outside and it's cold.
> --NPS Twitter
> 
> ----------------------------------------------------------------------
> MedStar Health is a not-for-profit, integrated healthcare delivery system, the largest in Maryland and the Washington, D.C., region. Nationally recognized for clinical quality in heart, orthopedics, cancer and GI.
> 
> IMPORTANT: This e-mail (including any attachments) may contain information that is private, confidential, or protected by attorney-client or other privilege. If you received this e-mail in error, please delete it from your system without copying it and notify sender by reply e-mail, so that our records can be corrected... Thank you.
> 
> Help conserve valuable resources - only print this email if necessary.
> 
> 
> _______________________________________________
> 
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz<mailto:Koha at lists.katipo.co.nz>
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
> _______________________________________________
> 
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha

-- 
Fridolin SOMERS <fridolin.somers at biblibre.com>
Software and system maintainer 🦄
BibLibre, France


More information about the Koha mailing list