- 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/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"> 5 2 6 3 <!-- ******************************************************************** 7 $Id $4 $Id: footnote.xsl 9665 2012-11-08 14:26:20Z kosek $ 8 5 ******************************************************************** 9 6 … … 14 11 ******************************************************************** --> 15 12 13 <!-- This template generates just the footnote marker inline. 14 The footnote text is handled in name="process.footnote". 15 The footnote marker gets an id of @id, while the 16 footnote text gets an id of #ftn.@id. They cross link to each other. --> 16 17 <xsl:template match="footnote"> 17 18 <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> 19 22 </xsl:variable> 20 23 <xsl:variable name="href"> 21 24 <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> 47 46 </xsl:template> 48 47 … … 50 49 <xsl:variable name="targets" select="key('id',@linkend)"/> 51 50 <xsl:variable name="footnote" select="$targets[1]"/> 51 52 <xsl:if test="not(local-name($footnote) = 'footnote')"> 53 <xsl:message terminate="yes"> 54 ERROR: A footnoteref element has a linkend that points to an element that is not a footnote. 55 Typically this happens when an id attribute is accidentally applied to the child of a footnote element. 56 target element: <xsl:value-of select="local-name($footnote)"/> 57 linkend/id: <xsl:value-of select="@linkend"/> 58 </xsl:message> 59 </xsl:if> 52 60 53 61 <xsl:variable name="target.href"> … … 63 71 </xsl:variable> 64 72 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> 68 77 <xsl:apply-templates select="." mode="class.attribute"/> 78 <xsl:text>[</xsl:text> 69 79 <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> 73 83 </xsl:template> 74 84 … … 78 88 <xsl:value-of select="@label"/> 79 89 </xsl:when> 80 <xsl:when test="ancestor::t group">90 <xsl:when test="ancestor::table or ancestor::informaltable"> 81 91 <xsl:variable name="tfnum"> 82 92 <xsl:number level="any" from="table|informaltable" format="1"/> … … 88 98 </xsl:when> 89 99 <xsl:otherwise> 90 <xsl:number level="any" from="t group" format="{$table.footnote.number.format}"/>100 <xsl:number level="any" from="table | informaltable" format="{$table.footnote.number.format}"/> 91 101 </xsl:otherwise> 92 102 </xsl:choose> … … 94 104 <xsl:otherwise> 95 105 <xsl:variable name="pfoot" select="preceding::footnote[not(@label)]"/> 96 <xsl:variable name="ptfoot" select="preceding::t group//footnote"/>106 <xsl:variable name="ptfoot" select="preceding::table//footnote | preceding::informaltable//footnote"/> 97 107 <xsl:variable name="fnum" select="count($pfoot) - count($ptfoot) + 1"/> 98 108 … … 114 124 <!-- this only works if the first thing in a footnote is a para, --> 115 125 <!-- 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>122 126 <xsl:variable name="href"> 123 127 <xsl:text>#</xsl:text> … … 126 130 </xsl:call-template> 127 131 </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}"> 137 141 <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> 139 148 </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 144 153 </xsl:template> 145 154 … … 160 169 </xsl:variable> 161 170 <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> 166 187 <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> 170 191 </xsl:variable> 171 192 … … 175 196 176 197 <xsl:choose> 177 <xsl:when test=" function-available('exsl:node-set')">198 <xsl:when test="$exsl.node.set.available != 0"> 178 199 <xsl:variable name="html-nodes" select="exsl:node-set($html)"/> 179 200 <xsl:choose> … … 223 244 <xsl:template name="process.footnotes"> 224 245 <xsl:variable name="footnotes" select=".//footnote"/> 225 <xsl:variable name="table.footnotes" select=".//t group//footnote"/>246 <xsl:variable name="table.footnotes" select=".//table//footnote | .//informaltable//footnote"/> 226 247 227 248 <!-- Only bother to do this if there's at least one non-table footnote --> 228 249 <xsl:if test="count($footnotes)>count($table.footnotes)"> 229 250 <div class="footnotes"> 251 <xsl:call-template name="footnotes.attributes"/> 230 252 <br/> 231 <hr width="100" align="left"/>253 <hr/> 232 254 <xsl:apply-templates select="$footnotes" mode="process.footnote.mode"/> 233 255 </div> … … 247 269 </xsl:template> 248 270 271 <xsl:template name="footnotes.attributes"> 272 <!-- customizable for footnotes attributes --> 273 </xsl:template> 274 249 275 <xsl:template name="process.chunk.footnotes"> 250 276 <!-- nop --> … … 252 278 253 279 <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 254 287 <xsl:choose> 255 288 <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"/> 258 291 <xsl:apply-templates/> 259 292 </div> 260 293 </xsl:when> 261 294 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"/> 265 299 <xsl:apply-templates select="*[1]" mode="footnote.body.number"/> 266 300 <xsl:apply-templates select="*[position() > 1]"/> … … 275 309 <xsl:text> unexpected as first child of footnote.</xsl:text> 276 310 </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"/> 279 314 <xsl:apply-templates/> 280 315 </div> … … 283 318 </xsl:template> 284 319 285 <xsl:template match="t group//footnote" mode="process.footnote.mode">320 <xsl:template match="table//footnote | informaltable//footnote" mode="process.footnote.mode"> 286 321 </xsl:template> 287 322
Note:
See TracChangeset
for help on using the changeset viewer.