Bugzilla – Attachment 116330 Details for
Bug 27627
Fix invalid HTML in OPAC results XSLT: change spans to divs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs
Bug-27627-Fix-invalid-HTMl-in-OPAC-results-XSLT-ch.patch (text/plain), 13.33 KB, created by
Owen Leonard
on 2021-02-04 17:24:38 UTC
(
hide
)
Description:
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-02-04 17:24:38 UTC
Size:
13.33 KB
patch
obsolete
>From 2fd514e38798f01cc087e182f091c3247c0f3891 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 4 Feb 2021 16:14:48 +0000 >Subject: [PATCH] Bug 27627: Fix invalid HTMl in OPAC results XSLT: change > spans to divs > >This patch modifies the XSL template for OPAC search results in order to >improve HTML validation: Changing some <span>s to <div>s will prevent an >error when those <span>s contain block-level elements. > >To test, apply the patch and restart_all if necessary. > >- Confirm that OPACXSLTResultsDisplay is set to "default" >- Perform a catalog search in the OPAC. >- Validate the page source and confirm that there are no errors about > "Element ul not allowed as child of element span in this context" > >Note: another patch will address other validation errors. >--- > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 80 +++++++++++----------- > 1 file changed, 40 insertions(+), 40 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index ecd7cfa986..2201d966ae 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -469,7 +469,7 @@ > </xsl:choose> > </xsl:variable> > >- <span class="results_summary"><a> >+ <div class="results_summary"><a> > <xsl:attribute name="href"> > <xsl:value-of select="$OpenURLResolverURL" /> > </xsl:attribute> >@@ -496,7 +496,7 @@ > <xsl:value-of select="$openurltext" /> > </xsl:otherwise> > </xsl:choose> >- </a></span> >+ </a></div> > </xsl:if> > <!-- End of OpenURL --> > >@@ -647,23 +647,23 @@ > </xsl:call-template> > > <xsl:if test="marc:datafield[@tag=250]"> >- <span class="results_summary edition"> >+ <div class="results_summary edition"> > <span class="label">Edition: </span> > <xsl:for-each select="marc:datafield[@tag=250]"> > <xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">ab</xsl:with-param> > </xsl:call-template> > </xsl:for-each> >- </span> >+ </div> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=773]"> > <xsl:for-each select="marc:datafield[@tag=773]"> > <xsl:if test="marc:subfield[@code='t']"> >- <span class="results_summary source"> >+ <div class="results_summary source"> > <span class="label">Source: </span> > <xsl:value-of select="marc:subfield[@code='t']"/> >- </span> >+ </div> > </xsl:if> > </xsl:for-each> > </xsl:if> >@@ -671,7 +671,7 @@ > <xsl:if test="$DisplayOPACiconsXSLT!='0'"> > <span class="results_summary type"> > <xsl:if test="$typeOf008!=''"> >- <span class="results_material_type"> >+ <div class="results_material_type"> > <span class="label">Material type: </span> > <xsl:choose> > <xsl:when test="$leader19='a'"><img src="/opac-tmpl/lib/famfamfam/ST.png" alt="Set" class="materialtype mt_icon_ST"/> Set</xsl:when> >@@ -694,18 +694,18 @@ > <xsl:when test="$leader6='i'"><img src="/opac-tmpl/lib/famfamfam/MU.png" alt="Sound" class="materialtype mt_icon_MU"/> Sound</xsl:when> > <xsl:when test="$leader6='j'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Music" class="materialtype mt_icon_PR"/> Music</xsl:when> > </xsl:choose> >- </span> >+ </div> > </xsl:if> > <xsl:if test="string-length(normalize-space($physicalDescription))"> >- <span class="results_format"> >+ <div class="results_format"> > <span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of> >- </span> >+ </div> > </xsl:if> > > <xsl:if test="$controlField008-21 or $controlField008-22 or $controlField008-24 or $controlField008-26 or $controlField008-29 or $controlField008-34 or $controlField008-33 or $controlField008-30-31 or $controlField008-33"> > > <xsl:if test="$typeOf008='CR'"> >- <span class="results_typeofcontinuing"> >+ <div class="results_typeofcontinuing"> > <xsl:if test="$controlField008-21 and $controlField008-21 !='|' and $controlField008-21 !=' '"> > <span class="label">; Type of continuing resource: </span> > </xsl:if> >@@ -729,11 +729,11 @@ > <img src="/opac-tmpl/lib/famfamfam/world_link.png" alt="web site" class="format"/> > </xsl:when> > </xsl:choose> >- </span> >+ </div> > </xsl:if> > <xsl:if test="$typeOf008='BK' or $typeOf008='CR'"> > <xsl:if test="contains($controlField008-24,'abcdefghijklmnopqrstvwxyz')"> >- <span class="results_natureofcontents"> >+ <div class="results_natureofcontents"> > <span class="label">; Nature of contents: </span> > <xsl:choose> > <xsl:when test="contains($controlField008-24,'a')"> >@@ -806,11 +806,11 @@ > conference publication > </xsl:when> > </xsl:choose> >- </span> >+ </div> > </xsl:if> > </xsl:if> > <xsl:if test="$typeOf008='CF'"> >- <span class="results_typeofcomp"> >+ <div class="results_typeofcomp"> > <xsl:if test="$controlField008-26='a' or $controlField008-26='e' or $controlField008-26='f' or $controlField008-26='g'"> > <span class="label">; Type of computer file: </span> > </xsl:if> >@@ -828,10 +828,10 @@ > <img src="/opac-tmpl/lib/famfamfam/controller.png" alt="game" class="format"/> > </xsl:when> > </xsl:choose> >- </span> >+ </div> > </xsl:if> > <xsl:if test="$typeOf008='BK'"> >- <span class="results_contents_literary"> >+ <div class="results_contents_literary"> > <xsl:if test="(substring($controlField008,25,1)='j') or (substring($controlField008,25,1)='1') or ($controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d')"> > <span class="label">; Nature of contents: </span> > </xsl:if> >@@ -883,10 +883,10 @@ > Speeches > </xsl:when> > </xsl:choose> >- </span> >+ </div> > </xsl:if> > <xsl:if test="$typeOf008='MU' and $controlField008-30-31 and $controlField008-30-31!='||' and $controlField008-30-31!=' '"> >- <span class="results_literaryform"> >+ <div class="results_literaryform"> > <span class="label">; Literary form: </span> <!-- Literary text for sound recordings --> > <xsl:if test="contains($controlField008-30-31,'b')"> > biography >@@ -930,10 +930,10 @@ > <xsl:if test="contains($controlField008-30-31,'l')"> > speech > </xsl:if> >- </span> >+ </div> > </xsl:if> > <xsl:if test="$typeOf008='VM'"> >- <span class="results_typeofvisual"> >+ <div class="results_typeofvisual"> > <span class="label">; Type of visual material: </span> > <xsl:choose> > <xsl:when test="$controlField008-33='a'"> >@@ -994,12 +994,12 @@ > toy > </xsl:when> > </xsl:choose> >- </span> >+ </div> > </xsl:if> > </xsl:if> > > <xsl:if test="($typeOf008='BK' or $typeOf008='CF' or $typeOf008='MU' or $typeOf008='VM') and ($controlField008-22='a' or $controlField008-22='b' or $controlField008-22='c' or $controlField008-22='d' or $controlField008-22='e' or $controlField008-22='g' or $controlField008-22='j' or $controlField008-22='f')"> >- <span class="results_audience"> >+ <div class="results_audience"> > <span class="label">; Audience: </span> > <xsl:choose> > <xsl:when test="$controlField008-22='a'"> >@@ -1027,7 +1027,7 @@ > Specialized; > </xsl:when> > </xsl:choose> >- </span> >+ </div> > </xsl:if> > <xsl:text> </xsl:text> <!-- added blank space to fix font display problem, see Bug 3671 --> > </span> >@@ -1047,7 +1047,7 @@ > > <!-- Publisher or Distributor Number --> > <xsl:if test="marc:datafield[@tag=028]"> >- <span class="results_summary publisher_number "> >+ <div class="results_summary publisher_number "> > <span class="label">Publisher number: </span> > <xsl:for-each select="marc:datafield[@tag=028]"> > <xsl:call-template name="subfieldSelect"> >@@ -1055,7 +1055,7 @@ > <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param> > </xsl:call-template> > </xsl:for-each> >- </span> >+ </div> > </xsl:if> > > <!-- Publisher info and RDA related info from tags 260, 264 --> >@@ -1064,7 +1064,7 @@ > <xsl:call-template name="showRDAtag264"/> > </xsl:when> > <xsl:when test="marc:datafield[@tag=260]"> >- <span class="results_summary publisher"><span class="label">Publication details: </span> >+ <div class="results_summary publisher"><span class="label">Publication details: </span> > <xsl:for-each select="marc:datafield[@tag=260]"> > <xsl:if test="marc:subfield[@code='a']"> > <span class="publisher_place" property="location"> >@@ -1097,13 +1097,13 @@ > <xsl:text>; </xsl:text> > <xsl:call-template name="showRDAtag264"/> > </xsl:if> >- </span> >+ </div> > </xsl:when> > </xsl:choose> > > <!-- Dissertation note --> > <xsl:if test="marc:datafield[@tag=502]"> >- <span class="results_summary diss_note"> >+ <div class="results_summary diss_note"> > <span class="label">Dissertation note: </span> > <xsl:for-each select="marc:datafield[@tag=502]"> > <xsl:call-template name="subfieldSelect"> >@@ -1111,7 +1111,7 @@ > </xsl:call-template> > </xsl:for-each> > <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose> >- </span> >+ </div> > </xsl:if> > > <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) --> >@@ -1125,7 +1125,7 @@ > </xsl:if> > > <xsl:if test="marc:datafield[@tag=246]"> >- <span class="results_summary other_title"> >+ <div class="results_summary other_title"> > <span class="label">Other title: </span> > <xsl:for-each select="marc:datafield[@tag=246]"> > <xsl:call-template name="subfieldSelect"> >@@ -1134,10 +1134,10 @@ > <!-- #13386 added separator | --> > <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise></xsl:choose> > </xsl:for-each> >- </span> >+ </div> > </xsl:if> > <xsl:if test="marc:datafield[@tag=242]"> >- <span class="results_summary translated_title"> >+ <div class="results_summary translated_title"> > <span class="label">Title translated: </span> > <xsl:for-each select="marc:datafield[@tag=242]"> > <xsl:call-template name="subfieldSelect"> >@@ -1145,10 +1145,10 @@ > </xsl:call-template> > <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> > </xsl:for-each> >- </span> >+ </div> > </xsl:if> > <xsl:if test="marc:datafield[@tag=856]"> >- <span class="results_summary online_resources"> >+ <div class="results_summary online_resources"> > <span class="label">Online access: </span> > <ul> > <xsl:for-each select="marc:datafield[@tag=856]"> >@@ -1240,9 +1240,9 @@ > </xsl:if> > </xsl:for-each> > </ul> >- </span> >+ </div> > </xsl:if> >- <span class="results_summary availability"> >+ <div class="results_summary availability"> > <span class="label">Availability: </span> > <xsl:choose> > <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0"> >@@ -1450,10 +1450,10 @@ > <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/> > <xsl:text>). </xsl:text> </span> > </xsl:if> >- </span> >+ </div> > <xsl:choose> > <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)"> >- <span class="results_summary location"> >+ <div class="results_summary location"> > > <xsl:choose> > <xsl:when test="$OPACItemLocation='location'"> >@@ -1502,7 +1502,7 @@ > </span> > </xsl:when> > </xsl:choose> >- </span> >+ </div> > </xsl:when> > </xsl:choose> > </xsl:template> >-- >2.11.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 27627
:
116330
|
116332
|
116334
|
116438
|
127455
|
127544
|
130976