[0c43171] | 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)]))'>
|
---|
[ded6ddd] | 6 | <!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))'>
|
---|
[0c43171] | 7 | <!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
|
---|
[ded6ddd] | 8 | <!ENTITY sep '" "'>
|
---|
[0c43171] | 9 | ]>
|
---|
| 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 |
|
---|
[a9e89d0] | 15 | <!--Only one column to fit the table layout-->
|
---|
[ded6ddd] | 16 | <xsl:param name="column.count.index" select="1"/>
|
---|
[0c43171] | 17 |
|
---|
| 18 | <!--Title-->
|
---|
| 19 | <xsl:template match="index" mode="title.markup">
|
---|
| 20 | <xsl:text>Index of packages and important installed files</xsl:text>
|
---|
[a9e89d0] | 21 | </xsl:template>
|
---|
[0c43171] | 22 |
|
---|
[a9e89d0] | 23 | <!-- Divisions-->
|
---|
[0c43171] | 24 | <xsl:template match="indexterm" mode="index-div">
|
---|
| 25 | <xsl:param name="scope" select="."/>
|
---|
| 26 | <xsl:variable name="key"
|
---|
| 27 | select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
|
---|
| 28 | <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
|
---|
| 29 | <xsl:if test="key('letter', $key)[&scope;]
|
---|
| 30 | [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
|
---|
| 31 | <fo:block>
|
---|
| 32 | <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
|
---|
| 33 | <xsl:call-template name="indexdiv.title">
|
---|
| 34 | <xsl:with-param name="titlecontent">
|
---|
| 35 | <xsl:choose>
|
---|
| 36 | <xsl:when test="$divtitle = 'A'">
|
---|
| 37 | <xsl:text>Packages</xsl:text>
|
---|
[ded6ddd] | 38 | </xsl:when>
|
---|
| 39 | <xsl:when test="$divtitle = 'B'">
|
---|
| 40 | <xsl:text>Programs</xsl:text>
|
---|
| 41 | </xsl:when>
|
---|
| 42 | <xsl:when test="$divtitle = 'C'">
|
---|
| 43 | <xsl:text>Libraries</xsl:text>
|
---|
| 44 | </xsl:when>
|
---|
| 45 | <xsl:when test="$divtitle = 'D'">
|
---|
| 46 | <xsl:text>Scripts</xsl:text>
|
---|
| 47 | </xsl:when>
|
---|
| 48 | <xsl:when test="$divtitle = 'E'">
|
---|
| 49 | <xsl:text>Others</xsl:text>
|
---|
| 50 | </xsl:when>
|
---|
| 51 | <xsl:otherwise>
|
---|
| 52 | <xsl:value-of select="$divtitle"/>
|
---|
| 53 | </xsl:otherwise>
|
---|
[a9e89d0] | 54 | </xsl:choose>
|
---|
[0c43171] | 55 | </xsl:with-param>
|
---|
| 56 | </xsl:call-template>
|
---|
| 57 | </xsl:if>
|
---|
[ded6ddd] | 58 | <fo:table table-layout="fixed" width="100%">
|
---|
[a9e89d0] | 59 | <fo:table-column column-number="1" column-width="11em"/>
|
---|
| 60 | <fo:table-column column-number="2" column-width="19em"/>
|
---|
| 61 | <fo:table-column column-number="3"/>
|
---|
[ded6ddd] | 62 | <fo:table-body>
|
---|
| 63 | <xsl:apply-templates select="key('letter', $key)[&scope;]
|
---|
| 64 | [count(.|key('primary', &primary;)[&scope;][1])=1]"
|
---|
| 65 | mode="index-primary">
|
---|
| 66 | <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
|
---|
| 67 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 68 | </xsl:apply-templates>
|
---|
[a9e89d0] | 69 | </fo:table-body>
|
---|
[ded6ddd] | 70 | </fo:table>
|
---|
[0c43171] | 71 | </fo:block>
|
---|
| 72 | </xsl:if>
|
---|
| 73 | </xsl:template>
|
---|
| 74 |
|
---|
[a9e89d0] | 75 | <!-- Dropping the separator from here -->
|
---|
[0c43171] | 76 | <xsl:template match="indexterm" mode="reference">
|
---|
| 77 | <xsl:param name="scope" select="."/>
|
---|
[a9e89d0] | 78 | <xsl:call-template name="reference">
|
---|
[0c43171] | 79 | <xsl:with-param name="zones" select="normalize-space(@zone)"/>
|
---|
| 80 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 81 | </xsl:call-template>
|
---|
| 82 | </xsl:template>
|
---|
[ded6ddd] | 83 |
|
---|
[a9e89d0] | 84 | <!-- Changing the output tags and re-addind the separator-->
|
---|
[ded6ddd] | 85 | <xsl:template match="indexterm" mode="index-primary">
|
---|
| 86 | <xsl:param name="scope" select="."/>
|
---|
| 87 | <xsl:variable name="key" select="&primary;"/>
|
---|
| 88 | <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
|
---|
| 89 | <fo:table-row>
|
---|
[a9e89d0] | 90 | <fo:table-cell>
|
---|
| 91 | <fo:block>
|
---|
[ded6ddd] | 92 | <xsl:value-of select="primary"/>
|
---|
| 93 | <xsl:text>: </xsl:text>
|
---|
[a9e89d0] | 94 | </fo:block>
|
---|
[ded6ddd] | 95 | </fo:table-cell>
|
---|
| 96 | <xsl:for-each select="$refs[not(see) and not(seealso)
|
---|
| 97 | and not(secondary)]">
|
---|
| 98 | <xsl:apply-templates select="." mode="reference">
|
---|
| 99 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 100 | </xsl:apply-templates>
|
---|
| 101 | </xsl:for-each>
|
---|
[a9e89d0] | 102 | </fo:table-row>
|
---|
| 103 | <xsl:if test="$refs/secondary">
|
---|
[ded6ddd] | 104 | <xsl:apply-templates select="$refs[secondary and count(.|key('secondary',
|
---|
[a9e89d0] | 105 | concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" mode="index-secondary">
|
---|
| 106 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 107 | <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
|
---|
| 108 | </xsl:apply-templates>
|
---|
| 109 | </xsl:if>
|
---|
[ded6ddd] | 110 | </xsl:template>
|
---|
| 111 |
|
---|
| 112 | <xsl:template match="indexterm" mode="index-secondary">
|
---|
| 113 | <xsl:param name="scope" select="."/>
|
---|
[a9e89d0] | 114 | <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
|
---|
[ded6ddd] | 115 | <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
|
---|
| 116 | <fo:table-row>
|
---|
[a9e89d0] | 117 | <fo:table-cell>
|
---|
| 118 | <fo:block start-indent="1pc">
|
---|
[ded6ddd] | 119 | <xsl:value-of select="secondary"/>
|
---|
| 120 | <xsl:text>: </xsl:text>
|
---|
| 121 | </fo:block>
|
---|
[a9e89d0] | 122 | </fo:table-cell>
|
---|
[ded6ddd] | 123 | <xsl:for-each select="$refs[not(see) and not(seealso) and not(tertiary)]">
|
---|
| 124 | <xsl:apply-templates select="." mode="reference">
|
---|
| 125 | <xsl:with-param name="scope" select="$scope"/>
|
---|
| 126 | </xsl:apply-templates>
|
---|
| 127 | </xsl:for-each>
|
---|
[a9e89d0] | 128 | </fo:table-row>
|
---|
[ded6ddd] | 129 | </xsl:template>
|
---|
[0c43171] | 130 |
|
---|
[a9e89d0] | 131 | <!-- Targets titles and bookmarks-->
|
---|
[0c43171] | 132 | <xsl:template name="reference">
|
---|
| 133 | <xsl:param name="scope" select="."/>
|
---|
| 134 | <xsl:param name="zones"/>
|
---|
| 135 | <xsl:choose>
|
---|
| 136 | <xsl:when test="contains($zones, ' ')">
|
---|
| 137 | <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
|
---|
| 138 | <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
|
---|
| 139 | <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
|
---|
| 140 | <xsl:variable name="target2" select="key('id', $zone2)[&scope;]"/>
|
---|
| 141 | <xsl:variable name="id">
|
---|
| 142 | <xsl:call-template name="object.id">
|
---|
| 143 | <xsl:with-param name="object" select="$target[1]"/>
|
---|
| 144 | </xsl:call-template>
|
---|
| 145 | </xsl:variable>
|
---|
| 146 | <xsl:variable name="id2">
|
---|
| 147 | <xsl:call-template name="object.id">
|
---|
| 148 | <xsl:with-param name="object" select="$target2[1]"/>
|
---|
| 149 | </xsl:call-template>
|
---|
| 150 | </xsl:variable>
|
---|
[ded6ddd] | 151 | <fo:table-cell>
|
---|
[a9e89d0] | 152 | <fo:block>
|
---|
[ded6ddd] | 153 | <fo:basic-link internal-destination="{$id}">
|
---|
| 154 | <xsl:value-of select="$target/title"/>
|
---|
| 155 | <xsl:apply-templates select="$target" mode="page.citation">
|
---|
| 156 | <xsl:with-param name="id" select="$id"/>
|
---|
| 157 | </xsl:apply-templates>
|
---|
| 158 | </fo:basic-link>
|
---|
[a9e89d0] | 159 | </fo:block>
|
---|
| 160 | </fo:table-cell>
|
---|
[ded6ddd] | 161 | <fo:table-cell>
|
---|
[a9e89d0] | 162 | <fo:block>
|
---|
[ded6ddd] | 163 | <fo:basic-link internal-destination="{$id2}">
|
---|
| 164 | <xsl:text>description</xsl:text>
|
---|
| 165 | <xsl:apply-templates select="$target2" mode="page.citation">
|
---|
| 166 | <xsl:with-param name="id" select="$id2"/>
|
---|
| 167 | </xsl:apply-templates>
|
---|
| 168 | </fo:basic-link>
|
---|
[a9e89d0] | 169 | </fo:block>
|
---|
| 170 | </fo:table-cell>
|
---|
[0c43171] | 171 | </xsl:when>
|
---|
| 172 | <xsl:otherwise>
|
---|
| 173 | <xsl:variable name="zone" select="$zones"/>
|
---|
| 174 | <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
|
---|
| 175 | <xsl:variable name="id">
|
---|
| 176 | <xsl:call-template name="object.id">
|
---|
| 177 | <xsl:with-param name="object" select="$target[1]"/>
|
---|
| 178 | </xsl:call-template>
|
---|
| 179 | </xsl:variable>
|
---|
[ded6ddd] | 180 | <fo:table-cell>
|
---|
[a9e89d0] | 181 | <fo:block>
|
---|
[ded6ddd] | 182 | <fo:basic-link internal-destination="{$id}">
|
---|
| 183 | <xsl:value-of select="$target/title"/>
|
---|
| 184 | <xsl:apply-templates select="$target" mode="page.citation">
|
---|
| 185 | <xsl:with-param name="id" select="$id"/>
|
---|
| 186 | </xsl:apply-templates>
|
---|
| 187 | </fo:basic-link>
|
---|
[a9e89d0] | 188 | </fo:block>
|
---|
| 189 | </fo:table-cell>
|
---|
[0c43171] | 190 | </xsl:otherwise>
|
---|
| 191 | </xsl:choose>
|
---|
| 192 | </xsl:template>
|
---|
| 193 |
|
---|
| 194 | </xsl:stylesheet>
|
---|