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" xmlns:exsl="http://exslt.org/common" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="cf exsl">
6 <!-- ********************************************************************
7 $Id: chunkfast.xsl 8345 2009-03-16 06:44:07Z bobstayton $
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
14 ******************************************************************** -->
16 <!-- ==================================================================== -->
18 <xsl:import href="chunk.xsl"/>
19 <xsl:param name="chunk.fast" select="1"/>
21 <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
23 <!-- ==================================================================== -->
25 <xsl:template name="process-chunk-element">
27 <xsl:when test="$chunk.fast != 0 and $exsl.node.set.available != 0">
28 <xsl:variable name="genid" select="generate-id()"/>
30 <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
32 <xsl:variable name="prevdiv" select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
33 <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
35 <xsl:variable name="nextdiv" select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
36 <xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
39 <xsl:when test="$onechunk != 0 and parent::*">
43 <xsl:call-template name="process-chunk">
44 <xsl:with-param name="prev" select="$prev"/>
45 <xsl:with-param name="next" select="$next"/>
52 <xsl:when test="$onechunk != 0 and not(parent::*)">
53 <xsl:call-template name="chunk-all-sections"/>
55 <xsl:when test="$onechunk != 0">
58 <xsl:when test="$chunk.first.sections = 0">
59 <xsl:call-template name="chunk-first-section-with-parent"/>
62 <xsl:call-template name="chunk-all-sections"/>