source: stylesheets/pdf/lfs-index.xsl@ 845e9193

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 845e9193 was 845e9193, checked in by Randy McMurchy <randy@…>, 19 years ago

Removed spaces from blank lines and excess spaces from the end of XML data

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@4490 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 6.5 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2<!DOCTYPE xsl:stylesheet [
3<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
4<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
5<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
6<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
7]>
8
9<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 xmlns:fo="http://www.w3.org/1999/XSL/Format"
11 version="1.0">
12
13 <!--Title-->
14 <xsl:template match="index" mode="title.markup">
15 <xsl:param name="allow-anchors" select="0"/>
16 <xsl:call-template name="gentext">
17 <xsl:with-param name="key">Index</xsl:with-param>
18 </xsl:call-template>
19 </xsl:template>
20
21 <!-- Divisions-->
22 <xsl:template match="indexterm" mode="index-div">
23 <xsl:param name="scope" select="."/>
24 <xsl:variable name="key"
25 select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
26 <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
27 <xsl:if test="key('letter', $key)[&scope;]
28 [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
29 <fo:block>
30 <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
31 <xsl:call-template name="indexdiv.title">
32 <xsl:with-param name="titlecontent">
33 <xsl:choose>
34 <xsl:when test="$divtitle = 'A'">
35 <xsl:call-template name="gentext">
36 <xsl:with-param name="key">Packages</xsl:with-param>
37 </xsl:call-template>
38 </xsl:when>
39 <xsl:when test="$divtitle = 'B'">
40 <xsl:call-template name="gentext">
41 <xsl:with-param name="key">Programs</xsl:with-param>
42 </xsl:call-template>
43 </xsl:when>
44 <xsl:when test="$divtitle = 'C'">
45 <xsl:call-template name="gentext">
46 <xsl:with-param name="key">Libraries</xsl:with-param>
47 </xsl:call-template>
48 </xsl:when>
49 <xsl:when test="$divtitle = 'D'">
50 <xsl:call-template name="gentext">
51 <xsl:with-param name="key">Kernel Configuration</xsl:with-param>
52 </xsl:call-template>
53 </xsl:when>
54 <xsl:when test="$divtitle = 'E'">
55 <xsl:call-template name="gentext">
56 <xsl:with-param name="key">Configuration Files</xsl:with-param>
57 </xsl:call-template>
58 </xsl:when>
59 <xsl:when test="$divtitle = 'F'">
60 <xsl:call-template name="gentext">
61 <xsl:with-param name="key">Bootscripts</xsl:with-param>
62 </xsl:call-template>
63 </xsl:when>
64 <xsl:when test="$divtitle = 'G'">
65 <xsl:call-template name="gentext">
66 <xsl:with-param name="key">Others</xsl:with-param>
67 </xsl:call-template>
68 </xsl:when>
69 <xsl:otherwise>
70 <xsl:value-of select="$divtitle"/>
71 </xsl:otherwise>
72 </xsl:choose>
73 </xsl:with-param>
74 </xsl:call-template>
75 </xsl:if>
76 <fo:block>
77 <xsl:apply-templates select="key('letter', $key)[&scope;]
78 [count(.|key('primary', &primary;)[&scope;][1])=1]"
79 mode="index-primary">
80 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
81 <xsl:with-param name="scope" select="$scope"/>
82 </xsl:apply-templates>
83 </fo:block>
84 </fo:block>
85 </xsl:if>
86 </xsl:template>
87
88 <!-- The separator -->
89 <xsl:template match="indexterm" mode="reference">
90 <xsl:param name="scope" select="."/>
91 <xsl:text>,&#160;</xsl:text>
92 <xsl:call-template name="reference">
93 <xsl:with-param name="zones" select="normalize-space(@zone)"/>
94 <xsl:with-param name="scope" select="$scope"/>
95 </xsl:call-template>
96 </xsl:template>
97
98 <!--Bookmarks-->
99 <xsl:template name="reference">
100 <xsl:param name="scope" select="."/>
101 <xsl:param name="zones"/>
102 <xsl:choose>
103 <xsl:when test="contains($zones, ' ')">
104 <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
105 <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
106 <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
107 <xsl:variable name="target2" select="key('id', $zone2)[&scope;]"/>
108 <xsl:variable name="id">
109 <xsl:call-template name="object.id">
110 <xsl:with-param name="object" select="$target[1]"/>
111 </xsl:call-template>
112 </xsl:variable>
113 <xsl:variable name="id2">
114 <xsl:call-template name="object.id">
115 <xsl:with-param name="object" select="$target2[1]"/>
116 </xsl:call-template>
117 </xsl:variable>
118 <!-- No package page number
119 <fo:basic-link internal-destination="{$id}">
120 <xsl:apply-templates select="$target" mode="page.citation">
121 <xsl:with-param name="id" select="$id"/>
122 </xsl:apply-templates>
123 </fo:basic-link>
124 <xsl:text>, </xsl:text>-->
125 <fo:basic-link internal-destination="{$id2}">
126 <xsl:apply-templates select="$target2" mode="page.citation">
127 <xsl:with-param name="id" select="$id2"/>
128 </xsl:apply-templates>
129 </fo:basic-link>
130 </xsl:when>
131 <xsl:otherwise>
132 <xsl:variable name="zone" select="$zones"/>
133 <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
134 <xsl:variable name="id">
135 <xsl:call-template name="object.id">
136 <xsl:with-param name="object" select="$target[1]"/>
137 </xsl:call-template>
138 </xsl:variable>
139 <fo:basic-link internal-destination="{$id}">
140 <xsl:apply-templates select="$target" mode="page.citation">
141 <xsl:with-param name="id" select="$id"/>
142 </xsl:apply-templates>
143 </fo:basic-link>
144 </xsl:otherwise>
145 </xsl:choose>
146 </xsl:template>
147
148 <!-- Page number in Index-->
149 <xsl:template match="*" mode="page.citation">
150 <xsl:param name="id" select="'???'"/>
151 <fo:inline keep-together.within-line="always">
152 <!--<xsl:text>[p</xsl:text>-->
153 <fo:page-number-citation ref-id="{$id}"/>
154 <!--<xsl:text>]</xsl:text>-->
155 </fo:inline>
156 </xsl:template>
157
158</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.