Bugzilla – Attachment 158775 Details for
Bug 35305
Add XSLT for authority details page in staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35305: Add sample XSLT for UNIMARC authorities
Bug-35305-Add-sample-XSLT-for-UNIMARC-authorities.patch (text/plain), 33.04 KB, created by
Fridolin Somers
on 2023-11-09 22:12:20 UTC
(
hide
)
Description:
Bug 35305: Add sample XSLT for UNIMARC authorities
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2023-11-09 22:12:20 UTC
Size:
33.04 KB
patch
obsolete
>From cdb783ef553bbde0fb947da1761225cf3b218f27 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 9 Nov 2023 12:11:04 -1000 >Subject: [PATCH] Bug 35305: Add sample XSLT for UNIMARC authorities > >Also creates UNIMARCauthUtils.xsl to share templates with UNIMARCauthResults.xsl >--- > .../prog/en/xslt/UNIMARCauthDetails.xsl | 399 ++++++++++++++++++ > .../prog/en/xslt/UNIMARCauthResults.xsl | 169 ++------ > .../prog/en/xslt/UNIMARCauthUtils.xsl | 79 ++++ > 3 files changed, 508 insertions(+), 139 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthDetails.xsl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthUtils.xsl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthDetails.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthDetails.xsl >new file mode 100644 >index 0000000000..d698d36955 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthDetails.xsl >@@ -0,0 +1,399 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<xsl:stylesheet xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> >+ <xsl:import href="UNIMARCauthUtils.xsl"/> >+ <xsl:output omit-xml-declaration="yes" method="html" /> >+ <!-- ****************** Authority display *************** --> >+ <xsl:template match="marc:record"> >+ <xsl:variable name="authid" select="marc:controlfield[@tag='001']"/> >+ <xsl:element name="div"> >+ <xsl:attribute name="class"> >+ <xsl:text>authority-summary</xsl:text> >+ </xsl:attribute> >+ <!-- *********** Personal Name 200 ********* --> >+ <xsl:if test="marc:datafield[@tag='200']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=200]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="marc:subfield[@code='b']"/> >+ <xsl:if test="marc:subfield[@code='f']"> (<xsl:value-of select="marc:subfield[@code='f']"/>) </xsl:if> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=400]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">400</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Personal Name **--> >+ <!-- *********** Corporate Name 210 ********* --> >+ <xsl:if test="marc:datafield[@tag='210']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=210]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="marc:subfield[@code='b']"/> >+ <xsl:if test="marc:subfield[@code='f']"> (<xsl:value-of select="marc:subfield[@code='f']"/>) </xsl:if> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=410]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">410</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Corporate Name **--> >+ <!-- *********** Geographic Name 215 ********* --> >+ <xsl:if test="marc:datafield[@tag='215']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=215]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=415]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">415</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Geographic Name **--> >+ <!-- *********** Trademark 216 ********* --> >+ <xsl:if test="marc:datafield[@tag='216']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=216]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='f']"> (<xsl:value-of select="marc:subfield[@code='f']"/>) </xsl:if> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=416]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">416</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Trademark **--> >+ <!-- *********** Family Name 220 ********* --> >+ <xsl:if test="marc:datafield[@tag='220']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=220]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='f']"> (<xsl:value-of select="marc:subfield[@code='f']"/>) </xsl:if> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=420]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">420</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Family Name **--> >+ <!-- *********** Uniform Title 230 ********* --> >+ <xsl:if test="marc:datafield[@tag='230']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=230]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='b']"> >+ <xsl:text> [</xsl:text> >+ <xsl:value-of select="."/> >+ <xsl:text>]</xsl:text> >+ </xsl:if> >+ <xsl:if test="marc:subfield[@code='h']"> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:if> >+ <xsl:if test="marc:subfield[@code='i']"> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:if> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=430]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">430</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Uniform Title **--> >+ <!-- *********** Author Title 240 ********* --> >+ <xsl:if test="marc:datafield[@tag='240']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=240]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="marc:subfield[@code='t']"/> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=440]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">440</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Author Title **--> >+ <!-- *********** Subject 250 ********* --> >+ <xsl:if test="marc:datafield[@tag='250']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=250]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=450]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">450</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Subject **--> >+ <!-- *********** Genre/Form 280 ********* --> >+ <xsl:if test="marc:datafield[@tag='280']"> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=280]"> >+ <li class="heading"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='j'] or marc:subfield[@code='x'] or marc:subfield[@code='y'] or marc:subfield[@code='z']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='x']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='y']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ <xsl:for-each select="marc:subfield[@code='z']"> >+ <xsl:text> -- </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:for-each> >+ </xsl:if> >+ </li> >+ </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:call-template name="tag_3xx"/> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag=480]"> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">480</xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:call-template name="tag_5xx"/> >+ </xsl:if> >+ </ul> >+ </xsl:if> >+ <!-- *** End Genre/Form **--> >+ <!-- end div class authority-summary--> >+ </xsl:element> >+ <!-- end template --> >+ </xsl:template> >+</xsl:stylesheet> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthResults.xsl >index cb69c10745..5c5bc031fc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthResults.xsl >@@ -1,68 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> >- <xsl:output omit-xml-declaration="yes"/> >- <!-- ***************** Templates *************--> >- <xsl:template name="tag_152"> >- <li class="authtype"> >- <xsl:value-of select="marc:datafield[@tag='152']/marc:subfield[@code='b']"/> >- </li> >- </xsl:template> >- <xsl:template name="tag_3xx"> >- <li class="note"> >- <xsl:for-each select="marc:datafield[@tag >= 300 and @tag < 400]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text>. </xsl:text> >- </xsl:for-each> >- </li> >- </xsl:template> >- <xsl:template name="tag_5xx"> >- <li class="related"> >- <xsl:for-each select="marc:datafield[@tag >= 500 and @tag < 600]"> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='5']='g'"> >- <span class="leg">GT : </span> >- </xsl:when> >- <xsl:when test="marc:subfield[@code='5']='h'"> >- <span class="leg">ST : </span> >- </xsl:when> >- <xsl:otherwise> >- <span class="leg">RT : </span> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='9']"> >- <a> >- <xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="marc:subfield[@code='9']"/></xsl:attribute> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:if test="marc:subfield[@code='b']"> >- <xsl:text> </xsl:text> >- <xsl:value-of select="."/> >- </xsl:if> >- </a> >- </xsl:when> >- <xsl:when test="marc:subfield[@code='3']"> >- <a> >- <xsl:attribute name="href">/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&value=identifier-standard%3A<xsl:value-of select="marc:subfield[@code='3']"/></xsl:attribute> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:if test="marc:subfield[@code='b']"> >- <xsl:text> </xsl:text> >- <xsl:value-of select="."/> >- </xsl:if> >- </a> >- </xsl:when> >- <xsl:otherwise> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:if test="marc:subfield[@code='b']"> >- <xsl:text> </xsl:text> >- <xsl:value-of select="."/> >- </xsl:if> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >- </xsl:template> >- <!--*** End Templates **--> >+ <xsl:import href="UNIMARCauthUtils.xsl"/> >+ <xsl:output omit-xml-declaration="yes" method="html" /> > <!-- ****************** Authority display *************** --> > <xsl:template match="marc:record"> > <xsl:variable name="authid" select="marc:controlfield[@tag='001']"/> >@@ -107,15 +46,9 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=400]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=400]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> </xsl:text> >- <xsl:value-of select="marc:subfield[@code='b']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">400</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> >@@ -160,15 +93,9 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=410]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=410]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> </xsl:text> >- <xsl:value-of select="marc:subfield[@code='b']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">410</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> >@@ -210,13 +137,9 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=415]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=415]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">415</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> >@@ -259,15 +182,9 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=416]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=416]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> </xsl:text> >- <xsl:value-of select="marc:subfield[@code='b']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">416</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> >@@ -310,15 +227,9 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=420]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=420]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> </xsl:text> >- <xsl:value-of select="marc:subfield[@code='b']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">420</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> >@@ -373,15 +284,9 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=430]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=430]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> </xsl:text> >- <xsl:value-of select="marc:subfield[@code='b']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">430</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> >@@ -425,15 +330,9 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=440]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=440]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> </xsl:text> >- <xsl:value-of select="marc:subfield[@code='b']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">440</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> >@@ -475,13 +374,9 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=450]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=450]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">450</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> >@@ -523,20 +418,16 @@ > <xsl:call-template name="tag_3xx"/> > </xsl:if> > <xsl:if test="marc:datafield[@tag=480]"> >- <li class="usefor"> >- <span class="leg">UF : </span> >- <xsl:for-each select="marc:datafield[@tag=450]"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> ; </xsl:text> >- </xsl:for-each> >- </li> >+ <xsl:call-template name="tag_4xx"> >+ <xsl:with-param name="tag">480</xsl:with-param> >+ </xsl:call-template> > </xsl:if> > <xsl:if test="marc:datafield[@tag >= 500 and @tag < 600]"> > <xsl:call-template name="tag_5xx"/> > </xsl:if> > </ul> > </xsl:if> >- <!-- *** End Subject **--> >+ <!-- *** End Genre/Form **--> > <!-- end div class authority-summary--> > </xsl:element> > <!-- end template --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthUtils.xsl >new file mode 100644 >index 0000000000..8dc4269cf1 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthUtils.xsl >@@ -0,0 +1,79 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<xsl:stylesheet xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> >+ <!-- ***************** Templates *************--> >+ <xsl:template name="tag_152"> >+ <li class="authtype"> >+ <xsl:value-of select="marc:datafield[@tag='152']/marc:subfield[@code='b']"/> >+ </li> >+ </xsl:template> >+ <xsl:template name="tag_3xx"> >+ <li class="note"> >+ <xsl:for-each select="marc:datafield[@tag >= 300 and @tag < 400]"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:text>. </xsl:text> >+ </xsl:for-each> >+ </li> >+ </xsl:template> >+ <xsl:template name="tag_4xx"> >+ <xsl:param name="tag" /> >+ <li class="usefor"> >+ <span class="leg">UF : </span> >+ <xsl:for-each select="marc:datafield[@tag=$tag]"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='b']"> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="marc:subfield[@code='b']"/> >+ </xsl:if> >+ <xsl:text> ; </xsl:text> >+ </xsl:for-each> >+ </li> >+ </xsl:template> >+ <xsl:template name="tag_5xx"> >+ <li class="related"> >+ <xsl:for-each select="marc:datafield[@tag >= 500 and @tag < 600]"> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='5']='g'"> >+ <span class="leg">GT : </span> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code='5']='h'"> >+ <span class="leg">ST : </span> >+ </xsl:when> >+ <xsl:otherwise> >+ <span class="leg">RT : </span> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='9']"> >+ <a> >+ <xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="marc:subfield[@code='9']"/></xsl:attribute> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='b']"> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:if> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code='3']"> >+ <a> >+ <xsl:attribute name="href">/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&value=identifier-standard%3A<xsl:value-of select="marc:subfield[@code='3']"/></xsl:attribute> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='b']"> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:if> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:if test="marc:subfield[@code='b']"> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="."/> >+ </xsl:if> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:text> ; </xsl:text> >+ </xsl:for-each> >+ </li> >+ </xsl:template> >+ <!--*** End Templates **--> >+</xsl:stylesheet> >-- >2.42.0
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 35305
:
158772
|
158775
|
158781
|
167302
|
167303
|
167304
|
167305
|
167362
|
167363
|
167364
|
173439
|
173440
|
173441