[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-docbook
Subject:    Cleanup of DocBook XSLT
From:       Luigi Toscano <luigi.toscano () tiscali ! it>
Date:       2010-06-20 23:44:29
Message-ID: 4C1EA7DD.2060103 () tiscali ! it
[Download RAW message or body]

Hi,
as you probably know, I am working to remove the embedded copies of DocBook 
XML (done) and XSLT from kdelibs/kdoctools. If you missed the previous 
episodes, please check here: http://kde.markmail.org/thread/rp6gj6evd3zwgl3j

In order to remove our copy of XSLT stylesheets, customizations made directly 
to kdoctools/docbook/xsl have to be moved inside kdoctools/customization. The 
changes that needs to be made can be divided into two categories:
1) l10n-related changes. They are a but tricky, but I think that I figured out 
how to handle them inside customization (two custom l10n.xml must be created, 
one for languages and the other for our language customizations; they names 
are used to overwrite to values for 'l10n.xml' and 'local.l10n.xml'). I will 
write a more detailed email (with a first patch) in the next days, but I'd 
like to first fix point 2).
2) other changes. xsl_diff_167.txt shows the diff between original DocBook 
XSLT 1.67 and our copy. kde-custom-xslt1.diff contains my proposal to cleanup 
our copy.

Just a few comments on the patch:
* common/l10n.xsl : gentext.footer-doc-comment, gentext.footer-doc-feedback 
and gentext.footer-doc-teamname have been moved to 
customization/kde-navig.xsl, where they are really used
* html/chunk-common.xsl: the custom content has been moved (with a bit of 
magic) to customization/kde-chunk-common.xsl, which contains shared templates 
for kde-chunk.xsl, kde-chunk-online.xsl and kde-nochunk.xsl.
* kde-include-*.xsl: these new files contain the common includes to all 
kde-*xsl. I have isolated them because in the (not so far) future these files 
will be created by cmake and they will contain the path to system-installed 
stylesheets.

I have also some question:
- There are two versions of kde-navig-online.xsl and kde-chunk-online.xsl, the 
first one under kdelibs/kdoctools/customization (with the other stylesheets), 
the other one under www/areas/docs/; the latter ones seem to be more updated. 
Would it be possible to keep only one copy of them?
- Is kde-man.xsl still used? KDE4_CREATE_MANPAGE refers to 
docbook/xsl/manpages/docbook.xsl...

Regards
-- 
Luigi

["kde-custom-xslt1.diff" (text/x-patch)]

Index: kdelibs/kdoctools/docbook/xsl/html/chunk-common.xsl
===================================================================
--- kdelibs/kdoctools/docbook/xsl/html/chunk-common.xsl	(revision 1140347)
+++ kdelibs/kdoctools/docbook/xsl/html/chunk-common.xsl	(working copy)
@@ -983,7 +983,6 @@
     </xsl:call-template>
 
     <body>
-      <div id="content">
       <xsl:call-template name="body.attributes"/>
       <xsl:call-template name="user.header.navigation"/>
 
@@ -995,9 +994,7 @@
 
       <xsl:call-template name="user.header.content"/>
 
-      <div id="contentBody">
-        <xsl:copy-of select="$content"/>
-      </div>
+      <xsl:copy-of select="$content"/>
 
       <xsl:call-template name="user.footer.content"/>
 
@@ -1008,7 +1005,6 @@
       </xsl:call-template>
 
       <xsl:call-template name="user.footer.navigation"/>
-      </div>
     </body>
   </html>
 </xsl:template>
Index: kdelibs/kdoctools/docbook/xsl/common/l10n.xsl
===================================================================
--- kdelibs/kdoctools/docbook/xsl/common/l10n.xsl	(revision 1140347)
+++ kdelibs/kdoctools/docbook/xsl/common/l10n.xsl	(working copy)
@@ -292,25 +292,7 @@
   </xsl:call-template>
 </xsl:template>
 
-<xsl:template name="gentext.footer-doc-comment">
-  <xsl:call-template name="gentext">
-    <xsl:with-param name="key" select="'footer-doc-comment'"/>
-  </xsl:call-template>
-</xsl:template>
 
-<xsl:template name="gentext.footer-doc-feedback">
-  <xsl:call-template name="gentext">
-    <xsl:with-param name="key" select="'footer-doc-feedback'"/>
-  </xsl:call-template>
-</xsl:template>
-
-<xsl:template name="gentext.footer-doc-teamname">
-  <xsl:call-template name="gentext">
-    <xsl:with-param name="key" select="'footer-doc-teamname'"/>
-  </xsl:call-template>
-</xsl:template>
-
-
 <!-- ============================================================ -->
 
 <xsl:template name="gentext.template">
Index: kdelibs/kdoctools/customization/kde-include-common.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-include-common.xsl	(revision 0)
+++ kdelibs/kdoctools/customization/kde-include-common.xsl	(revision 0)
@@ -0,0 +1,7 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		version="1.0">
+
+   <xsl:import href="../docbook/xsl/html/autoidx.xsl"/>
+   <xsl:import href="../docbook/xsl/html/chunk.xsl"/>
+
+</xsl:stylesheet>
Index: kdelibs/kdoctools/customization/kde-chunk-online.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-chunk-online.xsl	(revision 1140347)
+++ kdelibs/kdoctools/customization/kde-chunk-online.xsl	(working copy)
@@ -1,8 +1,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 		version="1.0">
 
-<xsl:import href="../docbook/xsl/html/autoidx.xsl"/>
-<xsl:import href="../docbook/xsl/html/chunk.xsl"/>
+<xsl:import href="kde-chunk-common.xsl"/>
 <xsl:include href="kde-navig-online.xsl"/>
 <xsl:include href="kde-ttlpg-online.xsl"/>
 <xsl:include href="kde-style.xsl"/>
@@ -46,27 +45,6 @@
 <xsl:param name="admon.graphics.path"><xsl:value-of select="kde.common"/></xsl:param>
 <xsl:param name="callout.graphics.path"><xsl:value-of select="kde.common"/></xsl:param>
 
-
-<xsl:template name="dbhtml-filename">
-<xsl:choose>
-     <xsl:when test=". != /*">
-      <xsl:value-of select="@id"/>
-      <xsl:value-of select="$html.ext"/>
-     </xsl:when>
-     <xsl:otherwise>
-	<xsl:text>index.html</xsl:text>
-      </xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<xsl:template name="dbhtml-dir">
-</xsl:template>
-
-<xsl:template name="user.head.content">
-   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
-   <meta name="GENERATOR" content="KDE XSL Stylesheet V{$KDE_VERSION} using libxslt"/>
-</xsl:template>
-
 <!-- try with olinks: it nearly works --><!--
   <xsl:template match="olink">
     <a>
Index: kdelibs/kdoctools/customization/kde-chunk-common.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-chunk-common.xsl	(revision 0)
+++ kdelibs/kdoctools/customization/kde-chunk-common.xsl	(revision 0)
@@ -0,0 +1,42 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+        version="1.0">
+
+<xsl:import href="kde-include-common.xsl"/>
+
+<xsl:template name="dbhtml-filename">
+<xsl:choose>
+     <xsl:when test=". != /*">
+      <xsl:value-of select="@id"/>
+      <xsl:value-of select="$html.ext"/>
+     </xsl:when>
+     <xsl:otherwise>
+    <xsl:text>index.html</xsl:text>
+      </xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template name="dbhtml-dir">
+</xsl:template>
+
+<xsl:template name="user.head.content">
+   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+   <meta name="GENERATOR" content="KDE XSL Stylesheet V{$KDE_VERSION} using libxslt"/>
+</xsl:template>
+
+<xsl:template name="user.header.navigation">
+  <!-- xsl:attribute name="id">content</xsl:attribute -->
+  <xsl:text disable-output-escaping="yes">&lt;div id="content"&gt;</xsl:text>
+</xsl:template>
+
+<xsl:template name="user.header.content">
+  <xsl:text disable-output-escaping="yes">&lt;div id="contentBody"&gt;</xsl:text>
+</xsl:template>
+<xsl:template name="user.footer.content">
+  <xsl:text disable-output-escaping="yes">&lt;/div&gt;</xsl:text>
+</xsl:template>
+
+<xsl:template name="user.footer.navigation">
+  <xsl:text disable-output-escaping="yes">&lt;/div&gt;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
Index: kdelibs/kdoctools/customization/kde-man.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-man.xsl	(revision 1140347)
+++ kdelibs/kdoctools/customization/kde-man.xsl	(working copy)
@@ -1,11 +1,12 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <!-- vim:set syntax=xml ts=2 et: -->
-<xsl:import href="../docbook/xsl/manpages/docbook.xsl"/>
+<xsl:import href="kde-include-man.xsl"/>
 
 <!-- Disable the automatically generated AUTHORS section by overloading the
   respective template and making it a no-op. -->
 <xsl:template match="articleinfo|bookinfo|refentryinfo" mode="authorsect"/>
-
+<xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
+<xsl:output method="text" encoding="UTF-8" indent="no"/>
 <!--
   Copied from ../docbook/xsl/manpages/docbook.xsl and changed it so that the
   output file's name is harccoded to 'manpage.troff', and the quiet parameter
Index: kdelibs/kdoctools/customization/kde-web.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-web.xsl	(revision 1140347)
+++ kdelibs/kdoctools/customization/kde-web.xsl	(working copy)
@@ -1,8 +1,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 		version="1.0">
 
-<xsl:import href="../docbook/xsl/html/autoidx.xsl"/>
-<xsl:import href="../docbook/xsl/html/chunk.xsl"/>
+<xsl:import href="kde-include-common.xsl"/>
 <xsl:include href="kde-web-navig.xsl"/>
 <xsl:include href="kde-ttlpg.xsl"/>
 <xsl:include href="kde-style.xsl"/>
Index: kdelibs/kdoctools/customization/kde-include-man.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-include-man.xsl	(revision 0)
+++ kdelibs/kdoctools/customization/kde-include-man.xsl	(revision 0)
@@ -0,0 +1,6 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		version="1.0">
+
+   <xsl:import href="../docbook/xsl/manpages/docbook.xsl"/>
+
+</xsl:stylesheet>
Index: kdelibs/kdoctools/customization/kde-navig.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-navig.xsl	(revision 1140347)
+++ kdelibs/kdoctools/customization/kde-navig.xsl	(working copy)
@@ -181,5 +181,24 @@
   </xsl:if>
 </xsl:template>
 
+<xsl:template name="gentext.footer-doc-comment"> 
+  <xsl:call-template name="gentext"> 
+    <xsl:with-param name="key" select="'footer-doc-comment'"/> 
+  </xsl:call-template> 
+</xsl:template> 
+ 
+<xsl:template name="gentext.footer-doc-feedback"> 
+  <xsl:call-template name="gentext"> 
+    <xsl:with-param name="key" select="'footer-doc-feedback'"/> 
+  </xsl:call-template> 
+</xsl:template> 
+ 
+<xsl:template name="gentext.footer-doc-teamname"> 
+  <xsl:call-template name="gentext"> 
+    <xsl:with-param name="key" select="'footer-doc-teamname'"/> 
+  </xsl:call-template> 
+</xsl:template> 
+
+
 </xsl:stylesheet>
 <!-- vim: set sw=2: -->
Index: kdelibs/kdoctools/customization/kde-nochunk.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-nochunk.xsl	(revision 1140347)
+++ kdelibs/kdoctools/customization/kde-nochunk.xsl	(working copy)
@@ -1,8 +1,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 		version="1.0">
 
-<xsl:import href="../docbook/xsl/html/autoidx.xsl"/>
-<xsl:import href="../docbook/xsl/html/docbook.xsl"/>
+<xsl:import href="kde-chunk-common.xsl"/>
 <!-- <xsl:include href="kde-print-navig.xsl"/> -->
 <xsl:include href="kde-ttlpg.xsl"/>
 <xsl:include href="kde-style.xsl"/>
@@ -25,26 +24,6 @@
 <xsl:param name="callout.graphics.path"><xsl:value-of select="kde.common"/></xsl:param>
 
 
-<xsl:template name="dbhtml-filename">
-<xsl:choose>
-     <xsl:when test=". != /*">
-      <xsl:value-of select="@id"/>
-      <xsl:value-of select="$html.ext"/>
-     </xsl:when>
-     <xsl:otherwise>
-	<xsl:text>index.html</xsl:text>
-      </xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<xsl:template name="dbhtml-dir">
-</xsl:template>
-
-<xsl:template name="user.head.content">
-   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
-   <meta name="GENERATOR" content="KDE XSL Stylesheet V{$KDE_VERSION} using libxslt"/>
-</xsl:template>
-
 <!-- try with olinks: it nearly works --><!--
   <xsl:template match="olink">
     <a>
Index: kdelibs/kdoctools/customization/kde-chunk.xsl
===================================================================
--- kdelibs/kdoctools/customization/kde-chunk.xsl	(revision 1140347)
+++ kdelibs/kdoctools/customization/kde-chunk.xsl	(working copy)
@@ -1,8 +1,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 		version="1.0">
 
-<xsl:import href="../docbook/xsl/html/autoidx.xsl"/>
-<xsl:import href="../docbook/xsl/html/chunk.xsl"/>
+<xsl:import href="kde-chunk-common.xsl"/>
 <xsl:include href="kde-navig.xsl"/>
 <xsl:include href="kde-ttlpg.xsl"/>
 <xsl:include href="kde-style.xsl"/>
@@ -68,27 +67,6 @@
 </xsl:param>
 
 
-
-<xsl:template name="dbhtml-filename">
-<xsl:choose>
-     <xsl:when test=". != /*">
-      <xsl:value-of select="@id"/>
-      <xsl:value-of select="$html.ext"/>
-     </xsl:when>
-     <xsl:otherwise>
-	<xsl:text>index.html</xsl:text>
-      </xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<xsl:template name="dbhtml-dir">
-</xsl:template>
-
-<xsl:template name="user.head.content">
-   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-   <meta name="GENERATOR" content="KDE XSL Stylesheet V{$KDE_VERSION} using libxslt"/>
-</xsl:template>
-
 <xsl:template match="/book/bookinfo/legalnotice" mode="titlepage.mode">
   <xsl:variable name="filename" select="concat($kde.common,'fdl-notice.html')"/>
   <xsl:variable name="title">

["xsl_diff_167.txt" (text/plain)]

diff -ruw /tmp/docbook-xsl-1.67.2/common/l10n.xsl xsl/common/l10n.xsl
--- /tmp/docbook-xsl-1.67.2/common/l10n.xsl	2010-06-21 01:00:48.000000000 +0200
+++ xsl/common/l10n.xsl	2010-06-21 01:02:20.000000000 +0200
@@ -5,7 +5,7 @@
                 version='1.0'>
 
 <!-- ********************************************************************
-     $Id: l10n.xsl,v 1.25 2004/11/18 17:25:15 bobstayton Exp $
+     $Id: l10n.xsl 849022 2008-08-18 21:26:00Z lueck $
      ********************************************************************
 
      This file is part of the XSL DocBook Stylesheet distribution.
@@ -292,6 +292,25 @@
   </xsl:call-template>
 </xsl:template>
 
+<xsl:template name="gentext.footer-doc-comment">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'footer-doc-comment'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.footer-doc-feedback">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'footer-doc-feedback'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.footer-doc-teamname">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'footer-doc-teamname'"/>
+  </xsl:call-template>
+</xsl:template>
+
+
 <!-- ============================================================ -->
 
 <xsl:template name="gentext.template">
diff -ruw /tmp/docbook-xsl-1.67.2/html/chunk-common.xsl xsl/html/chunk-common.xsl
--- /tmp/docbook-xsl-1.67.2/html/chunk-common.xsl	2010-06-21 01:00:46.000000000 +0200
+++ xsl/html/chunk-common.xsl	2010-06-21 01:02:20.000000000 +0200
@@ -3,7 +3,7 @@
                 version="1.0">
 
 <!-- ********************************************************************
-     $Id: chunk-common.xsl,v 1.41 2004/10/23 11:51:10 nwalsh Exp $
+     $Id: chunk-common.xsl 1070148 2010-01-05 00:14:13Z mpyne $
      ********************************************************************
 
      This file is part of the XSL DocBook Stylesheet distribution.
@@ -983,6 +983,7 @@
     </xsl:call-template>
 
     <body>
+      <div id="content">
       <xsl:call-template name="body.attributes"/>
       <xsl:call-template name="user.header.navigation"/>
 
@@ -994,7 +995,9 @@
 
       <xsl:call-template name="user.header.content"/>
 
+      <div id="contentBody">
       <xsl:copy-of select="$content"/>
+      </div>
 
       <xsl:call-template name="user.footer.content"/>
 
@@ -1005,6 +1008,7 @@
       </xsl:call-template>
 
       <xsl:call-template name="user.footer.navigation"/>
+      </div>
     </body>
   </html>
 </xsl:template>
diff -ruw /tmp/docbook-xsl-1.67.2/manpages/docbook.xsl xsl/manpages/docbook.xsl
--- /tmp/docbook-xsl-1.67.2/manpages/docbook.xsl	2010-06-21 01:00:49.000000000 +0200
+++ xsl/manpages/docbook.xsl	2010-04-12 00:58:01.000000000 +0200
@@ -10,10 +10,10 @@
 
 <!-- Needed for chunker.xsl (for now): -->
 <xsl:param name="chunker.output.method" select="'text'"/>
-<xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
+<xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
 
 <xsl:output method="text"
-            encoding="ISO-8859-1"
+            encoding="UTF-8"
             indent="no"/>
 
 <!--



_______________________________________________
kde-docbook mailing list
kde-docbook@kde.org
https://mail.kde.org/mailman/listinfo/kde-docbook


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic