[5d4975d] | 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())'>
|
---|
[845e9193] | 7 | ]>
|
---|
[5d4975d] | 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 |
|
---|
[276015d2] | 13 | <!--
|
---|
| 14 | $LastChangedBy$
|
---|
| 15 | $Date$
|
---|
| 16 | -->
|
---|
| 17 |
|
---|
[5d4975d] | 18 | <!--Title-->
|
---|
| 19 | <xsl:template match="index" mode="title.markup">
|
---|
[af7b097] | 20 | <xsl:param name="allow-anchors" select="0"/>
|
---|
| 21 | <xsl:call-template name="gentext">
|
---|
| 22 | <xsl:with-param name="key">Index</xsl:with-param>
|
---|
| 23 | </xsl:call-template>
|
---|
| 24 | </xsl:template>
|
---|
[5d4975d] | 25 |
|
---|
[af7b097] | 26 | <!-- Divisions-->
|
---|
[5d4975d] | 27 | <xsl:template match="indexterm" mode="index-div">
|
---|
| 28 | <xsl:param name="scope" select="."/>
|
---|
| 29 | <xsl:variable name="key"
|
---|
| 30 | select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
|
---|
| 31 | <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
|
---|
| 32 | <xsl:if test="key('letter', $key)[&scope;]
|
---|
| 33 | [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
|
---|
| 34 | <fo:block>
|
---|
| 35 | <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
|
---|
| 36 | <xsl:call-template name="indexdiv.title">
|
---|
| 37 | <xsl:with-param name="titlecontent">
|
---|
| 38 | <xsl:choose>
|
---|
| 39 | <xsl:when test="$divtitle = 'A'">
|
---|
[af7b097] | 40 | <xsl:call-template name="gentext">
|
---|
| 41 | <xsl:with-param name="key">Packages</xsl:with-param>
|
---|
| 42 | </xsl:call-template>
|
---|
[5d4975d] | 43 | </xsl:when>
|
---|
| 44 | <xsl:when test="$divtitle = 'B'">
|
---|
[af7b097] | 45 | <xsl:call-template name="gentext">
|
---|
| 46 | <xsl:with-param name="key">Programs</xsl:with-param>
|
---|
| 47 | </xsl:call-template>
|
---|
[5d4975d] | 48 | </xsl:when>
|
---|
| 49 | <xsl:when test="$divtitle = 'C'">
|
---|
[af7b097] | 50 | <xsl:call-template name="gentext">
|
---|
| 51 | <xsl:with-param name="key">Libraries</xsl:with-param>
|
---|
| 52 | </xsl:call-template>
|
---|
[5d4975d] | 53 | </xsl:when>
|
---|
| 54 | <xsl:when test="$divtitle = 'D'">
|
---|
[af7b097] | 55 | <xsl:call-template name="gentext">
|
---|
[a56c29d] | 56 | <xsl:with-param name="key">Kernel Configuration</xsl:with-param>
|
---|
[af7b097] | 57 | </xsl:call-template>
|
---|
[5d4975d] | 58 | </xsl:when>
|
---|
| 59 | <xsl:when test="$divtitle = 'E'">
|
---|
[af7b097] | 60 | <xsl:call-template name="gentext">
|
---|
| 61 | <xsl:with-param name="key">Configuration Files</xsl:with-param>
|
---|
| 62 | </xsl:call-template>
|
---|
[3fe8b511] | 63 | </xsl:when>
|
---|
| 64 | <xsl:when test="$divtitle = 'F'">
|
---|
[af7b097] | 65 | <xsl:call-template name="gentext">
|
---|
| 66 | <xsl:with-param name="key">Bootscripts</xsl:with-param>
|
---|
| 67 | </xsl:call-template>
|
---|
[3fe8b511] | 68 | </xsl:when>
|
---|
| 69 | <xsl:when test="$divtitle = 'G'">
|
---|
[af7b097] | 70 | <xsl:call-template name="gentext">
|
---|
| 71 | <xsl:with-param name="key">Others</xsl:with-param>
|
---|
| 72 | </xsl:call-template>
|
---|
[5d4975d] | 73 | </xsl:when>
|
---|
| 74 | <xsl:otherwise>
|
---|
| 75 | <xsl:value-of select="$divtitle"/>
|
---|
| 76 | </xsl:otherwise>
|
---|
[af7b097] | 77 | </xsl:choose>
|
---|
[5d4975d] | 78 | </xsl:with-param>
|
---|
| 79 | </xsl:call-template>
|
---|
| 80 | </xsl:if>
|
---|
[af7b097] | 81 | <fo:block>
|
---|
| 82 | <xsl:apply-templates select="key('letter', $key)[&scope;]
|
---|
| 83 | [count(.|key('primary', &primary;)[&scope;][1])=1]"
|
---|
| 84 | mode="index-primary">
|
---|
| 85 | <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
|
---|
| 86 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 87 | </xsl:apply-templates>
|
---|
| 88 | </fo:block>
|
---|
[5d4975d] | 89 | </fo:block>
|
---|
| 90 | </xsl:if>
|
---|
| 91 | </xsl:template>
|
---|
| 92 |
|
---|
[af7b097] | 93 | <!-- The separator -->
|
---|
[5d4975d] | 94 | <xsl:template match="indexterm" mode="reference">
|
---|
| 95 | <xsl:param name="scope" select="."/>
|
---|
[7533fb06] | 96 | <xsl:text>, </xsl:text>
|
---|
[af7b097] | 97 | <xsl:call-template name="reference">
|
---|
[5d4975d] | 98 | <xsl:with-param name="zones" select="normalize-space(@zone)"/>
|
---|
| 99 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 100 | </xsl:call-template>
|
---|
| 101 | </xsl:template>
|
---|
[845e9193] | 102 |
|
---|
[af7b097] | 103 | <!--Bookmarks-->
|
---|
[5d4975d] | 104 | <xsl:template name="reference">
|
---|
| 105 | <xsl:param name="scope" select="."/>
|
---|
| 106 | <xsl:param name="zones"/>
|
---|
| 107 | <xsl:choose>
|
---|
| 108 | <xsl:when test="contains($zones, ' ')">
|
---|
| 109 | <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
|
---|
| 110 | <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
|
---|
| 111 | <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
|
---|
| 112 | <xsl:variable name="target2" select="key('id', $zone2)[&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 | <xsl:variable name="id2">
|
---|
| 119 | <xsl:call-template name="object.id">
|
---|
| 120 | <xsl:with-param name="object" select="$target2[1]"/>
|
---|
| 121 | </xsl:call-template>
|
---|
| 122 | </xsl:variable>
|
---|
[7533fb06] | 123 | <!-- No package page number
|
---|
[af7b097] | 124 | <fo:basic-link internal-destination="{$id}">
|
---|
| 125 | <xsl:apply-templates select="$target" mode="page.citation">
|
---|
| 126 | <xsl:with-param name="id" select="$id"/>
|
---|
| 127 | </xsl:apply-templates>
|
---|
| 128 | </fo:basic-link>
|
---|
[7533fb06] | 129 | <xsl:text>, </xsl:text>-->
|
---|
[af7b097] | 130 | <fo:basic-link internal-destination="{$id2}">
|
---|
| 131 | <xsl:apply-templates select="$target2" mode="page.citation">
|
---|
| 132 | <xsl:with-param name="id" select="$id2"/>
|
---|
| 133 | </xsl:apply-templates>
|
---|
| 134 | </fo:basic-link>
|
---|
[5d4975d] | 135 | </xsl:when>
|
---|
| 136 | <xsl:otherwise>
|
---|
| 137 | <xsl:variable name="zone" select="$zones"/>
|
---|
| 138 | <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
|
---|
| 139 | <xsl:variable name="id">
|
---|
| 140 | <xsl:call-template name="object.id">
|
---|
| 141 | <xsl:with-param name="object" select="$target[1]"/>
|
---|
| 142 | </xsl:call-template>
|
---|
| 143 | </xsl:variable>
|
---|
[af7b097] | 144 | <fo:basic-link internal-destination="{$id}">
|
---|
| 145 | <xsl:apply-templates select="$target" mode="page.citation">
|
---|
| 146 | <xsl:with-param name="id" select="$id"/>
|
---|
| 147 | </xsl:apply-templates>
|
---|
| 148 | </fo:basic-link>
|
---|
[5d4975d] | 149 | </xsl:otherwise>
|
---|
| 150 | </xsl:choose>
|
---|
| 151 | </xsl:template>
|
---|
| 152 |
|
---|
[af7b097] | 153 | <!-- Page number in Index-->
|
---|
| 154 | <xsl:template match="*" mode="page.citation">
|
---|
| 155 | <xsl:param name="id" select="'???'"/>
|
---|
| 156 | <fo:inline keep-together.within-line="always">
|
---|
| 157 | <!--<xsl:text>[p</xsl:text>-->
|
---|
| 158 | <fo:page-number-citation ref-id="{$id}"/>
|
---|
| 159 | <!--<xsl:text>]</xsl:text>-->
|
---|
| 160 | </fo:inline>
|
---|
| 161 | </xsl:template>
|
---|
| 162 |
|
---|
[5d4975d] | 163 | </xsl:stylesheet>
|
---|