- Timestamp:
- 12/10/2013 11:37:38 PM (11 years ago)
- Branches:
- 7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
- Children:
- 112db9d
- Parents:
- f2a5108
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/lfs-xsl/docbook-xsl-1.78.1/html/glossary.xsl
rf2a5108 rb1a51ac1 1 <?xml version="1.0" encoding="ASCII"?> 2 <!--This file was created automatically by html2xhtml--> 3 <!--from the HTML stylesheets.--> 4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0"> 1 <?xml version='1.0'?> 2 <!DOCTYPE xsl:stylesheet [ 3 <!ENTITY % common.entities SYSTEM "../common/entities.ent"> 4 %common.entities; 5 ]> 6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 7 xmlns:xlink='http://www.w3.org/1999/xlink' 8 exclude-result-prefixes="xlink" 9 version='1.0'> 5 10 6 11 <!-- ******************************************************************** 7 $Id $12 $Id: glossary.xsl 9709 2013-01-22 18:56:09Z bobstayton $ 8 13 ******************************************************************** 9 14 … … 17 22 18 23 <xsl:template match="glossary"> 19 20 <xsl:variable name="language"> 21 <xsl:call-template name="l10n.language"/> 22 </xsl:variable> 23 24 <xsl:variable name="lowercase"> 25 <xsl:call-template name="gentext"> 26 <xsl:with-param name="key">normalize.sort.input</xsl:with-param> 27 </xsl:call-template> 28 </xsl:variable> 29 30 <xsl:variable name="uppercase"> 31 <xsl:call-template name="gentext"> 32 <xsl:with-param name="key">normalize.sort.output</xsl:with-param> 33 </xsl:call-template> 34 </xsl:variable> 35 24 &setup-language-variable; 36 25 <xsl:call-template name="id.warning"/> 37 26 38 <div> 39 <xsl:apply-templates select="." mode="class.attribute"/> 40 <xsl:if test="$generate.id.attributes != 0"> 41 <xsl:attribute name="id"> 42 <xsl:call-template name="object.id"/> 43 </xsl:attribute> 44 </xsl:if> 27 <xsl:element name="{$div.element}"> 28 <xsl:apply-templates select="." mode="common.html.attributes"/> 29 <xsl:call-template name="id.attribute"> 30 <xsl:with-param name="conditional" select="0"/> 31 </xsl:call-template> 45 32 46 33 <xsl:call-template name="glossary.titlepage"/> … … 67 54 <xsl:when test="$glossary.sort != 0"> 68 55 <xsl:apply-templates select="glossentry"> 69 <xsl:sort lang="{$language}" select="translate(glossterm, $lowercase, $uppercase)"/>56 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/> 70 57 </xsl:apply-templates> 71 58 </xsl:when> … … 84 71 <xsl:call-template name="process.footnotes"/> 85 72 </xsl:if> 86 </ div>87 </xsl:template> 88 89 <xsl:template match="glossary/glossaryinfo" />90 <xsl:template match="glossary/info" />91 <xsl:template match="glossary/title" />92 <xsl:template match="glossary/subtitle" />93 <xsl:template match="glossary/titleabbrev" />73 </xsl:element> 74 </xsl:template> 75 76 <xsl:template match="glossary/glossaryinfo"></xsl:template> 77 <xsl:template match="glossary/info"></xsl:template> 78 <xsl:template match="glossary/title"></xsl:template> 79 <xsl:template match="glossary/subtitle"></xsl:template> 80 <xsl:template match="glossary/titleabbrev"></xsl:template> 94 81 95 82 <!-- ==================================================================== --> 96 83 97 84 <xsl:template match="glosslist"> 98 99 <xsl:variable name="language"> 100 <xsl:call-template name="l10n.language"/> 101 </xsl:variable> 102 103 <xsl:variable name="lowercase"> 104 <xsl:call-template name="gentext"> 105 <xsl:with-param name="key">normalize.sort.input</xsl:with-param> 106 </xsl:call-template> 107 </xsl:variable> 108 109 <xsl:variable name="uppercase"> 110 <xsl:call-template name="gentext"> 111 <xsl:with-param name="key">normalize.sort.output</xsl:with-param> 112 </xsl:call-template> 113 </xsl:variable> 114 85 &setup-language-variable; 115 86 <div> 116 <xsl:apply-templates select="." mode="class.attribute"/> 87 <xsl:apply-templates select="." mode="common.html.attributes"/> 88 <xsl:call-template name="id.attribute"/> 117 89 <xsl:call-template name="anchor"/> 118 90 <xsl:if test="blockinfo/title|info/title|title"> … … 123 95 <xsl:when test="$glossary.sort != 0"> 124 96 <xsl:apply-templates select="glossentry"> 125 <xsl:sort lang="{$language}" select="translate(glossterm, $lowercase, $uppercase)"/>97 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/> 126 98 </xsl:apply-templates> 127 99 </xsl:when> … … 137 109 138 110 <xsl:template match="glossdiv"> 139 140 <xsl:variable name="language"> 141 <xsl:call-template name="l10n.language"/> 142 </xsl:variable> 143 144 <xsl:variable name="lowercase"> 145 <xsl:call-template name="gentext"> 146 <xsl:with-param name="key">normalize.sort.input</xsl:with-param> 147 </xsl:call-template> 148 </xsl:variable> 149 150 <xsl:variable name="uppercase"> 151 <xsl:call-template name="gentext"> 152 <xsl:with-param name="key">normalize.sort.output</xsl:with-param> 153 </xsl:call-template> 154 </xsl:variable> 155 111 &setup-language-variable; 156 112 <xsl:call-template name="id.warning"/> 157 113 158 114 <div> 159 <xsl:apply-templates select="." mode="class.attribute"/> 115 <xsl:apply-templates select="." mode="common.html.attributes"/> 116 <xsl:call-template name="id.attribute"> 117 <xsl:with-param name="conditional" select="0"/> 118 </xsl:call-template> 160 119 <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/> 161 120 … … 164 123 <xsl:when test="$glossary.sort != 0"> 165 124 <xsl:apply-templates select="glossentry"> 166 <xsl:sort lang="{$language}" select="translate(glossterm, $lowercase, $uppercase)"/> 125 <xsl:sort lang="{$language}" 126 select="translate(glossterm, $lowercase, 127 $uppercase)"/> 167 128 </xsl:apply-templates> 168 129 </xsl:when> … … 177 138 <xsl:template match="glossdiv/title"> 178 139 <h3> 179 <xsl:apply-templates select="." mode="c lass.attribute"/>140 <xsl:apply-templates select="." mode="common.html.attributes"/> 180 141 <xsl:apply-templates/> 181 142 </h3> … … 196 157 <xsl:when test="$glossentry.show.acronym = 'primary'"> 197 158 <dt> 159 <xsl:call-template name="id.attribute"> 160 <xsl:with-param name="conditional"> 161 <xsl:choose> 162 <xsl:when test="$glossterm.auto.link != 0">0</xsl:when> 163 <xsl:otherwise>1</xsl:otherwise> 164 </xsl:choose> 165 </xsl:with-param> 166 </xsl:call-template> 198 167 <xsl:call-template name="anchor"> 199 168 <xsl:with-param name="conditional"> … … 220 189 <xsl:when test="$glossentry.show.acronym = 'yes'"> 221 190 <dt> 191 <xsl:call-template name="id.attribute"> 192 <xsl:with-param name="conditional"> 193 <xsl:choose> 194 <xsl:when test="$glossterm.auto.link != 0">0</xsl:when> 195 <xsl:otherwise>1</xsl:otherwise> 196 </xsl:choose> 197 </xsl:with-param> 198 </xsl:call-template> 222 199 <xsl:call-template name="anchor"> 223 200 <xsl:with-param name="conditional"> … … 240 217 <xsl:otherwise> 241 218 <dt> 219 <xsl:call-template name="id.attribute"> 220 <xsl:with-param name="conditional"> 221 <xsl:choose> 222 <xsl:when test="$glossterm.auto.link != 0">0</xsl:when> 223 <xsl:otherwise>1</xsl:otherwise> 224 </xsl:choose> 225 </xsl:with-param> 226 </xsl:call-template> 242 227 <xsl:call-template name="anchor"> 243 228 <xsl:with-param name="conditional"> … … 258 243 259 244 <xsl:template match="glossentry/glossterm"> 260 <xsl:apply-templates/> 245 <span> 246 <xsl:apply-templates select="." mode="common.html.attributes"/> 247 <xsl:call-template name="id.attribute"/> 248 <xsl:call-template name="anchor"/> 249 <xsl:apply-templates/> 250 </span> 261 251 <xsl:if test="following-sibling::glossterm">, </xsl:if> 262 252 </xsl:template> … … 279 269 <xsl:variable name="targets" select="key('id', $otherterm)"/> 280 270 <xsl:variable name="target" select="$targets[1]"/> 271 <xsl:variable name="xlink" select="@xlink:href"/> 281 272 282 273 <dd> … … 293 284 <xsl:when test="$target"> 294 285 <a> 295 <xsl:apply-templates select="." mode="class.attribute"/> 286 <xsl:apply-templates select="." mode="common.html.attributes"/> 287 <xsl:call-template name="id.attribute"/> 296 288 <xsl:attribute name="href"> 297 289 <xsl:call-template name="href.target"> … … 301 293 <xsl:apply-templates select="$target" mode="xref-to"/> 302 294 </a> 295 </xsl:when> 296 <xsl:when test="$xlink"> 297 <xsl:call-template name="simple.xlink"> 298 <xsl:with-param name="content"> 299 <xsl:apply-templates/> 300 </xsl:with-param> 301 </xsl:call-template> 303 302 </xsl:when> 304 303 <xsl:when test="$otherterm != '' and not($target)"> … … 319 318 <xsl:with-param name="title" select="$title"/> 320 319 </xsl:call-template> 321 <xsl:text>.</xsl:text>322 320 </p> 323 321 </dd> … … 326 324 <xsl:template match="glossentry/glossdef"> 327 325 <dd> 326 <xsl:apply-templates select="." mode="common.html.attributes"/> 327 <xsl:call-template name="id.attribute"/> 328 <xsl:call-template name="anchor"/> 328 329 <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/> 329 330 <xsl:if test="glossseealso"> … … 351 352 <xsl:variable name="targets" select="key('id', $otherterm)"/> 352 353 <xsl:variable name="target" select="$targets[1]"/> 354 <xsl:variable name="xlink" select="@xlink:href"/> 353 355 354 356 <xsl:choose> 355 357 <xsl:when test="$target"> 356 358 <a> 357 <xsl:apply-templates select="." mode="class.attribute"/> 359 <xsl:apply-templates select="." mode="common.html.attributes"/> 360 <xsl:call-template name="id.attribute"/> 358 361 <xsl:attribute name="href"> 359 362 <xsl:call-template name="href.target"> … … 363 366 <xsl:apply-templates select="$target" mode="xref-to"/> 364 367 </a> 368 </xsl:when> 369 <xsl:when test="$xlink"> 370 <xsl:call-template name="simple.xlink"> 371 <xsl:with-param name="content"> 372 <xsl:apply-templates/> 373 </xsl:with-param> 374 </xsl:call-template> 365 375 </xsl:when> 366 376 <xsl:when test="$otherterm != '' and not($target)"> … … 377 387 378 388 <xsl:choose> 379 <xsl:when test="position() = last()"> 380 <xsl:text>.</xsl:text> 381 </xsl:when> 389 <xsl:when test="position() = last()"/> 382 390 <xsl:otherwise> 383 <xsl:text>, </xsl:text> 391 <xsl:call-template name="gentext.template"> 392 <xsl:with-param name="context" select="'glossary'"/> 393 <xsl:with-param name="name" select="'seealso-separator'"/> 394 </xsl:call-template> 384 395 </xsl:otherwise> 385 396 </xsl:choose> … … 391 402 392 403 <xsl:template match="glossary[@role='auto']" priority="2"> 393 394 <xsl:variable name="language"> 395 <xsl:call-template name="l10n.language"/> 396 </xsl:variable> 397 398 <xsl:variable name="lowercase"> 399 <xsl:call-template name="gentext"> 400 <xsl:with-param name="key">normalize.sort.input</xsl:with-param> 401 </xsl:call-template> 402 </xsl:variable> 403 404 <xsl:variable name="uppercase"> 405 <xsl:call-template name="gentext"> 406 <xsl:with-param name="key">normalize.sort.output</xsl:with-param> 407 </xsl:call-template> 408 </xsl:variable> 409 410 <xsl:variable name="terms" select="//glossterm[not(parent::glossdef)]|//firstterm"/> 404 &setup-language-variable; 405 <xsl:variable name="terms" 406 select="//glossterm[not(parent::glossdef)]|//firstterm"/> 411 407 <xsl:variable name="collection" select="document($glossary.collection, .)"/> 412 408 … … 430 426 431 427 <div> 432 <xsl:apply-templates select="." mode="class.attribute"/> 433 <xsl:if test="$generate.id.attributes != 0"> 434 <xsl:attribute name="id"> 435 <xsl:call-template name="object.id"/> 436 </xsl:attribute> 437 </xsl:if> 428 <xsl:apply-templates select="." mode="common.html.attributes"/> 429 <xsl:call-template name="id.attribute"> 430 <xsl:with-param name="conditional" select="0"/> 431 </xsl:call-template> 438 432 439 433 <xsl:call-template name="glossary.titlepage"/> … … 464 458 <xsl:when test="$glossary.sort != 0"> 465 459 <xsl:for-each select="$collection//glossentry"> 466 <xsl:sort lang="{$language}" select="translate(glossterm, $lowercase, $uppercase)"/>460 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/> 467 461 <xsl:variable name="cterm" select="glossterm"/> 468 462 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]"> … … 498 492 <xsl:param name="terms" select="."/> 499 493 500 501 <xsl:variable name="language"> 502 <xsl:call-template name="l10n.language"/> 503 </xsl:variable> 504 505 <xsl:variable name="lowercase"> 506 <xsl:call-template name="gentext"> 507 <xsl:with-param name="key">normalize.sort.input</xsl:with-param> 508 </xsl:call-template> 509 </xsl:variable> 510 511 <xsl:variable name="uppercase"> 512 <xsl:call-template name="gentext"> 513 <xsl:with-param name="key">normalize.sort.output</xsl:with-param> 514 </xsl:call-template> 515 </xsl:variable> 516 494 &setup-language-variable; 517 495 518 496 <div> 519 <xsl:apply-templates select="." mode="class.attribute"/> 497 <xsl:apply-templates select="." mode="common.html.attributes"/> 498 <xsl:call-template name="id.attribute"> 499 <xsl:with-param name="conditional" select="0"/> 500 </xsl:call-template> 520 501 <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/> 521 502 … … 524 505 <xsl:when test="$glossary.sort != 0"> 525 506 <xsl:for-each select="glossentry"> 526 <xsl:sort lang="{$language}" select="translate(glossterm, $lowercase, $uppercase)"/>507 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/> 527 508 <xsl:variable name="cterm" select="glossterm"/> 528 509 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
Note:
See TracChangeset
for help on using the changeset viewer.