]> granicus.if.org Git - docbook-dsssl/commitdiff
Reworked chunking for downstream customization; will break any existing customization...
authorNorman Walsh <ndw@nwalsh.com>
Sun, 6 Oct 2002 21:16:07 +0000 (21:16 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 6 Oct 2002 21:16:07 +0000 (21:16 +0000)
xsl/html/chunk.xsl

index bb11af84ca2391c8c973bf3a79d070e6637a1aec..d841274bc8ae8bc5b778a91b05fd85ab97d86b22 100644 (file)
 <!-- ==================================================================== -->
 
 <xsl:template name="process-chunk-element">
+  <xsl:param name="content">
+    <xsl:apply-imports/>
+  </xsl:param>
+
   <xsl:choose>
     <xsl:when test="$chunk.fast != 0 and function-available('exsl:node-set')">
       <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//div"/>
 
       <xsl:choose>
         <xsl:when test="$onechunk != 0 and parent::*">
-          <xsl:apply-imports/>
+          <xsl:copy-of select="$content"/>
         </xsl:when>
         <xsl:otherwise>
           <xsl:call-template name="process-chunk">
             <xsl:with-param name="prev" select="$prev"/>
             <xsl:with-param name="next" select="$next"/>
+            <xsl:with-param name="content" select="$content"/>
           </xsl:call-template>
         </xsl:otherwise>
       </xsl:choose>
     <xsl:otherwise>
       <xsl:choose>
         <xsl:when test="$onechunk != 0 and not(parent::*)">
-          <xsl:call-template name="chunk-all-sections"/>
+          <xsl:call-template name="chunk-all-sections">
+            <xsl:with-param name="content" select="$content"/>
+          </xsl:call-template>
         </xsl:when>
         <xsl:when test="$onechunk != 0">
-          <xsl:apply-imports/>
+          <xsl:copy-of select="$content"/>
         </xsl:when>
         <xsl:when test="$chunk.first.sections = 0">
-          <xsl:call-template name="chunk-first-section-with-parent"/>
+          <xsl:call-template name="chunk-first-section-with-parent">
+            <xsl:with-param name="content" select="$content"/>
+          </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
-          <xsl:call-template name="chunk-all-sections"/>
+          <xsl:call-template name="chunk-all-sections">
+            <xsl:with-param name="content" select="$content"/>
+          </xsl:call-template>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:otherwise>
 <xsl:template name="process-chunk">
   <xsl:param name="prev" select="."/>
   <xsl:param name="next" select="."/>
+  <xsl:param name="content">
+    <xsl:apply-imports/>
+  </xsl:param>
 
   <xsl:variable name="ischunk">
     <xsl:call-template name="chunk"/>
       <xsl:call-template name="chunk-element-content">
         <xsl:with-param name="prev" select="$prev"/>
         <xsl:with-param name="next" select="$next"/>
+        <xsl:with-param name="content" select="$content"/>
       </xsl:call-template>
     </xsl:with-param>
     <xsl:with-param name="quiet" select="$chunk.quietly"/>
 </xsl:template>
 
 <xsl:template name="chunk-first-section-with-parent">
+  <xsl:param name="content">
+    <xsl:apply-imports/>
+  </xsl:param>
+
   <!-- These xpath expressions are really hairy. The trick is to pick sections -->
   <!-- that are not first children and are not the children of first children -->
 
   <xsl:call-template name="process-chunk">
     <xsl:with-param name="prev" select="$prev"/>
     <xsl:with-param name="next" select="$next"/>
+    <xsl:with-param name="content" select="$content"/>
   </xsl:call-template>
 </xsl:template>
 
 <xsl:template name="chunk-all-sections">
+  <xsl:param name="content">
+    <xsl:apply-imports/>
+  </xsl:param>
+
   <xsl:variable name="prev-v1"
     select="(preceding::sect1[$chunk.section.depth &gt; 0][1]
              |preceding::sect2[$chunk.section.depth &gt; 1][1]
   <xsl:call-template name="process-chunk">
     <xsl:with-param name="prev" select="$prev"/>
     <xsl:with-param name="next" select="$next"/>
+    <xsl:with-param name="content" select="$content"/>
   </xsl:call-template>
 </xsl:template>