Bugzilla – Attachment 129525 Details for
Bug 28976
In MARC21slimUtils.xsl param 'punctuation' is missing in 'chopPunctuation'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
retab MARC21slimUtils.xsl files
retab-MARC21slimUtilsxsl-files.patch (text/plain), 21.27 KB, created by
Marion Durand
on 2022-01-17 13:41:57 UTC
(
hide
)
Description:
retab MARC21slimUtils.xsl files
Filename:
MIME Type:
Creator:
Marion Durand
Created:
2022-01-17 13:41:57 UTC
Size:
21.27 KB
patch
obsolete
>From 8934ba425e086c033075bf61b487af9daa4106b7 Mon Sep 17 00:00:00 2001 >From: Marion Durand <marion.durand@biblibre.com> >Date: Wed, 22 Sep 2021 15:20:01 +0200 >Subject: [PATCH] retab MARC21slimUtils.xsl files > >replace tab with 4 spaces > >https://bugs.koha-community.org/show_bug.cgi?id=28976 >--- > .../prog/en/xslt/MARC21slimUtils.xsl | 230 +++++++++--------- > .../bootstrap/en/xslt/MARC21slimUtils.xsl | 152 ++++++------ > 2 files changed, 191 insertions(+), 191 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index 4b83751449..cc7e2f9870 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -6,43 +6,43 @@ > xmlns:str="http://exslt.org/strings" > exclude-result-prefixes="marc str"> > <xsl:include href="MARC21Languages.xsl"/> >- <xsl:template name="datafield"> >- <xsl:param name="tag"/> >- <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param> >- <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param> >- <xsl:param name="subfields"/> >- <xsl:element name="datafield"> >- <xsl:attribute name="tag"> >- <xsl:value-of select="$tag"/> >- </xsl:attribute> >- <xsl:attribute name="ind1"> >- <xsl:value-of select="$ind1"/> >- </xsl:attribute> >- <xsl:attribute name="ind2"> >- <xsl:value-of select="$ind2"/> >- </xsl:attribute> >- <xsl:copy-of select="$subfields"/> >- </xsl:element> >- </xsl:template> >+ <xsl:template name="datafield"> >+ <xsl:param name="tag"/> >+ <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param> >+ <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param> >+ <xsl:param name="subfields"/> >+ <xsl:element name="datafield"> >+ <xsl:attribute name="tag"> >+ <xsl:value-of select="$tag"/> >+ </xsl:attribute> >+ <xsl:attribute name="ind1"> >+ <xsl:value-of select="$ind1"/> >+ </xsl:attribute> >+ <xsl:attribute name="ind2"> >+ <xsl:value-of select="$ind2"/> >+ </xsl:attribute> >+ <xsl:copy-of select="$subfields"/> >+ </xsl:element> >+ </xsl:template> > >- <xsl:template name="subfieldSelect"> >- <xsl:param name="codes"/> >- <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> >- <xsl:param name="subdivCodes"/> >- <xsl:param name="subdivDelimiter"/> >+ <xsl:template name="subfieldSelect"> >+ <xsl:param name="codes"/> >+ <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> >+ <xsl:param name="subdivCodes"/> >+ <xsl:param name="subdivDelimiter"/> > <xsl:param name="prefix"/> > <xsl:param name="suffix"/> > <xsl:param name="urlencode"/> >- <xsl:variable name="str"> >- <xsl:for-each select="marc:subfield"> >- <xsl:if test="contains($codes, @code)"> >+ <xsl:variable name="str"> >+ <xsl:for-each select="marc:subfield"> >+ <xsl:if test="contains($codes, @code)"> > <xsl:if test="contains($subdivCodes, @code)"> > <xsl:value-of select="$subdivDelimiter"/> > </xsl:if> >- <xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/> >- </xsl:if> >- </xsl:for-each> >- </xsl:variable> >+ <xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/> >+ </xsl:if> >+ </xsl:for-each> >+ </xsl:variable> > <xsl:choose> > <xsl:when test="$urlencode=1"> > <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/> >@@ -51,7 +51,7 @@ > <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> > </xsl:otherwise> > </xsl:choose> >- </xsl:template> >+ </xsl:template> > > <xsl:template name="subfieldSelectSpan"> > <xsl:param name="codes"/> >@@ -79,17 +79,17 @@ > </xsl:for-each> > </xsl:template> > >- <xsl:template name="buildSpaces"> >- <xsl:param name="spaces"/> >- <xsl:param name="char"><xsl:text> </xsl:text></xsl:param> >- <xsl:if test="$spaces>0"> >- <xsl:value-of select="$char"/> >- <xsl:call-template name="buildSpaces"> >- <xsl:with-param name="spaces" select="$spaces - 1"/> >- <xsl:with-param name="char" select="$char"/> >- </xsl:call-template> >- </xsl:if> >- </xsl:template> >+ <xsl:template name="buildSpaces"> >+ <xsl:param name="spaces"/> >+ <xsl:param name="char"><xsl:text> </xsl:text></xsl:param> >+ <xsl:if test="$spaces>0"> >+ <xsl:value-of select="$char"/> >+ <xsl:call-template name="buildSpaces"> >+ <xsl:with-param name="spaces" select="$spaces - 1"/> >+ <xsl:with-param name="char" select="$char"/> >+ </xsl:call-template> >+ </xsl:if> >+ </xsl:template> > > <xsl:template name="buildBiblioDefaultViewURL"> > <xsl:param name="IntranetBiblioDefaultView"/> >@@ -112,42 +112,42 @@ > </xsl:choose> > </xsl:template> > >- <xsl:template name="chopPunctuation"> >- <xsl:param name="chopString"/> >- <xsl:param name="punctuation"><xsl:text>.:,;/ </xsl:text></xsl:param> >- <xsl:variable name="length" select="string-length($chopString)"/> >- <xsl:choose> >- <xsl:when test="$length=0"/> >- <xsl:when test="contains($punctuation, substring($chopString,$length,1))"> >- <xsl:call-template name="chopPunctuation"> >- <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/> >- <xsl:with-param name="punctuation" select="$punctuation"/> >- </xsl:call-template> >- </xsl:when> >- <xsl:when test="not($chopString)"/> >- <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise> >- </xsl:choose> >- </xsl:template> >+ <xsl:template name="chopPunctuation"> >+ <xsl:param name="chopString"/> >+ <xsl:param name="punctuation"><xsl:text>.:,;/ </xsl:text></xsl:param> >+ <xsl:variable name="length" select="string-length($chopString)"/> >+ <xsl:choose> >+ <xsl:when test="$length=0"/> >+ <xsl:when test="contains($punctuation, substring($chopString,$length,1))"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/> >+ <xsl:with-param name="punctuation" select="$punctuation"/> >+ </xsl:call-template> >+ </xsl:when> >+ <xsl:when test="not($chopString)"/> >+ <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> > >- <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w. >- Parameter: control number string. >- Assumes LOC convention: (OrgCode)recordNumber. >- If OrgCode is not present, return full string. >- Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. >+ <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w. >+ Parameter: control number string. >+ Assumes LOC convention: (OrgCode)recordNumber. >+ If OrgCode is not present, return full string. >+ Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. > Returns the value URI-encoded. >- --> >- <xsl:template name="extractControlNumber"> >- <xsl:param name="subfieldW"/> >- <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> >- <xsl:choose> >- <xsl:when test="contains($tranW,')')"> >- <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:template> >+ --> >+ <xsl:template name="extractControlNumber"> >+ <xsl:param name="subfieldW"/> >+ <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> >+ <xsl:choose> >+ <xsl:when test="contains($tranW,')')"> >+ <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> > > <!-- Function m880Select: Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags > - should be called immediately before the corresonding latin tags are processed >@@ -356,30 +356,30 @@ > > <xsl:template name="show-lang-041"> > <xsl:if test="marc:datafield[@tag=041]"> >- <xsl:for-each select="marc:datafield[@tag=041]"> >- <span class="results_summary languages"> >- <xsl:call-template name="show-lang-node"> >- <xsl:with-param name="langNode" select="marc:subfield[@code='a']"/> >- <xsl:with-param name="langLabel">Language: </xsl:with-param> >- </xsl:call-template> >- <xsl:call-template name="show-lang-node"> >- <xsl:with-param name="langNode" select="marc:subfield[@code='b']"/> >- <xsl:with-param name="langLabel">Summary language: </xsl:with-param> >- </xsl:call-template> >- <xsl:call-template name="show-lang-node"> >- <xsl:with-param name="langNode" select="marc:subfield[@code='d']"/> >- <xsl:with-param name="langLabel">Spoken language: </xsl:with-param> >- </xsl:call-template> >- <xsl:call-template name="show-lang-node"> >- <xsl:with-param name="langNode" select="marc:subfield[@code='h']"/> >- <xsl:with-param name="langLabel">Original language: </xsl:with-param> >- </xsl:call-template> >- <xsl:call-template name="show-lang-node"> >- <xsl:with-param name="langNode" select="marc:subfield[@code='j']"/> >- <xsl:with-param name="langLabel">Subtitle language: </xsl:with-param> >- </xsl:call-template> >- </span> >- </xsl:for-each> >+ <xsl:for-each select="marc:datafield[@tag=041]"> >+ <span class="results_summary languages"> >+ <xsl:call-template name="show-lang-node"> >+ <xsl:with-param name="langNode" select="marc:subfield[@code='a']"/> >+ <xsl:with-param name="langLabel">Language: </xsl:with-param> >+ </xsl:call-template> >+ <xsl:call-template name="show-lang-node"> >+ <xsl:with-param name="langNode" select="marc:subfield[@code='b']"/> >+ <xsl:with-param name="langLabel">Summary language: </xsl:with-param> >+ </xsl:call-template> >+ <xsl:call-template name="show-lang-node"> >+ <xsl:with-param name="langNode" select="marc:subfield[@code='d']"/> >+ <xsl:with-param name="langLabel">Spoken language: </xsl:with-param> >+ </xsl:call-template> >+ <xsl:call-template name="show-lang-node"> >+ <xsl:with-param name="langNode" select="marc:subfield[@code='h']"/> >+ <xsl:with-param name="langLabel">Original language: </xsl:with-param> >+ </xsl:call-template> >+ <xsl:call-template name="show-lang-node"> >+ <xsl:with-param name="langNode" select="marc:subfield[@code='j']"/> >+ <xsl:with-param name="langLabel">Subtitle language: </xsl:with-param> >+ </xsl:call-template> >+ </span> >+ </xsl:for-each> > </xsl:if> > </xsl:template> > >@@ -387,21 +387,21 @@ > <xsl:param name="langNode"/> > <xsl:param name="langLabel"/> > <xsl:if test="$langNode"> >- <span class="language"> >- <span class="label"><xsl:value-of select="$langLabel"/></span> >- <xsl:for-each select="$langNode"> >- <span> >- <xsl:attribute name="class">lang_code-<xsl:value-of select="translate(., ' .-;|#', '_')"/></xsl:attribute> >- <xsl:call-template name="languageCodeText"> >- <xsl:with-param name="code" select="."/> >- </xsl:call-template> >- <xsl:if test="position() != last()"> >- <span class="sep"><xsl:text>, </xsl:text></span> >- </xsl:if> >- </span> >- </xsl:for-each> >- <span class="sep"><xsl:text>. </xsl:text></span> >- </span> >+ <span class="language"> >+ <span class="label"><xsl:value-of select="$langLabel"/></span> >+ <xsl:for-each select="$langNode"> >+ <span> >+ <xsl:attribute name="class">lang_code-<xsl:value-of select="translate(., ' .-;|#', '_')"/></xsl:attribute> >+ <xsl:call-template name="languageCodeText"> >+ <xsl:with-param name="code" select="."/> >+ </xsl:call-template> >+ <xsl:if test="position() != last()"> >+ <span class="sep"><xsl:text>, </xsl:text></span> >+ </xsl:if> >+ </span> >+ </xsl:for-each> >+ <span class="sep"><xsl:text>. </xsl:text></span> >+ </span> > </xsl:if> > </xsl:template> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >index b5e929c7a1..af825261f5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >@@ -6,43 +6,43 @@ > xmlns:str="http://exslt.org/strings" > exclude-result-prefixes="marc str"> > <xsl:include href="MARC21Languages.xsl"/> >- <xsl:template name="datafield"> >- <xsl:param name="tag"/> >- <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param> >- <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param> >- <xsl:param name="subfields"/> >- <xsl:element name="datafield"> >- <xsl:attribute name="tag"> >- <xsl:value-of select="$tag"/> >- </xsl:attribute> >- <xsl:attribute name="ind1"> >- <xsl:value-of select="$ind1"/> >- </xsl:attribute> >- <xsl:attribute name="ind2"> >- <xsl:value-of select="$ind2"/> >- </xsl:attribute> >- <xsl:copy-of select="$subfields"/> >- </xsl:element> >- </xsl:template> >+ <xsl:template name="datafield"> >+ <xsl:param name="tag"/> >+ <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param> >+ <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param> >+ <xsl:param name="subfields"/> >+ <xsl:element name="datafield"> >+ <xsl:attribute name="tag"> >+ <xsl:value-of select="$tag"/> >+ </xsl:attribute> >+ <xsl:attribute name="ind1"> >+ <xsl:value-of select="$ind1"/> >+ </xsl:attribute> >+ <xsl:attribute name="ind2"> >+ <xsl:value-of select="$ind2"/> >+ </xsl:attribute> >+ <xsl:copy-of select="$subfields"/> >+ </xsl:element> >+ </xsl:template> > >- <xsl:template name="subfieldSelect"> >- <xsl:param name="codes"/> >- <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> >- <xsl:param name="subdivCodes"/> >- <xsl:param name="subdivDelimiter"/> >+ <xsl:template name="subfieldSelect"> >+ <xsl:param name="codes"/> >+ <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> >+ <xsl:param name="subdivCodes"/> >+ <xsl:param name="subdivDelimiter"/> > <xsl:param name="prefix"/> > <xsl:param name="suffix"/> > <xsl:param name="urlencode"/> >- <xsl:variable name="str"> >- <xsl:for-each select="marc:subfield"> >- <xsl:if test="contains($codes, @code)"> >+ <xsl:variable name="str"> >+ <xsl:for-each select="marc:subfield"> >+ <xsl:if test="contains($codes, @code)"> > <xsl:if test="contains($subdivCodes, @code)"> > <xsl:value-of select="$subdivDelimiter"/> > </xsl:if> >- <xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/> >- </xsl:if> >- </xsl:for-each> >- </xsl:variable> >+ <xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/> >+ </xsl:if> >+ </xsl:for-each> >+ </xsl:variable> > <xsl:choose> > <xsl:when test="$urlencode=1"> > <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/> >@@ -51,7 +51,7 @@ > <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> > </xsl:otherwise> > </xsl:choose> >- </xsl:template> >+ </xsl:template> > > <xsl:template name="subfieldSelectSpan"> > <xsl:param name="codes"/> >@@ -79,17 +79,17 @@ > </xsl:for-each> > </xsl:template> > >- <xsl:template name="buildSpaces"> >- <xsl:param name="spaces"/> >- <xsl:param name="char"><xsl:text> </xsl:text></xsl:param> >- <xsl:if test="$spaces>0"> >- <xsl:value-of select="$char"/> >- <xsl:call-template name="buildSpaces"> >- <xsl:with-param name="spaces" select="$spaces - 1"/> >- <xsl:with-param name="char" select="$char"/> >- </xsl:call-template> >- </xsl:if> >- </xsl:template> >+ <xsl:template name="buildSpaces"> >+ <xsl:param name="spaces"/> >+ <xsl:param name="char"><xsl:text> </xsl:text></xsl:param> >+ <xsl:if test="$spaces>0"> >+ <xsl:value-of select="$char"/> >+ <xsl:call-template name="buildSpaces"> >+ <xsl:with-param name="spaces" select="$spaces - 1"/> >+ <xsl:with-param name="char" select="$char"/> >+ </xsl:call-template> >+ </xsl:if> >+ </xsl:template> > > <xsl:template name="buildBiblioDefaultViewURL"> > <xsl:param name="BiblioDefaultView"/> >@@ -109,42 +109,42 @@ > </xsl:choose> > </xsl:template> > >- <xsl:template name="chopPunctuation"> >- <xsl:param name="chopString"/> >- <xsl:param name="punctuation"><xsl:text>.:,;/ </xsl:text></xsl:param> >- <xsl:variable name="length" select="string-length($chopString)"/> >- <xsl:choose> >- <xsl:when test="$length=0"/> >- <xsl:when test="contains($punctuation, substring($chopString,$length,1))"> >- <xsl:call-template name="chopPunctuation"> >- <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/> >- <xsl:with-param name="punctuation" select="$punctuation"/> >- </xsl:call-template> >- </xsl:when> >- <xsl:when test="not($chopString)"/> >- <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise> >- </xsl:choose> >- </xsl:template> >+ <xsl:template name="chopPunctuation"> >+ <xsl:param name="chopString"/> >+ <xsl:param name="punctuation"><xsl:text>.:,;/ </xsl:text></xsl:param> >+ <xsl:variable name="length" select="string-length($chopString)"/> >+ <xsl:choose> >+ <xsl:when test="$length=0"/> >+ <xsl:when test="contains($punctuation, substring($chopString,$length,1))"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/> >+ <xsl:with-param name="punctuation" select="$punctuation"/> >+ </xsl:call-template> >+ </xsl:when> >+ <xsl:when test="not($chopString)"/> >+ <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> > >- <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w. >- Parameter: control number string. >- Assumes LOC convention: (OrgCode)recordNumber. >- If OrgCode is not present, return full string. >- Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. >+ <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w. >+ Parameter: control number string. >+ Assumes LOC convention: (OrgCode)recordNumber. >+ If OrgCode is not present, return full string. >+ Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. > Returns the value URI-encoded. >- --> >- <xsl:template name="extractControlNumber"> >- <xsl:param name="subfieldW"/> >- <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> >- <xsl:choose> >- <xsl:when test="contains($tranW,')')"> >- <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:template> >+ --> >+ <xsl:template name="extractControlNumber"> >+ <xsl:param name="subfieldW"/> >+ <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> >+ <xsl:choose> >+ <xsl:when test="contains($tranW,')')"> >+ <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> > > <!-- Function m880Select: Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags > - should be called immediately before the corresonding latin tags are processed >-- >2.17.1
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 28976
:
129524
| 129525 |
130529