[ae8a3e4] | 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="http://www.w3.org/1999/xhtml"
|
---|
| 11 | version="1.0">
|
---|
| 12 |
|
---|
[276015d2] | 13 | <!--
|
---|
| 14 | $LastChangedBy$
|
---|
| 15 | $Date$
|
---|
| 16 | -->
|
---|
| 17 |
|
---|
[ae8a3e4] | 18 | <!--Filename-->
|
---|
| 19 | <xsl:template match="index" mode="recursive-chunk-filename">
|
---|
| 20 | <xsl:text>longindex.html</xsl:text>
|
---|
| 21 | </xsl:template>
|
---|
| 22 |
|
---|
| 23 | <!--Title-->
|
---|
[239e8ca] | 24 | <xsl:param name="index-title">Index</xsl:param>
|
---|
[845e9193] | 25 |
|
---|
[ae8a3e4] | 26 | <xsl:template match="index" mode="title.markup">
|
---|
[e7ce829] | 27 | <xsl:call-template name="gentext">
|
---|
| 28 | <xsl:with-param name="key" select="$index-title"/>
|
---|
| 29 | </xsl:call-template>
|
---|
[ae8a3e4] | 30 | </xsl:template>
|
---|
[845e9193] | 31 |
|
---|
[5d4975d] | 32 | <xsl:template name="index.titlepage">
|
---|
| 33 | <div class="titlepage">
|
---|
| 34 | <h1 class="index">
|
---|
[e7ce829] | 35 | <xsl:call-template name="gentext">
|
---|
| 36 | <xsl:with-param name="key" select="$index-title"/>
|
---|
| 37 | </xsl:call-template>
|
---|
[1443f74e] | 38 | </h1>
|
---|
[c0c133a] | 39 | <!-- Temporary addition until index is done
|
---|
[1443f74e] | 40 | <div class="note">
|
---|
| 41 | <div class="admonhead">
|
---|
| 42 | <img alt="[Note]" src="../images/note.png" />
|
---|
| 43 | <h3 class="admontitle">
|
---|
| 44 | Note
|
---|
| 45 | </h3>
|
---|
| 46 | </div>
|
---|
| 47 | <div class="admonbody">
|
---|
| 48 | <p>
|
---|
| 49 | At this time, the index is incomplete. Additional entries
|
---|
| 50 | will be added as time permits.
|
---|
| 51 | </p>
|
---|
| 52 | </div>
|
---|
[845e9193] | 53 | </div>
|
---|
[c0c133a] | 54 | End temporary addition -->
|
---|
[5d4975d] | 55 | </div>
|
---|
| 56 | </xsl:template>
|
---|
[ae8a3e4] | 57 |
|
---|
| 58 | <!--Divisions-->
|
---|
| 59 | <xsl:template match="indexterm" mode="index-div">
|
---|
| 60 | <xsl:param name="scope" select="."/>
|
---|
| 61 | <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
|
---|
| 62 | <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
|
---|
| 63 | <!-- Make sure that we don't generate a div if there are no terms in scope -->
|
---|
| 64 | <xsl:if test="key('letter', $key)[&scope;] [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
|
---|
| 65 | <div class="indexdiv">
|
---|
| 66 | <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
|
---|
| 67 | <h2>
|
---|
[0ef1837] | 68 | <xsl:choose>
|
---|
| 69 | <xsl:when test="$divtitle = 'A'">
|
---|
[ee1c43a] | 70 | <a id="package-index" name="package-index"/>
|
---|
[e7ce829] | 71 | <xsl:call-template name="gentext">
|
---|
| 72 | <xsl:with-param name="key">Packages</xsl:with-param>
|
---|
| 73 | </xsl:call-template>
|
---|
[ae8a3e4] | 74 | </xsl:when>
|
---|
| 75 | <xsl:when test="$divtitle = 'B'">
|
---|
[ee1c43a] | 76 | <a id="program-index" name="program-index"/>
|
---|
[e7ce829] | 77 | <xsl:call-template name="gentext">
|
---|
| 78 | <xsl:with-param name="key">Programs</xsl:with-param>
|
---|
| 79 | </xsl:call-template>
|
---|
[ae8a3e4] | 80 | </xsl:when>
|
---|
| 81 | <xsl:when test="$divtitle = 'C'">
|
---|
[ee1c43a] | 82 | <a id="library-index" name="library-index"/>
|
---|
[e7ce829] | 83 | <xsl:call-template name="gentext">
|
---|
| 84 | <xsl:with-param name="key">Libraries</xsl:with-param>
|
---|
| 85 | </xsl:call-template>
|
---|
[ae8a3e4] | 86 | </xsl:when>
|
---|
| 87 | <xsl:when test="$divtitle = 'D'">
|
---|
[ee1c43a] | 88 | <a id="kernel-config-index" name="kernel-config-index"/>
|
---|
[e7ce829] | 89 | <xsl:call-template name="gentext">
|
---|
| 90 | <xsl:with-param name="key">Kernel Configuration</xsl:with-param>
|
---|
| 91 | </xsl:call-template>
|
---|
[ae8a3e4] | 92 | </xsl:when>
|
---|
[0ef1837] | 93 | <xsl:when test="$divtitle = 'E'">
|
---|
[ee1c43a] | 94 | <a id="config-file-index" name="config-file-index"/>
|
---|
[e7ce829] | 95 | <xsl:call-template name="gentext">
|
---|
| 96 | <xsl:with-param name="key">Configuration Files</xsl:with-param>
|
---|
| 97 | </xsl:call-template>
|
---|
[0ef1837] | 98 | </xsl:when>
|
---|
| 99 | <xsl:when test="$divtitle = 'F'">
|
---|
[ee1c43a] | 100 | <a id="bootscript-index" name="bootscript-index"/>
|
---|
[e7ce829] | 101 | <xsl:call-template name="gentext">
|
---|
| 102 | <xsl:with-param name="key">Bootscripts</xsl:with-param>
|
---|
| 103 | </xsl:call-template>
|
---|
[0ef1837] | 104 | </xsl:when>
|
---|
| 105 | <xsl:when test="$divtitle = 'G'">
|
---|
[ee1c43a] | 106 | <a id="other-index" name="other-index"/>
|
---|
[e7ce829] | 107 | <xsl:call-template name="gentext">
|
---|
| 108 | <xsl:with-param name="key">Others</xsl:with-param>
|
---|
| 109 | </xsl:call-template>
|
---|
[0ef1837] | 110 | </xsl:when>
|
---|
[ae8a3e4] | 111 | <xsl:otherwise>
|
---|
[0ef1837] | 112 | <xsl:value-of select="$divtitle"/>
|
---|
| 113 | </xsl:otherwise>
|
---|
[ae8a3e4] | 114 | </xsl:choose>
|
---|
| 115 | </h2>
|
---|
| 116 | </xsl:if>
|
---|
| 117 | <ul>
|
---|
| 118 | <xsl:apply-templates select="key('letter', $key)[&scope;]
|
---|
| 119 | [count(.|key('primary', &primary;)[&scope;][1])=1]" mode="index-primary">
|
---|
| 120 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 121 | <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
|
---|
| 122 | </xsl:apply-templates>
|
---|
| 123 | </ul>
|
---|
| 124 | </div>
|
---|
| 125 | </xsl:if>
|
---|
| 126 | </xsl:template>
|
---|
| 127 |
|
---|
| 128 | <!-- Dropping the separator from here-->
|
---|
| 129 | <xsl:template match="indexterm" mode="reference">
|
---|
| 130 | <xsl:param name="scope" select="."/>
|
---|
| 131 | <xsl:call-template name="reference">
|
---|
| 132 | <xsl:with-param name="zones" select="normalize-space(@zone)"/>
|
---|
| 133 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 134 | </xsl:call-template>
|
---|
| 135 | </xsl:template>
|
---|
| 136 |
|
---|
| 137 | <!-- Changing the output tags and re-addind the separator-->
|
---|
| 138 | <xsl:template match="indexterm" mode="index-primary">
|
---|
| 139 | <xsl:param name="scope" select="."/>
|
---|
| 140 | <xsl:variable name="key" select="&primary;"/>
|
---|
| 141 | <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
|
---|
| 142 | <li>
|
---|
| 143 | <strong class="item">
|
---|
| 144 | <xsl:value-of select="primary"/>
|
---|
| 145 | <xsl:text>: </xsl:text>
|
---|
[5e363b3] | 146 | </strong><div class='indexref'>
|
---|
[ae8a3e4] | 147 | <xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section',
|
---|
| 148 | concat($key, " ", generate-id((ancestor-or-self::book |ancestor-or-self::part
|
---|
| 149 | |ancestor-or-self::chapter |ancestor-or-self::appendix |ancestor-or-self::preface
|
---|
| 150 | |ancestor-or-self::sect1 |ancestor-or-self::sect2 |ancestor-or-self::sect3
|
---|
| 151 | |ancestor-or-self::sect4 |ancestor-or-self::sect5 |ancestor-or-self::index)[last()])))[&scope;][1])]">
|
---|
| 152 | <xsl:apply-templates select="." mode="reference">
|
---|
| 153 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 154 | </xsl:apply-templates>
|
---|
| 155 | </xsl:for-each>
|
---|
| 156 | <xsl:if test="$refs/secondary">
|
---|
| 157 | <ul>
|
---|
[6091daf] | 158 | <xsl:apply-templates select="$refs[secondary and count(.|key('secondary',
|
---|
[ae8a3e4] | 159 | concat($key, " ", normalize-space(concat(secondary/@sortas,
|
---|
| 160 | secondary[not(@sortas)]))))[&scope;][1]) = 1]" mode="index-secondary">
|
---|
| 161 | <xsl:with-param name="scope" select="$scope"/>
|
---|
[6091daf] | 162 | <xsl:sort select="translate(normalize-space(concat(secondary/@sortas,
|
---|
[ae8a3e4] | 163 | secondary[not(@sortas)])), &lowercase;, &uppercase;)"/>
|
---|
| 164 | </xsl:apply-templates>
|
---|
| 165 | </ul>
|
---|
| 166 | </xsl:if>
|
---|
[5e363b3] | 167 | </div></li>
|
---|
[ae8a3e4] | 168 | </xsl:template>
|
---|
[5d4975d] | 169 |
|
---|
[ae8a3e4] | 170 | <xsl:template match="indexterm" mode="index-secondary">
|
---|
| 171 | <xsl:param name="scope" select="."/>
|
---|
| 172 | <xsl:variable name="key" select="concat(&primary;, " ",
|
---|
| 173 | normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])))"/>
|
---|
| 174 | <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
|
---|
| 175 | <li>
|
---|
| 176 | <strong class="secitem">
|
---|
| 177 | <xsl:value-of select="secondary"/>
|
---|
| 178 | <xsl:text>: </xsl:text>
|
---|
| 179 | </strong>
|
---|
| 180 | <xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section',
|
---|
| 181 | concat($key, " ", generate-id((ancestor-or-self::book |ancestor-or-self::part
|
---|
| 182 | |ancestor-or-self::chapter |ancestor-or-self::appendix |ancestor-or-self::preface
|
---|
| 183 | |ancestor-or-self::sect1 |ancestor-or-self::sect2 |ancestor-or-self::sect3
|
---|
| 184 | |ancestor-or-self::sect4 |ancestor-or-self::sect5 |ancestor-or-self::index)[last()])))[&scope;][1])]">
|
---|
| 185 | <xsl:apply-templates select="." mode="reference">
|
---|
| 186 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 187 | </xsl:apply-templates>
|
---|
| 188 | </xsl:for-each>
|
---|
| 189 | </li>
|
---|
| 190 | </xsl:template>
|
---|
| 191 |
|
---|
| 192 | <!--Links (This template also fix a bug in the original code)-->
|
---|
| 193 | <xsl:template name="reference">
|
---|
| 194 | <xsl:param name="scope" select="."/>
|
---|
| 195 | <xsl:param name="zones"/>
|
---|
| 196 | <xsl:choose>
|
---|
| 197 | <xsl:when test="contains($zones, ' ')">
|
---|
| 198 | <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
|
---|
| 199 | <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
|
---|
| 200 | <xsl:variable name="target" select="key('sections', $zone)[&scope;]"/>
|
---|
| 201 | <xsl:variable name="target2" select="key('sections', $zone2)[&scope;]"/>
|
---|
| 202 | <a>
|
---|
| 203 | <xsl:attribute name="href">
|
---|
| 204 | <xsl:call-template name="href.target.uri">
|
---|
| 205 | <xsl:with-param name="object" select="$target[1]"/>
|
---|
| 206 | </xsl:call-template>
|
---|
| 207 | </xsl:attribute>
|
---|
| 208 | <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
|
---|
| 209 | </a>
|
---|
| 210 | <xsl:text> -- </xsl:text>
|
---|
| 211 | <a>
|
---|
| 212 | <xsl:attribute name="href">
|
---|
| 213 | <xsl:call-template name="href.target.uri">
|
---|
| 214 | <xsl:with-param name="object" select="$target2[1]"/>
|
---|
| 215 | </xsl:call-template>
|
---|
| 216 | </xsl:attribute>
|
---|
[e7ce829] | 217 | <xsl:call-template name="gentext">
|
---|
| 218 | <xsl:with-param name="key">description</xsl:with-param>
|
---|
| 219 | </xsl:call-template>
|
---|
[5e363b3] | 220 | </a><br />
|
---|
[ae8a3e4] | 221 | </xsl:when>
|
---|
| 222 | <xsl:otherwise>
|
---|
| 223 | <xsl:variable name="zone" select="$zones"/>
|
---|
| 224 | <xsl:variable name="target" select="key('sections', $zone)[&scope;]"/>
|
---|
| 225 | <a>
|
---|
| 226 | <xsl:attribute name="href">
|
---|
| 227 | <xsl:call-template name="href.target.uri">
|
---|
| 228 | <xsl:with-param name="object" select="$target[1]"/>
|
---|
| 229 | </xsl:call-template>
|
---|
| 230 | </xsl:attribute>
|
---|
| 231 | <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
|
---|
| 232 | </a>
|
---|
| 233 | </xsl:otherwise>
|
---|
| 234 | </xsl:choose>
|
---|
| 235 | </xsl:template>
|
---|
[845e9193] | 236 |
|
---|
[5d4975d] | 237 | <!-- Dropping unneeded anchors -->
|
---|
| 238 | <xsl:template match="indexterm"/>
|
---|
[ae8a3e4] | 239 |
|
---|
| 240 | </xsl:stylesheet>
|
---|