Bug 4472 Fix how   are injected into XSL files
authorFrédéric Demians <f.demians@tamil.fr>
Sun, 11 Jul 2010 15:53:21 +0000 (17:53 +0200)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 6 Oct 2010 17:23:31 +0000 (13:23 -0400)
tmpl_process is patched to handle properly specific XML directives.
UNIMARC XSL files are modified to gain knowledge of HTML &nbsp; entity
which isn't the case by default. It may be necessary to do the same
thing for MARC21 XSL.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl
misc/translator/tmpl_process3.pl

index 26aed37..69e5cf6 100644 (file)
@@ -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"
index 6917ca2..1290e94 100644 (file)
@@ -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"
index ce7f459..f5cf99f 100644 (file)
@@ -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">
     </xsl:if>
   </xsl:template>
 
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
index af0cde1..b916cab 100755 (executable)
@@ -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;
     }
     }