1 <?xml version='
1.0' encoding='ISO-
8859-
1'
?>
8 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
9 xmlns=
"http://www.w3.org/1999/xhtml"
10 xmlns:
exsl=
"http://exslt.org/common"
11 xmlns:
cf=
"http://docbook.sourceforge.net/xmlns/chunkfast/1.0"
13 exclude-result-prefixes=
"cf exsl">
15 <!-- Top-level chunked code for fast processing.
16 Import standart customized chunk code.
17 Replaces {docbook-xsl}/xhtml/chunkfast.xsl
19 Note: Using this file as the top-level for chunked output implies that
20 profiling must be done on a previous step. -->
22 <!-- Our master chunking templates -->
23 <xsl:import href=
"chunk-master.xsl"/>
25 <!-- Use chunk.fast code? 1 = yes, 0 = no -->
26 <xsl:param name=
"chunk.fast" select=
"1"/>
28 <!-- The code below was copied as-is from {docbook-xsl}/xhtml/chunkfast.xsl -->
30 <xsl:variable name=
"chunks" select=
"exsl:node-set($chunk.hierarchy)//cf:div"/>
32 <xsl:template name=
"process-chunk-element">
34 <xsl:when test=
"$chunk.fast != 0 and function-available('exsl:node-set')">
35 <xsl:variable name=
"genid" select=
"generate-id()"/>
37 <xsl:variable name=
"div" select=
"$chunks[@id=$genid or @xml:id=$genid]"/>
39 <xsl:variable name=
"prevdiv" select=
"($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
40 <xsl:variable name=
"prev" select=
"key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
42 <xsl:variable name=
"nextdiv" select=
"($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
43 <xsl:variable name=
"next" select=
"key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
46 <xsl:when test=
"$onechunk != 0 and parent::*">
50 <xsl:call-template name=
"process-chunk">
51 <xsl:with-param name=
"prev" select=
"$prev"/>
52 <xsl:with-param name=
"next" select=
"$next"/>
59 <xsl:when test=
"$onechunk != 0 and not(parent::*)">
60 <xsl:call-template name=
"chunk-all-sections"/>
62 <xsl:when test=
"$onechunk != 0">
65 <xsl:when test=
"$chunk.first.sections = 0">
66 <xsl:call-template name=
"chunk-first-section-with-parent"/>
69 <xsl:call-template name=
"chunk-all-sections"/>