Ignore:
Timestamp:
12/10/2013 11:37:38 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
Children:
112db9d
Parents:
f2a5108
Message:

Import new branch

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

File:
1 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml-1_1/footnote.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:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="exsl" version="1.0">
     1<?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="exsl" version="1.0">
    52
    63<!-- ********************************************************************
    7      $Id$
     4     $Id: footnote.xsl 9665 2012-11-08 14:26:20Z kosek $
    85     ********************************************************************
    96
     
    1411     ******************************************************************** -->
    1512
     13<!-- This template generates just the footnote marker inline.
     14The footnote text is handled in name="process.footnote".
     15The footnote marker gets an id of @id, while the
     16footnote text gets an id of #ftn.@id. They cross link to each other. -->
    1617<xsl:template match="footnote">
    1718  <xsl:variable name="name">
    18     <xsl:call-template name="object.id"/>
     19    <xsl:call-template name="object.id">
     20      <xsl:with-param name="conditional" select="0"/>
     21    </xsl:call-template>
    1922  </xsl:variable>
    2023  <xsl:variable name="href">
    2124    <xsl:text>#ftn.</xsl:text>
    22     <xsl:call-template name="object.id"/>
    23   </xsl:variable>
    24 
    25   <xsl:choose>
    26     <xsl:when test="ancestor::tgroup">
    27       <sup>
    28         <xsl:text>[</xsl:text>
    29         <a id="{$name}" href="{$href}">
    30           <xsl:apply-templates select="." mode="class.attribute"/>
    31           <xsl:apply-templates select="." mode="footnote.number"/>
    32         </a>
    33         <xsl:text>]</xsl:text>
    34       </sup>
    35     </xsl:when>
    36     <xsl:otherwise>
    37       <sup>
    38         <xsl:text>[</xsl:text>
    39         <a id="{$name}" href="{$href}">
    40           <xsl:apply-templates select="." mode="class.attribute"/>
    41           <xsl:apply-templates select="." mode="footnote.number"/>
    42         </a>
    43         <xsl:text>]</xsl:text>
    44       </sup>
    45     </xsl:otherwise>
    46   </xsl:choose>
     25    <xsl:value-of select="$name"/>
     26  </xsl:variable>
     27
     28  <a href="{$href}">
     29    <xsl:apply-templates select="." mode="class.attribute"/>
     30    <xsl:if test="$generate.id.attributes = 0">
     31      <xsl:attribute name="id">
     32        <xsl:value-of select="$name"/>
     33      </xsl:attribute>
     34    </xsl:if>
     35   
     36    <sup>
     37      <xsl:apply-templates select="." mode="class.attribute"/>
     38      <xsl:call-template name="id.attribute">
     39        <xsl:with-param name="conditional" select="0"/>
     40      </xsl:call-template>
     41      <xsl:text>[</xsl:text>
     42      <xsl:apply-templates select="." mode="footnote.number"/>
     43      <xsl:text>]</xsl:text>
     44    </sup>
     45  </a>
    4746</xsl:template>
    4847
     
    5049  <xsl:variable name="targets" select="key('id',@linkend)"/>
    5150  <xsl:variable name="footnote" select="$targets[1]"/>
     51
     52  <xsl:if test="not(local-name($footnote) = 'footnote')">
     53   <xsl:message terminate="yes">
     54ERROR: A footnoteref element has a linkend that points to an element that is not a footnote.
     55Typically this happens when an id attribute is accidentally applied to the child of a footnote element.
     56target element: <xsl:value-of select="local-name($footnote)"/>
     57linkend/id: <xsl:value-of select="@linkend"/>
     58   </xsl:message>
     59  </xsl:if>
    5260
    5361  <xsl:variable name="target.href">
     
    6371  </xsl:variable>
    6472
    65   <sup>
    66     <xsl:text>[</xsl:text>
    67     <a href="{$href}">
     73  <a href="{$href}">
     74    <xsl:apply-templates select="." mode="class.attribute"/>
     75    <xsl:call-template name="id.attribute"/>
     76    <sup>
    6877      <xsl:apply-templates select="." mode="class.attribute"/>
     78      <xsl:text>[</xsl:text>
    6979      <xsl:apply-templates select="$footnote" mode="footnote.number"/>
    70     </a>
    71     <xsl:text>]</xsl:text>
    72   </sup>
     80      <xsl:text>]</xsl:text>
     81    </sup>
     82  </a>
    7383</xsl:template>
    7484
     
    7888      <xsl:value-of select="@label"/>
    7989    </xsl:when>
    80     <xsl:when test="ancestor::tgroup">
     90    <xsl:when test="ancestor::table or ancestor::informaltable">
    8191      <xsl:variable name="tfnum">
    8292        <xsl:number level="any" from="table|informaltable" format="1"/>
     
    8898        </xsl:when>
    8999        <xsl:otherwise>
    90           <xsl:number level="any" from="tgroup" format="{$table.footnote.number.format}"/>
     100          <xsl:number level="any" from="table | informaltable" format="{$table.footnote.number.format}"/>
    91101        </xsl:otherwise>
    92102      </xsl:choose>
     
    94104    <xsl:otherwise>
    95105      <xsl:variable name="pfoot" select="preceding::footnote[not(@label)]"/>
    96       <xsl:variable name="ptfoot" select="preceding::tgroup//footnote"/>
     106      <xsl:variable name="ptfoot" select="preceding::table//footnote |                                           preceding::informaltable//footnote"/>
    97107      <xsl:variable name="fnum" select="count($pfoot) - count($ptfoot) + 1"/>
    98108
     
    114124  <!-- this only works if the first thing in a footnote is a para, -->
    115125  <!-- which is ok, because it usually is. -->
    116   <xsl:variable name="name">
    117     <xsl:text>ftn.</xsl:text>
    118     <xsl:call-template name="object.id">
    119       <xsl:with-param name="object" select="ancestor::footnote"/>
    120     </xsl:call-template>
    121   </xsl:variable>
    122126  <xsl:variable name="href">
    123127    <xsl:text>#</xsl:text>
     
    126130    </xsl:call-template>
    127131  </xsl:variable>
    128   <p>
    129     <xsl:if test="@role and $para.propagates.style != 0">
    130       <xsl:apply-templates select="." mode="class.attribute">
    131         <xsl:with-param name="class" select="@role"/>
    132       </xsl:apply-templates>
    133     </xsl:if>
    134     <sup>
    135       <xsl:text>[</xsl:text>
    136       <a id="{$name}" href="{$href}">
     132
     133  <xsl:call-template name="paragraph">
     134    <xsl:with-param name="class">
     135      <xsl:if test="@role and $para.propagates.style != 0">
     136        <xsl:value-of select="@role"/>
     137      </xsl:if>
     138    </xsl:with-param>
     139    <xsl:with-param name="content">
     140      <a href="{$href}">
    137141        <xsl:apply-templates select="." mode="class.attribute"/>
    138         <xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
     142        <sup>
     143          <xsl:apply-templates select="." mode="class.attribute"/>
     144          <xsl:text>[</xsl:text>
     145          <xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
     146          <xsl:text>] </xsl:text>
     147        </sup>
    139148      </a>
    140       <xsl:text>] </xsl:text>
    141     </sup>
    142     <xsl:apply-templates/>
    143   </p>
     149      <xsl:apply-templates/>
     150    </xsl:with-param>
     151  </xsl:call-template>
     152
    144153</xsl:template>
    145154
     
    160169  </xsl:variable>
    161170  <xsl:variable name="footnote.mark">
    162     <sup>
    163       <xsl:text>[</xsl:text>
    164       <a id="{$name}" href="{$href}">
    165         <xsl:apply-templates select="." mode="class.attribute"/>
     171    <a href="{$href}">
     172      <xsl:apply-templates select="." mode="class.attribute"/>
     173      <xsl:choose>
     174        <xsl:when test="$generate.id.attributes = 0">
     175          <xsl:if test="@id or @xml:id">
     176            <xsl:attribute name="id">
     177              <xsl:value-of select="@id|@xml:id"/>
     178            </xsl:attribute>
     179          </xsl:if>
     180        </xsl:when>
     181        <xsl:otherwise>
     182          <xsl:call-template name="id.attribute"/>
     183        </xsl:otherwise>
     184      </xsl:choose>
     185      <sup>
     186        <xsl:text>[</xsl:text>
    166187        <xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
    167       </a>
    168       <xsl:text>] </xsl:text>
    169     </sup>
     188        <xsl:text>] </xsl:text>
     189      </sup>
     190    </a>
    170191  </xsl:variable>
    171192
     
    175196
    176197  <xsl:choose>
    177     <xsl:when test="function-available('exsl:node-set')">
     198    <xsl:when test="$exsl.node.set.available != 0">
    178199      <xsl:variable name="html-nodes" select="exsl:node-set($html)"/>
    179200      <xsl:choose>
     
    223244<xsl:template name="process.footnotes">
    224245  <xsl:variable name="footnotes" select=".//footnote"/>
    225   <xsl:variable name="table.footnotes" select=".//tgroup//footnote"/>
     246  <xsl:variable name="table.footnotes" select=".//table//footnote | .//informaltable//footnote"/>
    226247
    227248  <!-- Only bother to do this if there's at least one non-table footnote -->
    228249  <xsl:if test="count($footnotes)&gt;count($table.footnotes)">
    229250    <div class="footnotes">
     251      <xsl:call-template name="footnotes.attributes"/>
    230252      <br/>
    231       <hr width="100" align="left"/>
     253      <hr/>
    232254      <xsl:apply-templates select="$footnotes" mode="process.footnote.mode"/>
    233255    </div>
     
    247269</xsl:template>
    248270
     271<xsl:template name="footnotes.attributes">
     272  <!-- customizable for footnotes attributes -->
     273</xsl:template>
     274
    249275<xsl:template name="process.chunk.footnotes">
    250276  <!-- nop -->
     
    252278
    253279<xsl:template match="footnote" name="process.footnote" mode="process.footnote.mode">
     280  <xsl:variable name="id">
     281    <xsl:text>ftn.</xsl:text>
     282    <xsl:call-template name="object.id">
     283      <xsl:with-param name="conditional" select="0"/>
     284    </xsl:call-template>
     285  </xsl:variable>
     286
    254287  <xsl:choose>
    255288    <xsl:when test="local-name(*[1]) = 'para' or local-name(*[1]) = 'simpara'">
    256       <div>
    257         <xsl:apply-templates select="." mode="class.attribute"/>
     289      <div id="{$id}">
     290        <xsl:call-template name="common.html.attributes"/>
    258291        <xsl:apply-templates/>
    259292      </div>
    260293    </xsl:when>
    261294
    262     <xsl:when test="$html.cleanup != 0 and function-available('exsl:node-set')">
    263       <div>
    264         <xsl:apply-templates select="." mode="class.attribute"/>
     295    <xsl:when test="$html.cleanup != 0 and                      $exsl.node.set.available != 0">
     296      <div id="{$id}">
     297        <xsl:call-template name="common.html.attributes"/>
     298        <xsl:call-template name="id.attribute"/>
    265299        <xsl:apply-templates select="*[1]" mode="footnote.body.number"/>
    266300        <xsl:apply-templates select="*[position() &gt; 1]"/>
     
    275309        <xsl:text> unexpected as first child of footnote.</xsl:text>
    276310      </xsl:message>
    277       <div>
    278         <xsl:apply-templates select="." mode="class.attribute"/>
     311      <div id="{$id}">
     312        <xsl:call-template name="common.html.attributes"/>
     313        <xsl:call-template name="id.attribute"/>
    279314        <xsl:apply-templates/>
    280315      </div>
     
    283318</xsl:template>
    284319
    285 <xsl:template match="tgroup//footnote" mode="process.footnote.mode">
     320<xsl:template match="table//footnote | informaltable//footnote" mode="process.footnote.mode">
    286321</xsl:template>
    287322
Note: See TracChangeset for help on using the changeset viewer.