Changeset 8054

Show
Ignore:
Timestamp:
04/15/07 15:44:45 (2 years ago)
Author:
manuel
Message:

Skip dummy sect1 from navigational links.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/new-xsl/xhtml/lfs-navigational.xsl

    r8028 r8054  
    9090               (it content is displayed when placing the mouse over the link) 
    9191             For "Prev" and "Next" links, added the target title under it. 
    92              When "Next" target is the Index, added gettext support for the 
    93                Index title. --> 
     92             When "Next" target is the Index, added gentext support for the 
     93               Index title. 
     94             Skip links to dummy sect1. --> 
    9495  <xsl:template name="navigational.links"> 
    9596    <xsl:param name="prev"/> 
     
    100101      <xsl:if test="count($prev)&gt;0 and $prev != $home"> 
    101102        <li class="prev"> 
    102           <a accesskey="p"> 
    103             <xsl:attribute name="href"> 
    104               <xsl:call-template name="href.target"> 
    105                 <xsl:with-param name="object" select="$prev"/> 
    106               </xsl:call-template> 
    107             </xsl:attribute> 
    108             <xsl:attribute name="title"> 
    109               <xsl:value-of select="$prev/title"/> 
    110             </xsl:attribute> 
    111             <xsl:call-template name="navig.content"> 
    112               <xsl:with-param name="direction" select="'prev'"/> 
    113             </xsl:call-template> 
    114           </a> 
    115           <p> 
    116             <xsl:value-of select="$prev/title"/> 
    117           </p> 
     103          <xsl:choose> 
     104            <xsl:when test="$prev[@role='dummy'] and 
     105                            count(preceding-sibling::sect1)=1"> 
     106              <a accesskey="p"> 
     107                <xsl:attribute name="href"> 
     108                  <xsl:call-template name="href.target"> 
     109                    <xsl:with-param name="object" select=".."/> 
     110                  </xsl:call-template> 
     111                </xsl:attribute> 
     112                <xsl:attribute name="title"> 
     113                  <xsl:value-of select="../title"/> 
     114                </xsl:attribute> 
     115                <xsl:call-template name="navig.content"> 
     116                  <xsl:with-param name="direction" select="'prev'"/> 
     117                </xsl:call-template> 
     118              </a> 
     119              <p> 
     120                <xsl:value-of select="../title"/> 
     121              </p> 
     122            </xsl:when> 
     123            <xsl:when test="$prev[@role='dummy'] and 
     124                            count(preceding-sibling::sect1)&gt;1"> 
     125              <a accesskey="p"> 
     126                <xsl:attribute name="href"> 
     127                  <xsl:call-template name="href.target"> 
     128                    <xsl:with-param name="object" select="preceding-sibling::sect1[position()=2]"/> 
     129                  </xsl:call-template> 
     130                </xsl:attribute> 
     131                <xsl:attribute name="title"> 
     132                  <xsl:value-of select="preceding-sibling::sect1[position()=2]/title"/> 
     133                </xsl:attribute> 
     134                <xsl:call-template name="navig.content"> 
     135                  <xsl:with-param name="direction" select="'prev'"/> 
     136                </xsl:call-template> 
     137              </a> 
     138              <p> 
     139                <xsl:value-of select="preceding-sibling::sect1[position()=2]/title"/> 
     140              </p> 
     141            </xsl:when> 
     142            <xsl:otherwise> 
     143              <a accesskey="p"> 
     144                <xsl:attribute name="href"> 
     145                  <xsl:call-template name="href.target"> 
     146                    <xsl:with-param name="object" select="$prev"/> 
     147                  </xsl:call-template> 
     148                </xsl:attribute> 
     149                <xsl:attribute name="title"> 
     150                  <xsl:value-of select="$prev/title"/> 
     151                </xsl:attribute> 
     152                <xsl:call-template name="navig.content"> 
     153                  <xsl:with-param name="direction" select="'prev'"/> 
     154                </xsl:call-template> 
     155              </a> 
     156              <p> 
     157                <xsl:value-of select="$prev/title"/> 
     158              </p> 
     159            </xsl:otherwise> 
     160          </xsl:choose> 
    118161        </li> 
    119162      </xsl:if> 
    120163      <xsl:if test="count($next)&gt;0"> 
    121164        <li class="next"> 
    122           <a accesskey="n"> 
    123             <xsl:attribute name="href"> 
    124               <xsl:call-template name="href.target"> 
    125                 <xsl:with-param name="object" select="$next"/> 
    126               </xsl:call-template> 
    127             </xsl:attribute> 
    128             <xsl:attribute name="title"> 
    129               <xsl:choose> 
    130                 <xsl:when test="local-name($next)='index'"> 
    131                   <xsl:call-template name="gentext"> 
    132                     <xsl:with-param name="key">Index</xsl:with-param> 
    133                   </xsl:call-template> 
    134                 </xsl:when> 
    135                 <xsl:otherwise> 
    136                   <xsl:value-of select="$next/title"/> 
    137                 </xsl:otherwise> 
    138               </xsl:choose> 
    139             </xsl:attribute> 
    140             <xsl:call-template name="navig.content"> 
    141               <xsl:with-param name="direction" select="'next'"/> 
    142             </xsl:call-template> 
    143           </a> 
    144           <p> 
    145             <xsl:choose> 
    146               <xsl:when test="local-name($next)='index'"> 
    147                 <xsl:call-template name="gentext"> 
    148                   <xsl:with-param name="key">Index</xsl:with-param> 
    149                 </xsl:call-template> 
    150               </xsl:when> 
    151               <xsl:otherwise> 
    152                 <xsl:value-of select="$next/title"/> 
    153               </xsl:otherwise> 
    154             </xsl:choose> 
    155           </p> 
     165          <xsl:choose> 
     166            <xsl:when test="$next[@role='dummy'] and local-name(.) = 'sect1'"> 
     167              <a accesskey="n"> 
     168                <xsl:attribute name="href"> 
     169                  <xsl:call-template name="href.target"> 
     170                    <xsl:with-param name="object" select="following-sibling::sect1[position()=2]"/> 
     171                  </xsl:call-template> 
     172                </xsl:attribute> 
     173                <xsl:attribute name="title"> 
     174                  <xsl:value-of select="following-sibling::sect1[position()=2]/title"/> 
     175                </xsl:attribute> 
     176                <xsl:call-template name="navig.content"> 
     177                  <xsl:with-param name="direction" select="'next'"/> 
     178                </xsl:call-template> 
     179              </a> 
     180              <p> 
     181                <xsl:value-of select="following-sibling::sect1[position()=2]/title"/> 
     182              </p> 
     183            </xsl:when> 
     184            <xsl:when test="$next[@role='dummy'] and local-name(.) = 'chapter'"> 
     185              <a accesskey="n"> 
     186                <xsl:attribute name="href"> 
     187                  <xsl:call-template name="href.target"> 
     188                    <xsl:with-param name="object" select="descendant::sect1[position()=2]"/> 
     189                  </xsl:call-template> 
     190                </xsl:attribute> 
     191                <xsl:attribute name="title"> 
     192                  <xsl:value-of select="descendant::sect1[position()=2]/title"/> 
     193                </xsl:attribute> 
     194                <xsl:call-template name="navig.content"> 
     195                  <xsl:with-param name="direction" select="'next'"/> 
     196                </xsl:call-template> 
     197              </a> 
     198              <p> 
     199                <xsl:value-of select="descendant::sect1[position()=2]/title"/> 
     200              </p> 
     201            </xsl:when> 
     202            <xsl:otherwise> 
     203              <a accesskey="n"> 
     204                <xsl:attribute name="href"> 
     205                  <xsl:call-template name="href.target"> 
     206                    <xsl:with-param name="object" select="$next"/> 
     207                  </xsl:call-template> 
     208                </xsl:attribute> 
     209                <xsl:attribute name="title"> 
     210                  <xsl:choose> 
     211                    <xsl:when test="local-name($next)='index'"> 
     212                      <xsl:call-template name="gentext"> 
     213                        <xsl:with-param name="key">Index</xsl:with-param> 
     214                      </xsl:call-template> 
     215                    </xsl:when> 
     216                    <xsl:otherwise> 
     217                      <xsl:value-of select="$next/title"/> 
     218                    </xsl:otherwise> 
     219                  </xsl:choose> 
     220                </xsl:attribute> 
     221                <xsl:call-template name="navig.content"> 
     222                  <xsl:with-param name="direction" select="'next'"/> 
     223                </xsl:call-template> 
     224              </a> 
     225              <p> 
     226                <xsl:choose> 
     227                  <xsl:when test="local-name($next)='index'"> 
     228                    <xsl:call-template name="gentext"> 
     229                      <xsl:with-param name="key">Index</xsl:with-param> 
     230                    </xsl:call-template> 
     231                  </xsl:when> 
     232                  <xsl:otherwise> 
     233                    <xsl:value-of select="$next/title"/> 
     234                  </xsl:otherwise> 
     235                </xsl:choose> 
     236              </p> 
     237            </xsl:otherwise> 
     238          </xsl:choose> 
    156239        </li> 
    157240      </xsl:if>