]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bugs in onechunk---it wasn't working at all
authorNorman Walsh <ndw@nwalsh.com>
Wed, 15 May 2002 18:07:54 +0000 (18:07 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 15 May 2002 18:07:54 +0000 (18:07 +0000)
xsl/html/chunk.xsl
xsl/html/onechunk.xsl

index 1e5a8a7e3cf2c2a87f1c3d8056b792a131c85e86..60cbd8184217432046fab2294489425f4ebad0b3 100644 (file)
@@ -14,6 +14,9 @@
 
 <xsl:template name="process-chunk-element">
   <xsl:choose>
+    <xsl:when test="$onechunk != 0 and not(parent::*)">
+      <xsl:call-template name="chunk-all-sections"/>
+    </xsl:when>
     <xsl:when test="$onechunk != 0">
       <xsl:apply-imports/>
     </xsl:when>
                      |book/glossary|article/glossary
                      |book/bibliography|article/bibliography
                      |colophon">
-  <xsl:call-template name="process-chunk-element"/>
+  <xsl:choose>
+    <xsl:when test="$onechunk != 0 and parent::*">
+      <xsl:apply-imports/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="process-chunk-element"/>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
index 0a2b839f0b260c45f76e3513bd64aba8c5df0bf7..2b1c3cb597d31f67e3d6b104fac00c4519da6f81 100644 (file)
@@ -4,54 +4,13 @@
                 version="1.0"
                 exclude-result-prefixes="doc">
 
-<!-- This stylesheet works with Saxon and Xalan; for XT use xtchunk.xsl -->
-<!-- This stylesheet should also work for any processor that supports   -->
-<!-- exslt:document() (see http://www.exslt.org/)                       -->
-
 <xsl:import href="chunk.xsl"/>
 
-<xsl:param name="onechunk" select="1"/>
-
-<!-- ==================================================================== -->
-<!-- What's a chunk?
-
-     The root element (that's it in this version)
-                                                                          -->
-<!-- ==================================================================== -->
-
-<xsl:template name="chunk">
-  <xsl:param name="node" select="."/>
+<!-- Ok, using the onechunk parameter makes this all work again. -->
+<!-- It does have the disadvantage that it only works for documents that have -->
+<!-- a root element that is considered a chunk by the chunk.xsl stylesheet. -->
+<!-- Ideally, onechunk would let anything be a chunk. But not today. -->
 
-  <xsl:choose>
-    <xsl:when test="not($node/parent::*)">1</xsl:when>
-    <xsl:otherwise>0</xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
-
-<!-- ==================================================================== -->
-
-<xsl:template match="set|book|part|preface|chapter|appendix
-                     |article
-                     |reference|refentry
-                     |book/glossary|article/glossary
-                     |book/bibliography|article/bibliography
-                     |sect1|/section|section
-                     |setindex|book/index|article/index
-                     |colophon" priority="2">
-  <xsl:variable name="ischunk">
-    <xsl:call-template name="chunk"/>
-  </xsl:variable>
-
-  <xsl:choose>
-    <xsl:when test="$ischunk = 1">
-      <xsl:call-template name="process-chunk-element"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:apply-imports/>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
-
-<!-- ==================================================================== -->
+<xsl:param name="onechunk" select="1"/>
 
 </xsl:stylesheet>