source: stylesheets/print/lfs-index.xsl@ 5d4975d

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 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 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 5d4975d was 5d4975d, checked in by Larry Lawrence <larry@…>, 20 years ago

updated stylesheets to 0.9

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

  • Property mode set to 100644
File size: 5.0 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<!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
10
11<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12 xmlns:fo="http://www.w3.org/1999/XSL/Format"
13 version="1.0">
14
15 <!--Title-->
16 <xsl:template match="index" mode="title.markup">
17 <xsl:param name="allow-anchors" select="0"/>
18 <xsl:text>Index of packages and important installed files</xsl:text>
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:text>Packages</xsl:text>
36 </xsl:when>
37 <xsl:when test="$divtitle = 'B'">
38 <xsl:text>Programs</xsl:text>
39 </xsl:when>
40 <xsl:when test="$divtitle = 'C'">
41 <xsl:text>Libraries</xsl:text>
42 </xsl:when>
43 <xsl:when test="$divtitle = 'D'">
44 <xsl:text>Scripts</xsl:text>
45 </xsl:when>
46 <xsl:when test="$divtitle = 'E'">
47 <xsl:text>Others</xsl:text>
48 </xsl:when>
49 <xsl:otherwise>
50 <xsl:value-of select="$divtitle"/>
51 </xsl:otherwise>
52 </xsl:choose>
53 </xsl:with-param>
54 </xsl:call-template>
55 </xsl:if>
56 <fo:block>
57 <xsl:apply-templates select="key('letter', $key)[&scope;]
58 [count(.|key('primary', &primary;)[&scope;][1])=1]"
59 mode="index-primary">
60 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
61 <xsl:with-param name="scope" select="$scope"/>
62 </xsl:apply-templates>
63 </fo:block>
64 </fo:block>
65 </xsl:if>
66 </xsl:template>
67
68 <!-- The separator -->
69 <xsl:template match="indexterm" mode="reference">
70 <xsl:param name="scope" select="."/>
71 <xsl:text>: </xsl:text>
72 <xsl:call-template name="reference">
73 <xsl:with-param name="zones" select="normalize-space(@zone)"/>
74 <xsl:with-param name="scope" select="$scope"/>
75 </xsl:call-template>
76 </xsl:template>
77
78 <!--Bookmarks-->
79 <xsl:template name="reference">
80 <xsl:param name="scope" select="."/>
81 <xsl:param name="zones"/>
82 <xsl:choose>
83 <xsl:when test="contains($zones, ' ')">
84 <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
85 <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
86 <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
87 <xsl:variable name="target2" select="key('id', $zone2)[&scope;]"/>
88 <xsl:variable name="id">
89 <xsl:call-template name="object.id">
90 <xsl:with-param name="object" select="$target[1]"/>
91 </xsl:call-template>
92 </xsl:variable>
93 <xsl:variable name="id2">
94 <xsl:call-template name="object.id">
95 <xsl:with-param name="object" select="$target2[1]"/>
96 </xsl:call-template>
97 </xsl:variable>
98 <fo:basic-link internal-destination="{$id}">
99 <xsl:apply-templates select="$target" mode="page.citation">
100 <xsl:with-param name="id" select="$id"/>
101 </xsl:apply-templates>
102 </fo:basic-link>
103 <xsl:text> , </xsl:text>
104 <fo:basic-link internal-destination="{$id2}">
105 <xsl:apply-templates select="$target2" mode="page.citation">
106 <xsl:with-param name="id" select="$id2"/>
107 </xsl:apply-templates>
108 </fo:basic-link>
109 </xsl:when>
110 <xsl:otherwise>
111 <xsl:variable name="zone" select="$zones"/>
112 <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
113 <xsl:variable name="id">
114 <xsl:call-template name="object.id">
115 <xsl:with-param name="object" select="$target[1]"/>
116 </xsl:call-template>
117 </xsl:variable>
118 <fo:basic-link internal-destination="{$id}">
119 <xsl:apply-templates select="$target" mode="page.citation">
120 <xsl:with-param name="id" select="$id"/>
121 </xsl:apply-templates>
122 </fo:basic-link>
123 </xsl:otherwise>
124 </xsl:choose>
125 </xsl:template>
126
127</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.