<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">
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>