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