1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:d="http://docbook.org/ns/docbook"
6 xmlns:exsl="http://exslt.org/common"
7 xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0"
8 xmlns="http://www.w3.org/1999/xhtml"
10 exclude-result-prefixes="cf exsl d">
12 <!-- ********************************************************************
14 This file is part of the XSL DocBook Stylesheet distribution.
15 See ../README or http://cdn.docbook.org/release/xsl/current/ for
16 copyright and other information.
18 ******************************************************************** -->
20 <!-- ==================================================================== -->
22 <xsl:import href="chunk.xsl"/>
23 <xsl:param name="chunk.fast" select="1"/>
25 <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
27 <!-- ==================================================================== -->
29 <xsl:template name="process-chunk-element">
31 <xsl:when test="$chunk.fast != 0 and $exsl.node.set.available != 0">
32 <xsl:variable name="genid" select="generate-id()"/>
34 <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
36 <xsl:variable name="prevdiv" select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
37 <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
39 <xsl:variable name="nextdiv" select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
40 <xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
43 <xsl:when test="$onechunk != 0 and parent::*">
47 <xsl:call-template name="process-chunk">
48 <xsl:with-param name="prev" select="$prev"/>
49 <xsl:with-param name="next" select="$next"/>
56 <xsl:when test="$onechunk != 0 and not(parent::*)">
57 <xsl:call-template name="chunk-all-sections"/>
59 <xsl:when test="$onechunk != 0">
62 <xsl:when test="$chunk.first.sections = 0">
63 <xsl:call-template name="chunk-first-section-with-parent"/>
66 <xsl:call-template name="chunk-all-sections"/>