source: stylesheets/lfs-xsl/chunkfast.xsl@ c873d807

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since c873d807 was c873d807, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Added new-xsl files.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8196 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.8 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<!--
4$LastChangedBy$
5$Date$
6-->
7
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"
12 version="1.0"
13 exclude-result-prefixes="cf exsl">
14
15 <!-- Top-level chunked code for fast processing.
16 Import standart customized chunk code.
17 Replaces {docbook-xsl}/xhtml/chunkfast.xsl
18
19 Note: Using this file as the top-level for chunked output implies that
20 profiling must be done on a previous step. -->
21
22 <!-- Our master chunking templates -->
23 <xsl:import href="chunk-master.xsl"/>
24
25 <!-- Use chunk.fast code? 1 = yes, 0 = no -->
26 <xsl:param name="chunk.fast" select="1"/>
27
28 <!-- The code below was copied as-is from {docbook-xsl}/xhtml/chunkfast.xsl -->
29
30 <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
31
32 <xsl:template name="process-chunk-element">
33 <xsl:choose>
34 <xsl:when test="$chunk.fast != 0 and function-available('exsl:node-set')">
35 <xsl:variable name="genid" select="generate-id()"/>
36
37 <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
38
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])"/>
41
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])"/>
44
45 <xsl:choose>
46 <xsl:when test="$onechunk != 0 and parent::*">
47 <xsl:apply-imports/>
48 </xsl:when>
49 <xsl:otherwise>
50 <xsl:call-template name="process-chunk">
51 <xsl:with-param name="prev" select="$prev"/>
52 <xsl:with-param name="next" select="$next"/>
53 </xsl:call-template>
54 </xsl:otherwise>
55 </xsl:choose>
56 </xsl:when>
57 <xsl:otherwise>
58 <xsl:choose>
59 <xsl:when test="$onechunk != 0 and not(parent::*)">
60 <xsl:call-template name="chunk-all-sections"/>
61 </xsl:when>
62 <xsl:when test="$onechunk != 0">
63 <xsl:apply-imports/>
64 </xsl:when>
65 <xsl:when test="$chunk.first.sections = 0">
66 <xsl:call-template name="chunk-first-section-with-parent"/>
67 </xsl:when>
68 <xsl:otherwise>
69 <xsl:call-template name="chunk-all-sections"/>
70 </xsl:otherwise>
71 </xsl:choose>
72 </xsl:otherwise>
73 </xsl:choose>
74 </xsl:template>
75
76</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.