]> git.lyx.org Git - features.git/blob - lib/docbook/xhtml5/chunkfast.xsl
User Guide: add quotes to a PackageOptions command
[features.git] / lib / docbook / xhtml5 / chunkfast.xsl
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:d="http://docbook.org/ns/docbook"
5 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 d">
6
7 <!-- ********************************************************************
8
9      This file is part of the XSL DocBook Stylesheet distribution.
10      See ../README or http://cdn.docbook.org/release/xsl/current/ for
11      copyright and other information.
12
13      ******************************************************************** -->
14
15 <!-- ==================================================================== -->
16
17 <xsl:import href="chunk.xsl"/>
18 <xsl:param name="chunk.fast" select="1"/>
19
20 <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
21
22 <!-- ==================================================================== -->
23
24 <xsl:template name="process-chunk-element">
25   <xsl:choose>
26     <xsl:when test="$chunk.fast != 0 and $exsl.node.set.available != 0">
27       <xsl:variable name="genid" select="generate-id()"/>
28
29       <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
30
31       <xsl:variable name="prevdiv" select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
32       <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
33
34       <xsl:variable name="nextdiv" select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
35       <xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
36
37       <xsl:choose>
38         <xsl:when test="$onechunk != 0 and parent::*">
39           <xsl:apply-imports/>
40         </xsl:when>
41         <xsl:otherwise>
42           <xsl:call-template name="process-chunk">
43             <xsl:with-param name="prev" select="$prev"/>
44             <xsl:with-param name="next" select="$next"/>
45           </xsl:call-template>
46         </xsl:otherwise>
47       </xsl:choose>
48     </xsl:when>
49     <xsl:otherwise>
50       <xsl:choose>
51         <xsl:when test="$onechunk != 0 and not(parent::*)">
52           <xsl:call-template name="chunk-all-sections"/>
53         </xsl:when>
54         <xsl:when test="$onechunk != 0">
55           <xsl:apply-imports/>
56         </xsl:when>
57         <xsl:when test="$chunk.first.sections = 0">
58           <xsl:call-template name="chunk-first-section-with-parent"/>
59         </xsl:when>
60         <xsl:otherwise>
61           <xsl:call-template name="chunk-all-sections"/>
62         </xsl:otherwise>
63       </xsl:choose>
64     </xsl:otherwise>
65   </xsl:choose>
66 </xsl:template>
67
68 </xsl:stylesheet>