- Timestamp:
- 10/08/2013 08:03:29 PM (11 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 58675ce
- Parents:
- 09a35dd
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/lfs-xsl/docbook-xsl-1.78.1/common/titles.xsl
r09a35dd r15c7d39 2 2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 3 3 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" 4 xmlns:xlink="http://www.w3.org/1999/xlink" 4 5 exclude-result-prefixes="doc" 5 6 version='1.0'> 6 7 7 8 <!-- ******************************************************************** 8 $Id $9 $Id: titles.xsl 9715 2013-01-24 00:16:57Z bobstayton $ 9 10 ******************************************************************** 10 11 … … 36 37 <!-- * but this is good enough for now. --> 37 38 <xsl:when test="title|info/title"> 38 <xsl:apply-templates select=" title[1]|info/title[1]" mode="title.markup">39 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 39 40 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 40 41 </xsl:apply-templates> … … 61 62 <xsl:text>")</xsl:text> 62 63 </xsl:when> 64 <xsl:otherwise> 65 <xsl:text> (contained in </xsl:text> 66 <xsl:value-of select="local-name(..)"/> 67 <xsl:if test="../@id or ../@xml:id"> 68 <xsl:text> with id </xsl:text> 69 <xsl:value-of select="../@id | ../@xml:id"/> 70 </xsl:if> 71 <xsl:text>)</xsl:text> 72 </xsl:otherwise> 63 73 </xsl:choose> 64 74 </xsl:message> … … 145 155 <xsl:param name="allow-anchors" select="0"/> 146 156 <xsl:choose> 147 <xsl:when test="title ">157 <xsl:when test="title|info/title"> 148 158 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 149 159 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> … … 158 168 </xsl:template> 159 169 170 <xsl:template match="acknowledgements" mode="title.markup"> 171 <xsl:param name="allow-anchors" select="0"/> 172 <xsl:choose> 173 <xsl:when test="title|info/title"> 174 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 175 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 176 </xsl:apply-templates> 177 </xsl:when> 178 <xsl:otherwise> 179 <xsl:call-template name="gentext"> 180 <xsl:with-param name="key" select="'Acknowledgements'"/> 181 </xsl:call-template> 182 </xsl:otherwise> 183 </xsl:choose> 184 </xsl:template> 185 160 186 <xsl:template match="colophon" mode="title.markup"> 161 187 <xsl:param name="allow-anchors" select="0"/> 162 188 <xsl:choose> 163 <xsl:when test="title ">189 <xsl:when test="title|info/title"> 164 190 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 165 191 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> … … 235 261 |sect1|sect2|sect3|sect4|sect5 236 262 |refsect1|refsect2|refsect3|refsection 263 |topic 237 264 |simplesect" 238 265 mode="title.markup"> … … 257 284 258 285 <xsl:template match="bridgehead" mode="title.markup"> 259 <xsl:apply-templates mode="title.markup"/>286 <xsl:apply-templates/> 260 287 </xsl:template> 261 288 … … 263 290 <xsl:param name="allow-anchors" select="0"/> 264 291 <xsl:choose> 265 <xsl:when test="title ">266 <xsl:apply-templates select=" title" mode="title.markup">292 <xsl:when test="title|info/title"> 293 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 267 294 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 268 295 </xsl:apply-templates> … … 332 359 </xsl:template> 333 360 334 <xsl:template match="glossterm " mode="title.markup">361 <xsl:template match="glossterm|firstterm" mode="title.markup"> 335 362 <xsl:param name="allow-anchors" select="0"/> 336 363 … … 381 408 <xsl:template match="figure|example|equation" mode="title.markup"> 382 409 <xsl:param name="allow-anchors" select="0"/> 383 <xsl:apply-templates select=" title|info/title" mode="title.markup">410 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 384 411 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 385 412 </xsl:apply-templates> … … 388 415 <xsl:template match="table" mode="title.markup"> 389 416 <xsl:param name="allow-anchors" select="0"/> 390 <xsl:apply-templates select="(title| caption)[1]" mode="title.markup">417 <xsl:apply-templates select="(title|info/title|caption)[1]" mode="title.markup"> 391 418 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 392 419 </xsl:apply-templates> … … 395 422 <xsl:template match="procedure" mode="title.markup"> 396 423 <xsl:param name="allow-anchors" select="0"/> 397 <xsl:apply-templates select=" title" mode="title.markup">424 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 398 425 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 399 426 </xsl:apply-templates> … … 402 429 <xsl:template match="task" mode="title.markup"> 403 430 <xsl:param name="allow-anchors" select="0"/> 404 <xsl:apply-templates select=" title" mode="title.markup">431 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 405 432 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 406 433 </xsl:apply-templates> … … 493 520 <xsl:param name="allow-anchors" select="0"/> 494 521 <xsl:choose> 495 <xsl:when test="title ">496 <xsl:apply-templates select=" title" mode="title.markup">522 <xsl:when test="title|info/title"> 523 <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup"> 497 524 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 498 525 </xsl:apply-templates> … … 507 534 508 535 <!-- ============================================================ --> 536 537 <!-- titleabbrev is always processed in a mode --> 538 <xsl:template match="titleabbrev"/> 509 539 510 540 <xsl:template match="*" mode="titleabbrev.markup"> … … 518 548 </xsl:apply-templates> 519 549 </xsl:when> 550 <xsl:when test="info/titleabbrev"> 551 <xsl:apply-templates select="info/titleabbrev[1]" mode="title.markup"> 552 <xsl:with-param name="allow-anchors" select="$allow-anchors"/> 553 </xsl:apply-templates> 554 </xsl:when> 520 555 <xsl:otherwise> 521 556 <xsl:apply-templates select="." mode="title.markup"> … … 527 562 </xsl:template> 528 563 529 <xsl:template match="book|p reface|chapter|appendix" mode="titleabbrev.markup">564 <xsl:template match="book|part|set|preface|chapter|appendix" mode="titleabbrev.markup"> 530 565 <xsl:param name="allow-anchors" select="0"/> 531 566 <xsl:param name="verbose" select="1"/> … … 535 570 |info/titleabbrev 536 571 |prefaceinfo/titleabbrev 572 |setinfo/titleabbrev 573 |partinfo/titleabbrev 537 574 |chapterinfo/titleabbrev 538 575 |appendixinfo/titleabbrev … … 581 618 |sect1|sect2|sect3|sect4|sect5 582 619 |refsect1|refsect2|refsect3 620 |topic 583 621 |simplesect" 584 622 mode="titleabbrev.markup"> … … 637 675 descendant-or-self::olink or 638 676 descendant-or-self::xref or 639 descendant-or-self::indexterm"> 677 descendant-or-self::indexterm or 678 (ancestor::title and (@id or @xml:id))"> 640 679 641 680 <xsl:apply-templates mode="no.anchor.mode"/> … … 660 699 661 700 <xsl:template match="link" mode="no.anchor.mode"> 662 <xsl:apply-templates/> 701 <xsl:choose> 702 <xsl:when test="count(child::node()) > 0"> 703 <!-- If it has content, use it --> 704 <xsl:apply-templates/> 705 </xsl:when> 706 <!-- look for an endterm --> 707 <xsl:when test="@endterm"> 708 <xsl:variable name="etargets" select="key('id',@endterm)"/> 709 <xsl:variable name="etarget" select="$etargets[1]"/> 710 <xsl:choose> 711 <xsl:when test="count($etarget) = 0"> 712 <xsl:message> 713 <xsl:value-of select="count($etargets)"/> 714 <xsl:text>Endterm points to nonexistent ID: </xsl:text> 715 <xsl:value-of select="@endterm"/> 716 </xsl:message> 717 <xsl:text>???</xsl:text> 718 </xsl:when> 719 <xsl:otherwise> 720 <xsl:apply-templates select="$etarget" mode="endterm"/> 721 </xsl:otherwise> 722 </xsl:choose> 723 </xsl:when> 724 <xsl:otherwise> 725 <xsl:apply-templates/> 726 </xsl:otherwise> 727 </xsl:choose> 663 728 </xsl:template> 664 729 … … 672 737 673 738 <xsl:template match="xref" mode="no.anchor.mode"> 674 <xsl:variable name="targets" select="key('id',@linkend) "/>739 <xsl:variable name="targets" select="key('id',@linkend)|key('id',substring-after(@xlink:href,'#'))"/> 675 740 <xsl:variable name="target" select="$targets[1]"/> 676 741 <xsl:variable name="refelem" select="local-name($target)"/> … … 684 749 <xsl:message> 685 750 <xsl:text>XRef to nonexistent id: </xsl:text> 686 <xsl:value-of select="@linkend"/> 751 <xsl:value-of select="@linkend"/> 752 <xsl:value-of select="@xlink:href"/> 687 753 </xsl:message> 688 754 <xsl:text>???</xsl:text> … … 714 780 715 781 <xsl:otherwise> 716 <xsl:apply-templates select="$target" mode="xref-to-prefix"/> 717 718 <xsl:apply-templates select="$target" mode="xref-to"> 719 <xsl:with-param name="referrer" select="."/> 720 <xsl:with-param name="xrefstyle"> 721 <xsl:choose> 722 <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0"> 723 <xsl:value-of select="@role"/> 724 </xsl:when> 725 <xsl:otherwise> 726 <xsl:value-of select="@xrefstyle"/> 727 </xsl:otherwise> 728 </xsl:choose> 729 </xsl:with-param> 730 </xsl:apply-templates> 731 732 <xsl:apply-templates select="$target" mode="xref-to-suffix"/> 733 </xsl:otherwise> 734 </xsl:choose> 782 783 <xsl:choose> 784 <!-- Watch out for the case when there is a xref or link inside 785 a title. See bugs #1811721 and #1838136. --> 786 <xsl:when test="not(ancestor::*[@id = $target/@id] or ancestor::*[@xml:id = $target/@xml:id])"> 787 788 <xsl:apply-templates select="$target" mode="xref-to-prefix"/> 789 790 <xsl:apply-templates select="$target" mode="xref-to"> 791 792 <xsl:with-param name="referrer" select="."/> 793 <xsl:with-param name="xrefstyle"> 794 <xsl:choose> 795 <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0"> 796 <xsl:value-of select="@role"/> 797 </xsl:when> 798 <xsl:otherwise> 799 <xsl:value-of select="@xrefstyle"/> 800 </xsl:otherwise> 801 </xsl:choose> 802 </xsl:with-param> 803 </xsl:apply-templates> 804 805 <xsl:apply-templates select="$target" mode="xref-to-suffix"/> 806 </xsl:when> 807 808 <xsl:otherwise> 809 <xsl:apply-templates/> 810 </xsl:otherwise> 811 812 </xsl:choose> 813 </xsl:otherwise> 814 </xsl:choose> 815 735 816 </xsl:template> 736 817
Note:
See TracChangeset
for help on using the changeset viewer.