r19839 - gnucash-docs/trunk/xsl - Update GnuCash' custom xsl stylesheet to work with the new base stylesheet

Geert Janssens gjanssens at code.gnucash.org
Fri Nov 19 14:59:04 EST 2010


Author: gjanssens
Date: 2010-11-19 14:59:04 -0500 (Fri, 19 Nov 2010)
New Revision: 19839
Trac: http://svn.gnucash.org/trac/changeset/19839

Modified:
   gnucash-docs/trunk/xsl/admonitions.xsl
   gnucash-docs/trunk/xsl/chunk-common2.xsl
   gnucash-docs/trunk/xsl/general-customization.xsl
Log:
Update GnuCash' custom xsl stylesheet to work with the new base stylesheet

Modified: gnucash-docs/trunk/xsl/admonitions.xsl
===================================================================
--- gnucash-docs/trunk/xsl/admonitions.xsl	2010-11-19 19:58:24 UTC (rev 19838)
+++ gnucash-docs/trunk/xsl/admonitions.xsl	2010-11-19 19:59:04 UTC (rev 19839)
@@ -32,7 +32,7 @@
     <tr>
       <td rowspan="2" align="center" valign="top">
         <xsl:attribute name="width">
-          <xsl:call-template name="admon.graphic.width"/>
+          <xsl:apply-templates select="." mode="admon.graphic.width"/>
         </xsl:attribute>
         <img>
           <xsl:attribute name="src">

Modified: gnucash-docs/trunk/xsl/chunk-common2.xsl
===================================================================
--- gnucash-docs/trunk/xsl/chunk-common2.xsl	2010-11-19 19:58:24 UTC (rev 19838)
+++ gnucash-docs/trunk/xsl/chunk-common2.xsl	2010-11-19 19:59:04 UTC (rev 19839)
@@ -15,6 +15,29 @@
   <xsl:param name="node" select="."/>
   <!-- returns 1 if $node is a chunk -->
 
+  <!-- ==================================================================== -->
+  <!-- What's a chunk?
+
+       The root element
+       appendix
+       article
+       bibliography  in article or part or book
+       book
+       chapter
+       colophon
+       glossary      in article or part or book
+       index         in article or part or book
+       part
+       preface
+       refentry
+       reference
+       sect{1,2,3,4,5}  if position()>1 && depth < chunk.section.depth
+       section          if position()>1 && depth < chunk.section.depth
+       set
+       setindex
+                                                                            -->
+  <!-- ==================================================================== -->
+
 <!--
   <xsl:message>
     <xsl:text>chunk: </xsl:text>
@@ -22,8 +45,8 @@
     <xsl:text>(</xsl:text>
     <xsl:value-of select="$node/@id"/>
     <xsl:text>)</xsl:text>
-    <xsl:text> cs: </xsl:text>
-    <xsl:value-of select="$chunk.sections"/>
+    <xsl:text> csd: </xsl:text>
+    <xsl:value-of select="$chunk.section.depth"/>
     <xsl:text> cfs: </xsl:text>
     <xsl:value-of select="$chunk.first.sections"/>
     <xsl:text> ps: </xsl:text>
@@ -34,42 +57,86 @@
 -->
 
   <xsl:choose>
+	  <xsl:when test="$node/parent::*/processing-instruction('dbhtml')[normalize-space(.) = 'stop-chunking']">0</xsl:when>
     <xsl:when test="not($node/parent::*)">1</xsl:when>
-    <xsl:when test="$chunk.sections != 0
-                    and name($node)='sect1'
+
+    <xsl:when test="local-name($node) = 'sect1'
+                    and $chunk.section.depth &gt;= 1
                     and ($chunk.first.sections != 0
-                         or count($node/preceding-sibling::sect1) > 0)">
+                         or count($node/preceding-sibling::sect1) &gt; 0)">
       <xsl:text>1</xsl:text>
     </xsl:when>
-    <xsl:when test="$chunk.sections != 0
-                    and name($node)='section'
-                    and count($node/parent::section) = 0
+    <xsl:when test="local-name($node) = 'sect2'
+                    and $chunk.section.depth &gt;= 2
                     and ($chunk.first.sections != 0
-                         or count($node/preceding-sibling::section))>0">
-      <xsl:text>1</xsl:text>
+                         or count($node/preceding-sibling::sect2) &gt; 0)">
+      <xsl:call-template name="chunk">
+        <xsl:with-param name="node" select="$node/parent::*"/>
+      </xsl:call-template>
     </xsl:when>
-    <xsl:when test="name($node)='preface'">1</xsl:when>
-    <xsl:when test="name($node)='chapter'">1</xsl:when>
-    <xsl:when test="name($node)='appendix'">1</xsl:when>
-    <xsl:when test="name($node)='article'">1</xsl:when>
-    <xsl:when test="name($node)='part'">1</xsl:when>
-    <xsl:when test="name($node)='reference'">1</xsl:when>
-    <xsl:when test="name($node)='refentry'">1</xsl:when>
-    <xsl:when test="name($node)='index'
-                    and (name($node/parent::*) = 'article'
-                         or name($node/parent::*) = 'book')">1</xsl:when>
-    <xsl:when test="name($node)='bibliography'
-                    and (name($node/parent::*) = 'article'
-                         or name($node/parent::*) = 'book')">1</xsl:when>
-    <xsl:when test="name($node)='glossary'
-                    and (name($node/parent::*) = 'article'
-                         or name($node/parent::*) = 'book')">1</xsl:when>
-    <xsl:when test="name($node)='colophon'">1</xsl:when>
-    <xsl:when test="name($node)='book'">1</xsl:when>
-    <xsl:when test="name($node)='set'">1</xsl:when>
-    <xsl:when test="name($node)='setindex'">1</xsl:when>
-	<xsl:when test="name($node)='bookinfo'">1</xsl:when>
-	<xsl:when test="name($node)='articleinfo'">1</xsl:when>
+    <xsl:when test="local-name($node) = 'sect3'
+                    and $chunk.section.depth &gt;= 3
+                    and ($chunk.first.sections != 0
+                         or count($node/preceding-sibling::sect3) &gt; 0)">
+      <xsl:call-template name="chunk">
+        <xsl:with-param name="node" select="$node/parent::*"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="local-name($node) = 'sect4'
+                    and $chunk.section.depth &gt;= 4
+                    and ($chunk.first.sections != 0
+                         or count($node/preceding-sibling::sect4) &gt; 0)">
+      <xsl:call-template name="chunk">
+        <xsl:with-param name="node" select="$node/parent::*"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="local-name($node) = 'sect5'
+                    and $chunk.section.depth &gt;= 5
+                    and ($chunk.first.sections != 0
+                         or count($node/preceding-sibling::sect5) &gt; 0)">
+      <xsl:call-template name="chunk">
+        <xsl:with-param name="node" select="$node/parent::*"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="local-name($node) = 'section'
+                    and $chunk.section.depth &gt;= count($node/ancestor::section)+1
+                    and ($chunk.first.sections != 0
+                         or count($node/preceding-sibling::section) &gt; 0)">
+      <xsl:call-template name="chunk">
+        <xsl:with-param name="node" select="$node/parent::*"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:when test="local-name($node)='preface'">1</xsl:when>
+    <xsl:when test="local-name($node)='chapter'">1</xsl:when>
+    <xsl:when test="local-name($node)='appendix'">1</xsl:when>
+    <xsl:when test="local-name($node)='article'">1</xsl:when>
+    <xsl:when test="local-name($node)='part'">1</xsl:when>
+    <xsl:when test="local-name($node)='reference'">1</xsl:when>
+    <xsl:when test="local-name($node)='refentry'">1</xsl:when>
+    <xsl:when test="local-name($node)='index' and ($generate.index != 0 or count($node/*) > 0)
+                    and (local-name($node/parent::*) = 'article'
+                    or local-name($node/parent::*) = 'book'
+                    or local-name($node/parent::*) = 'part'
+                    )">1</xsl:when>
+    <xsl:when test="local-name($node)='bibliography'
+                    and (local-name($node/parent::*) = 'article'
+                    or local-name($node/parent::*) = 'book'
+                    or local-name($node/parent::*) = 'part'
+                    )">1</xsl:when>
+    <xsl:when test="local-name($node)='glossary'
+                    and (local-name($node/parent::*) = 'article'
+                    or local-name($node/parent::*) = 'book'
+                    or local-name($node/parent::*) = 'part'
+                    )">1</xsl:when>
+    <xsl:when test="local-name($node)='colophon'">1</xsl:when>
+    <xsl:when test="local-name($node)='book'">1</xsl:when>
+    <xsl:when test="local-name($node)='set'">1</xsl:when>
+    <xsl:when test="local-name($node)='setindex'">1</xsl:when>
+    <xsl:when test="local-name($node)='legalnotice'
+                    and $generate.legalnotice.link != 0">1</xsl:when>
+    <xsl:when test="name($node)='bookinfo'">1</xsl:when>
+    <xsl:when test="name($node)='articleinfo'">1</xsl:when>
     <xsl:otherwise>0</xsl:otherwise>
   </xsl:choose>
 </xsl:template>
@@ -148,14 +215,14 @@
     <xsl:call-template name="chunk"/>
   </xsl:variable>
 
-  <xsl:variable name="dbhtml-filename">
-    <xsl:call-template name="dbhtml-filename"/>
+  <xsl:variable name="dbhtml_filename">
+    <xsl:call-template name="pi.dbhtml_filename"/>
   </xsl:variable>
 
   <xsl:variable name="filename">
     <xsl:choose>
-      <xsl:when test="$dbhtml-filename != ''">
-        <xsl:value-of select="$dbhtml-filename"/>
+      <xsl:when test="$dbhtml_filename != ''">
+        <xsl:value-of select="$dbhtml_filename"/>
       </xsl:when>
       <!-- if there's no dbhtml filename, and if we're to use IDs as -->
       <!-- filenames, then use the ID to generate the filename. -->
@@ -173,7 +240,7 @@
   </xsl:variable>
 
   <xsl:variable name="dir">
-    <xsl:call-template name="dbhtml-dir"/>
+    <xsl:call-template name="pi.dbhtml_dir"/>
   </xsl:variable>
 
   <xsl:choose>

Modified: gnucash-docs/trunk/xsl/general-customization.xsl
===================================================================
--- gnucash-docs/trunk/xsl/general-customization.xsl	2010-11-19 19:58:24 UTC (rev 19838)
+++ gnucash-docs/trunk/xsl/general-customization.xsl	2010-11-19 19:59:04 UTC (rev 19839)
@@ -7,7 +7,7 @@
 <!--########################Files to Include######################-->
 
 <!-- Importing the Norman Walsh's stylesheet as the basis. -->
-<xsl:import href="1.45/html/chunk.xsl"/>
+<xsl:import href="1.75.2/html/chunk.xsl"/>
 <!-- see NOTE ABOUT PATHS in README file for details -->
 
 <!-- Including new title page stylesheets for customizing the placement 



More information about the gnucash-changes mailing list