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())'
>
9 <!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
11 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
12 xmlns:
fo=
"http://www.w3.org/1999/XSL/Format"
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>
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]">
30 <xsl:if test=
"contains(concat(&lowercase;, &uppercase;), $key)">
31 <xsl:call-template name=
"indexdiv.title">
32 <xsl:with-param name=
"titlecontent">
34 <xsl:when test=
"$divtitle = 'A'">
35 <xsl:text>Packages
</xsl:text>
37 <xsl:when test=
"$divtitle = 'B'">
38 <xsl:text>Programs
</xsl:text>
40 <xsl:when test=
"$divtitle = 'C'">
41 <xsl:text>Libraries
</xsl:text>
43 <xsl:when test=
"$divtitle = 'D'">
44 <xsl:text>Scripts
</xsl:text>
46 <xsl:when test=
"$divtitle = 'E'">
47 <xsl:text>Others
</xsl:text>
50 <xsl:value-of select=
"$divtitle"/>
57 <xsl:apply-templates select=
"key('letter', $key)[&scope;]
58 [count(.|key('primary', &primary;)[&scope;][1])=1]"
60 <xsl:sort select=
"translate(&primary;, &lowercase;, &uppercase;)"/>
61 <xsl:with-param name=
"scope" select=
"$scope"/>
62 </xsl:apply-templates>
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"/>
79 <xsl:template name=
"reference">
80 <xsl:param name=
"scope" select=
"."/>
81 <xsl:param name=
"zones"/>
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]"/>
93 <xsl:variable name=
"id2">
94 <xsl:call-template name=
"object.id">
95 <xsl:with-param name=
"object" select=
"$target2[1]"/>
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>
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>
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]"/>
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>