Ignore:
Timestamp:
10/08/2013 08:03:29 PM (11 years ago)
Author:
Matthew Burgess <matthew@…>
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
Message:

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/docbook-xsl-1.78.1/common/titles.xsl

    r09a35dd r15c7d39  
    22<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    33                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
     4                xmlns:xlink="http://www.w3.org/1999/xlink"
    45                exclude-result-prefixes="doc"
    56                version='1.0'>
    67
    78<!-- ********************************************************************
    8      $Id$
     9     $Id: titles.xsl 9715 2013-01-24 00:16:57Z bobstayton $
    910     ********************************************************************
    1011
     
    3637    <!-- * but this is good enough for now. -->
    3738    <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">
    3940        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
    4041      </xsl:apply-templates>
     
    6162              <xsl:text>")</xsl:text>
    6263            </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>
    6373          </xsl:choose>
    6474        </xsl:message>
     
    145155  <xsl:param name="allow-anchors" select="0"/>
    146156  <xsl:choose>
    147     <xsl:when test="title">
     157    <xsl:when test="title|info/title">
    148158      <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
    149159        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
     
    158168</xsl:template>
    159169
     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
    160186<xsl:template match="colophon" mode="title.markup">
    161187  <xsl:param name="allow-anchors" select="0"/>
    162188  <xsl:choose>
    163     <xsl:when test="title">
     189    <xsl:when test="title|info/title">
    164190      <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
    165191        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
     
    235261                     |sect1|sect2|sect3|sect4|sect5
    236262                     |refsect1|refsect2|refsect3|refsection
     263                     |topic
    237264                     |simplesect"
    238265              mode="title.markup">
     
    257284
    258285<xsl:template match="bridgehead" mode="title.markup">
    259   <xsl:apply-templates mode="title.markup"/>
     286  <xsl:apply-templates/>
    260287</xsl:template>
    261288
     
    263290  <xsl:param name="allow-anchors" select="0"/>
    264291  <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">
    267294        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
    268295      </xsl:apply-templates>
     
    332359</xsl:template>
    333360
    334 <xsl:template match="glossterm" mode="title.markup">
     361<xsl:template match="glossterm|firstterm" mode="title.markup">
    335362  <xsl:param name="allow-anchors" select="0"/>
    336363
     
    381408<xsl:template match="figure|example|equation" mode="title.markup">
    382409  <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">
    384411    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
    385412  </xsl:apply-templates>
     
    388415<xsl:template match="table" mode="title.markup">
    389416  <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">
    391418    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
    392419  </xsl:apply-templates>
     
    395422<xsl:template match="procedure" mode="title.markup">
    396423  <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">
    398425    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
    399426  </xsl:apply-templates>
     
    402429<xsl:template match="task" mode="title.markup">
    403430  <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">
    405432    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
    406433  </xsl:apply-templates>
     
    493520  <xsl:param name="allow-anchors" select="0"/>
    494521  <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">
    497524        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
    498525      </xsl:apply-templates>
     
    507534
    508535<!-- ============================================================ -->
     536
     537<!-- titleabbrev is always processed in a mode -->
     538<xsl:template match="titleabbrev"/>
    509539
    510540<xsl:template match="*" mode="titleabbrev.markup">
     
    518548      </xsl:apply-templates>
    519549    </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>
    520555    <xsl:otherwise>
    521556      <xsl:apply-templates select="." mode="title.markup">
     
    527562</xsl:template>
    528563
    529 <xsl:template match="book|preface|chapter|appendix" mode="titleabbrev.markup">
     564<xsl:template match="book|part|set|preface|chapter|appendix" mode="titleabbrev.markup">
    530565  <xsl:param name="allow-anchors" select="0"/>
    531566  <xsl:param name="verbose" select="1"/>
     
    535570                                           |info/titleabbrev
    536571                                           |prefaceinfo/titleabbrev
     572                                           |setinfo/titleabbrev
     573                                           |partinfo/titleabbrev
    537574                                           |chapterinfo/titleabbrev
    538575                                           |appendixinfo/titleabbrev
     
    581618                     |sect1|sect2|sect3|sect4|sect5
    582619                     |refsect1|refsect2|refsect3
     620                     |topic
    583621                     |simplesect"
    584622              mode="titleabbrev.markup">
     
    637675                    descendant-or-self::olink or
    638676                    descendant-or-self::xref or
    639                     descendant-or-self::indexterm">
     677                    descendant-or-self::indexterm or
     678                    (ancestor::title and (@id or @xml:id))">
    640679
    641680      <xsl:apply-templates mode="no.anchor.mode"/>
     
    660699
    661700<xsl:template match="link" mode="no.anchor.mode">
    662   <xsl:apply-templates/>
     701  <xsl:choose>
     702    <xsl:when test="count(child::node()) &gt; 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>
    663728</xsl:template>
    664729
     
    672737
    673738<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,'#'))"/>
    675740  <xsl:variable name="target" select="$targets[1]"/>
    676741  <xsl:variable name="refelem" select="local-name($target)"/>
     
    684749      <xsl:message>
    685750        <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"/>
    687753      </xsl:message>
    688754      <xsl:text>???</xsl:text>
     
    714780
    715781    <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
    735816</xsl:template>
    736817
Note: See TracChangeset for help on using the changeset viewer.