Bugzilla – Attachment 114604 Details for
Bug 19220
Allow XSLT processing for Z39.50 authority targets like for bibliographic targets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19220: Allow XSLT processing for Z39.50 authority targets
Bug-19220-Allow-XSLT-processing-for-Z3950-authorit.patch (text/plain), 2.32 KB, created by
Matthias Meusburger
on 2020-12-22 14:53:36 UTC
(
hide
)
Description:
Bug 19220: Allow XSLT processing for Z39.50 authority targets
Filename:
MIME Type:
Creator:
Matthias Meusburger
Created:
2020-12-22 14:53:36 UTC
Size:
2.32 KB
patch
obsolete
>From 47c39a80da01afb40dc764242c313c5cc8ba4f95 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Tue, 22 Dec 2020 15:41:53 +0100 >Subject: [PATCH] Bug 19220: Allow XSLT processing for Z39.50 authority targets > >Test plan: > > 1) Apply the patch > 2) Edit an authority Z3950/SRU source in Home > Administration > Z39.50/SRU servers > 3) Add the path to an XSLT file in the "XSLT File(s) for transforming results" input, and save > 4) Remove the content of the import_records table to avoid cache issues > 5) Search for an authority with the "New from Z39.50/SRU" button in authorities home > 6) Check that the XSLT transformation has been applied, both in results list and in the import window > >Here is an example XSLT which removes the 801 field from authorities: > ><?xml version="1.0" encoding="UTF-8"?> ><xsl:stylesheet xmlns:marc="http://www.loc.gov/MARC21/slim" version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > > <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> > > <xsl:strip-space elements="*"/> > > <xsl:template match="@* | node()"> > <xsl:copy> > <xsl:apply-templates select="@* | node()"/> > </xsl:copy> > </xsl:template> > > <xsl:template match="marc:datafield[@tag='801']"> > </xsl:template> > ></xsl:stylesheet> >--- > C4/Breeding.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 2a4ce3c..30264c5 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -549,6 +549,7 @@ sub Z3950SearchAuth { > my $query; > my $nterms=0; > >+ my $xslh = Koha::XSLT::Base->new; > my $marcflavour = C4::Context->preference('marcflavour'); > my $marc_type = $marcflavour eq 'UNIMARC' ? 'UNIMARCAUTH' : $marcflavour; > my $authid= $pars->{authid}; >@@ -615,6 +616,8 @@ sub Z3950SearchAuth { > } else { > ( $marcrecord, $charset_result, $charset_errors ) = MarcToUTF8Record( $marcdata, $marc_type, $encoding[$k] ); > } >+ my $error; >+ ( $marcrecord, $error ) = _do_xslt_proc($marcrecord, $servers[$k], $xslh); > my $heading; > my $heading_authtype_code; > $heading_authtype_code = GuessAuthTypeCode($marcrecord); >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19220
:
114604
|
121897
|
121906
|
121907
|
172627
|
172628
|
173438