[Koha-patches] [PATCH] Bug 4472 Fix how   are injected into XSL files

Frédéric Demians f.demians at tamil.fr
Sun Jul 11 17:53:21 CEST 2010


tmpl_process is patched to handle properly specific XML directives.
UNIMARC XSL files are modified to gain knowledge of HTML   entity
which isn't the case by default. It may be necessary to do the same
thing for MARC21 XSL.
---
 .../prog/en/xslt/UNIMARCslim2OPACDetail.xsl        |    3 +++
 .../prog/en/xslt/UNIMARCslim2OPACResults.xsl       |    4 +++-
 .../opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl    |    5 ++++-
 misc/translator/tmpl_process3.pl                   |    2 ++
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl
index 26aed37..69e5cf6 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
+
 <xsl:stylesheet version="1.0"
   xmlns:marc="http://www.loc.gov/MARC21/slim"
   xmlns:items="http://www.koha.org/items"
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl
index 6917ca2..1290e94 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
+
+<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
+
 <xsl:stylesheet version="1.0"
   xmlns:marc="http://www.loc.gov/MARC21/slim"
   xmlns:items="http://www.koha.org/items"
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl
index ce7f459..f5cf99f 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl
@@ -1,4 +1,7 @@
 <?xml version='1.0'?>
+
+<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
+
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
   <xsl:template name="datafield">
@@ -296,4 +299,4 @@
     </xsl:if>
   </xsl:template>
 
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl
index af0cde1..b916cab 100755
--- a/misc/translator/tmpl_process3.pl
+++ b/misc/translator/tmpl_process3.pl
@@ -116,6 +116,8 @@ sub text_replace (**) {
         }
         }
     } elsif (defined $t) {
+        # Quick fix to bug 4472
+        $t = "<!DOCTYPE stylesheet ["  if $t =~ /DOCTYPE stylesheet/ ;
         print $output $t;
     }
     }
-- 
1.7.1



More information about the Koha-patches mailing list