| 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:d="http://docbook.org/ns/docbook" xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks" xmlns:exsl="http://exslt.org/common" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="suwl exsl xlink d" version="1.0"> |
| 2 |
|
| 3 |
<!-- ******************************************************************** |
| 4 |
|
| 5 |
This file is part of the XSL DocBook Stylesheet distribution. |
| 6 |
See ../README or http://cdn.docbook.org/release/xsl/current/ for |
| 7 |
copyright and other information. |
| 8 |
|
| 9 |
******************************************************************** --> |
| 10 |
|
| 11 |
<!-- Use internal variable for olink xlink role for consistency --> |
| 12 |
<xsl:variable name="xolink.role">http://docbook.org/xlink/role/olink</xsl:variable> |
| 13 |
|
| 14 |
<!-- ==================================================================== --> |
| 15 |
|
| 16 |
<xsl:template match="d:anchor"> |
| 17 |
<xsl:choose> |
| 18 |
<xsl:when test="$generate.id.attributes = 0"> |
| 19 |
<xsl:call-template name="anchor"/> |
| 20 |
</xsl:when> |
| 21 |
<xsl:otherwise> |
| 22 |
<span> |
| 23 |
<xsl:call-template name="id.attribute"/> |
| 24 |
</span> |
| 25 |
</xsl:otherwise> |
| 26 |
</xsl:choose> |
| 27 |
</xsl:template> |
| 28 |
|
| 29 |
<!-- ==================================================================== --> |
| 30 |
|
| 31 |
<xsl:template match="d:xref" name="xref"> |
| 32 |
<xsl:param name="xhref" select="@xlink:href"/> |
| 33 |
<!-- is the @xlink:href a local idref link? --> |
| 34 |
<xsl:param name="xlink.idref"> |
| 35 |
<xsl:if test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))"> |
| 36 |
<xsl:call-template name="xpointer.idref"> |
| 37 |
<xsl:with-param name="xpointer" select="$xhref"/> |
| 38 |
</xsl:call-template> |
| 39 |
</xsl:if> |
| 40 |
</xsl:param> |
| 41 |
<xsl:param name="xlink.targets" select="key('id',$xlink.idref)"/> |
| 42 |
<xsl:param name="linkend.targets" select="key('id',@linkend)"/> |
| 43 |
<xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/> |
| 44 |
<xsl:param name="referrer" select="."/> |
| 45 |
|
| 46 |
<xsl:param name="xrefstyle"> |
| 47 |
<xsl:apply-templates select="." mode="xrefstyle"> |
| 48 |
<xsl:with-param name="target" select="$target"/> |
| 49 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 50 |
</xsl:apply-templates> |
| 51 |
</xsl:param> |
| 52 |
|
| 53 |
<xsl:call-template name="anchor"/> |
| 54 |
|
| 55 |
<xsl:variable name="content"> |
| 56 |
<xsl:choose> |
| 57 |
|
| 58 |
<xsl:when test="@endterm"> |
| 59 |
<xsl:variable name="etargets" select="key('id',@endterm)"/> |
| 60 |
<xsl:variable name="etarget" select="$etargets[1]"/> |
| 61 |
<xsl:choose> |
| 62 |
<xsl:when test="count($etarget) = 0"> |
| 63 |
<xsl:message> |
| 64 |
<xsl:value-of select="count($etargets)"/> |
| 65 |
<xsl:text>Endterm points to nonexistent ID: </xsl:text> |
| 66 |
<xsl:value-of select="@endterm"/> |
| 67 |
</xsl:message> |
| 68 |
<xsl:text>???</xsl:text> |
| 69 |
</xsl:when> |
| 70 |
<xsl:otherwise> |
| 71 |
<xsl:apply-templates select="$etarget" mode="endterm"/> |
| 72 |
</xsl:otherwise> |
| 73 |
</xsl:choose> |
| 74 |
</xsl:when> |
| 75 |
|
| 76 |
<xsl:when test="$target/@xreflabel"> |
| 77 |
<xsl:call-template name="xref.xreflabel"> |
| 78 |
<xsl:with-param name="target" select="$target"/> |
| 79 |
</xsl:call-template> |
| 80 |
</xsl:when> |
| 81 |
|
| 82 |
<xsl:when test="$target"> |
| 83 |
<xsl:if test="not(parent::d:citation)"> |
| 84 |
<xsl:apply-templates select="$target" mode="xref-to-prefix"> |
| 85 |
<xsl:with-param name="referrer" select="."/> |
| 86 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 87 |
</xsl:apply-templates> |
| 88 |
</xsl:if> |
| 89 |
|
| 90 |
<xsl:apply-templates select="$target" mode="xref-to"> |
| 91 |
<xsl:with-param name="referrer" select="."/> |
| 92 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 93 |
</xsl:apply-templates> |
| 94 |
|
| 95 |
<xsl:if test="not(parent::d:citation)"> |
| 96 |
<xsl:apply-templates select="$target" mode="xref-to-suffix"> |
| 97 |
<xsl:with-param name="referrer" select="."/> |
| 98 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 99 |
</xsl:apply-templates> |
| 100 |
</xsl:if> |
| 101 |
</xsl:when> |
| 102 |
|
| 103 |
<xsl:otherwise> |
| 104 |
<xsl:message> |
| 105 |
<xsl:text>ERROR: xref linking to </xsl:text> |
| 106 |
<xsl:value-of select="@linkend|@xlink:href"/> |
| 107 |
<xsl:text> has no generated link text.</xsl:text> |
| 108 |
</xsl:message> |
| 109 |
<xsl:text>???</xsl:text> |
| 110 |
</xsl:otherwise> |
| 111 |
</xsl:choose> |
| 112 |
</xsl:variable> |
| 113 |
|
| 114 |
<xsl:variable name="id" select="(@id | @xml:id)[1]"/> |
| 115 |
|
| 116 |
<xsl:choose> |
| 117 |
<xsl:when test="$id"> |
| 118 |
<span id="{$id}"> |
| 119 |
<xsl:call-template name="simple.xlink"> |
| 120 |
<xsl:with-param name="content" select="$content"/> |
| 121 |
</xsl:call-template> |
| 122 |
</span> |
| 123 |
</xsl:when> |
| 124 |
<xsl:otherwise> |
| 125 |
<xsl:call-template name="simple.xlink"> |
| 126 |
<xsl:with-param name="content" select="$content"/> |
| 127 |
</xsl:call-template> |
| 128 |
</xsl:otherwise> |
| 129 |
</xsl:choose> |
| 130 |
|
| 131 |
</xsl:template> |
| 132 |
|
| 133 |
<!-- ==================================================================== --> |
| 134 |
|
| 135 |
<!-- biblioref handled largely like an xref --> |
| 136 |
<!-- To be done: add support for begin, end, and units attributes --> |
| 137 |
<xsl:template match="d:biblioref"> |
| 138 |
<xsl:variable name="targets" select="key('id',@linkend)"/> |
| 139 |
<xsl:variable name="target" select="$targets[1]"/> |
| 140 |
<xsl:variable name="refelem" select="local-name($target)"/> |
| 141 |
<xsl:variable name="referrer" select="."/> |
| 142 |
<xsl:variable name="xrefstyle"> |
| 143 |
<xsl:apply-templates select="." mode="xrefstyle"> |
| 144 |
<xsl:with-param name="target" select="$target"/> |
| 145 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 146 |
</xsl:apply-templates> |
| 147 |
</xsl:variable> |
| 148 |
|
| 149 |
<xsl:call-template name="check.id.unique"> |
| 150 |
<xsl:with-param name="linkend" select="@linkend"/> |
| 151 |
</xsl:call-template> |
| 152 |
|
| 153 |
<xsl:call-template name="anchor"/> |
| 154 |
|
| 155 |
<xsl:choose> |
| 156 |
<xsl:when test="count($target) = 0"> |
| 157 |
<xsl:message> |
| 158 |
<xsl:text>XRef to nonexistent id: </xsl:text> |
| 159 |
<xsl:value-of select="@linkend"/> |
| 160 |
</xsl:message> |
| 161 |
<xsl:text>???</xsl:text> |
| 162 |
</xsl:when> |
| 163 |
|
| 164 |
<xsl:when test="@endterm"> |
| 165 |
<xsl:variable name="href"> |
| 166 |
<xsl:call-template name="href.target"> |
| 167 |
<xsl:with-param name="object" select="$target"/> |
| 168 |
</xsl:call-template> |
| 169 |
</xsl:variable> |
| 170 |
|
| 171 |
<xsl:variable name="etargets" select="key('id',@endterm)"/> |
| 172 |
<xsl:variable name="etarget" select="$etargets[1]"/> |
| 173 |
<xsl:choose> |
| 174 |
<xsl:when test="count($etarget) = 0"> |
| 175 |
<xsl:message> |
| 176 |
<xsl:value-of select="count($etargets)"/> |
| 177 |
<xsl:text>Endterm points to nonexistent ID: </xsl:text> |
| 178 |
<xsl:value-of select="@endterm"/> |
| 179 |
</xsl:message> |
| 180 |
<a href="{$href}"> |
| 181 |
<xsl:apply-templates select="." mode="common.html.attributes"/> |
| 182 |
<xsl:call-template name="id.attribute"/> |
| 183 |
<xsl:text>???</xsl:text> |
| 184 |
</a> |
| 185 |
</xsl:when> |
| 186 |
<xsl:otherwise> |
| 187 |
<a href="{$href}"> |
| 188 |
<xsl:apply-templates select="." mode="common.html.attributes"/> |
| 189 |
<xsl:call-template name="id.attribute"/> |
| 190 |
<xsl:apply-templates select="$etarget" mode="endterm"/> |
| 191 |
</a> |
| 192 |
</xsl:otherwise> |
| 193 |
</xsl:choose> |
| 194 |
</xsl:when> |
| 195 |
|
| 196 |
<xsl:when test="$target/@xreflabel"> |
| 197 |
<a> |
| 198 |
<xsl:apply-templates select="." mode="common.html.attributes"/> |
| 199 |
<xsl:attribute name="href"> |
| 200 |
<xsl:call-template name="href.target"> |
| 201 |
<xsl:with-param name="object" select="$target"/> |
| 202 |
</xsl:call-template> |
| 203 |
</xsl:attribute> |
| 204 |
<xsl:call-template name="xref.xreflabel"> |
| 205 |
<xsl:with-param name="target" select="$target"/> |
| 206 |
</xsl:call-template> |
| 207 |
</a> |
| 208 |
</xsl:when> |
| 209 |
|
| 210 |
<xsl:otherwise> |
| 211 |
<xsl:variable name="href"> |
| 212 |
<xsl:call-template name="href.target"> |
| 213 |
<xsl:with-param name="object" select="$target"/> |
| 214 |
</xsl:call-template> |
| 215 |
</xsl:variable> |
| 216 |
|
| 217 |
<xsl:if test="not(parent::d:citation)"> |
| 218 |
<xsl:apply-templates select="$target" mode="xref-to-prefix"> |
| 219 |
<xsl:with-param name="referrer" select="."/> |
| 220 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 221 |
</xsl:apply-templates> |
| 222 |
</xsl:if> |
| 223 |
|
| 224 |
<a href="{$href}"> |
| 225 |
<xsl:apply-templates select="." mode="class.attribute"/> |
| 226 |
<xsl:if test="$target/d:title or $target/d:info/d:title"> |
| 227 |
<xsl:attribute name="title"> |
| 228 |
<xsl:apply-templates select="$target" mode="xref-title"/> |
| 229 |
</xsl:attribute> |
| 230 |
</xsl:if> |
| 231 |
<xsl:apply-templates select="$target" mode="xref-to"> |
| 232 |
<xsl:with-param name="referrer" select="."/> |
| 233 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 234 |
</xsl:apply-templates> |
| 235 |
</a> |
| 236 |
|
| 237 |
<xsl:if test="not(parent::d:citation)"> |
| 238 |
<xsl:apply-templates select="$target" mode="xref-to-suffix"> |
| 239 |
<xsl:with-param name="referrer" select="."/> |
| 240 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 241 |
</xsl:apply-templates> |
| 242 |
</xsl:if> |
| 243 |
</xsl:otherwise> |
| 244 |
</xsl:choose> |
| 245 |
</xsl:template> |
| 246 |
|
| 247 |
<!-- ==================================================================== --> |
| 248 |
|
| 249 |
<xsl:template match="*" mode="endterm"> |
| 250 |
<!-- Process the children of the endterm element --> |
| 251 |
<xsl:variable name="endterm"> |
| 252 |
<xsl:apply-templates select="child::node()" mode="no.anchor.mode"/> |
| 253 |
</xsl:variable> |
| 254 |
|
| 255 |
<xsl:choose> |
| 256 |
<xsl:when test="$exsl.node.set.available != 0"> |
| 257 |
<xsl:apply-templates select="exsl:node-set($endterm)" mode="remove-ids"/> |
| 258 |
</xsl:when> |
| 259 |
<xsl:otherwise> |
| 260 |
<xsl:copy-of select="$endterm"/> |
| 261 |
</xsl:otherwise> |
| 262 |
</xsl:choose> |
| 263 |
</xsl:template> |
| 264 |
|
| 265 |
<xsl:template match="*" mode="remove-ids"> |
| 266 |
<xsl:choose> |
| 267 |
<!-- handle html or xhtml --> |
| 268 |
<xsl:when test="local-name(.) = 'a' and (namespace-uri(.) = '' or namespace-uri(.) = 'http://www.w3.org/1999/xhtml')"> |
| 269 |
<xsl:choose> |
| 270 |
<xsl:when test="(@name and count(@*) = 1) or (@id and count(@*) = 1) or (@xml:id and count(@*) = 1) or (@xml:id and @name and count(@*) = 2) or (@id and @name and count(@*) = 2)"> |
| 271 |
<xsl:message>suppress anchor</xsl:message> |
| 272 |
<!-- suppress the whole thing --> |
| 273 |
</xsl:when> |
| 274 |
<xsl:otherwise> |
| 275 |
<xsl:copy> |
| 276 |
<xsl:for-each select="@*"> |
| 277 |
<xsl:choose> |
| 278 |
<xsl:when test="local-name(.) != 'name' and local-name(.) != 'id'"> |
| 279 |
<xsl:copy/> |
| 280 |
</xsl:when> |
| 281 |
<xsl:otherwise> |
| 282 |
<xsl:message>removing <xsl:value-of select="local-name(.)"/></xsl:message> |
| 283 |
</xsl:otherwise> |
| 284 |
</xsl:choose> |
| 285 |
</xsl:for-each> |
| 286 |
<xsl:apply-templates mode="remove-ids"/> |
| 287 |
</xsl:copy> |
| 288 |
</xsl:otherwise> |
| 289 |
</xsl:choose> |
| 290 |
</xsl:when> |
| 291 |
<xsl:otherwise> |
| 292 |
<xsl:copy> |
| 293 |
<xsl:for-each select="@*"> |
| 294 |
<xsl:choose> |
| 295 |
<xsl:when test="local-name(.) != 'id'"> |
| 296 |
<xsl:copy/> |
| 297 |
</xsl:when> |
| 298 |
<xsl:otherwise> |
| 299 |
<xsl:message>removing <xsl:value-of select="local-name(.)"/></xsl:message> |
| 300 |
</xsl:otherwise> |
| 301 |
</xsl:choose> |
| 302 |
</xsl:for-each> |
| 303 |
<xsl:apply-templates mode="remove-ids"/> |
| 304 |
</xsl:copy> |
| 305 |
</xsl:otherwise> |
| 306 |
</xsl:choose> |
| 307 |
</xsl:template> |
| 308 |
|
| 309 |
<!-- ==================================================================== --> |
| 310 |
|
| 311 |
<xsl:template match="*" mode="xref-to-prefix"> |
| 312 |
<xsl:param name="referrer"/> |
| 313 |
<xsl:param name="xrefstyle"/> |
| 314 |
<xsl:param name="verbose" select="1"/> |
| 315 |
</xsl:template> |
| 316 |
<xsl:template match="*" mode="xref-to-suffix"> |
| 317 |
<xsl:param name="referrer"/> |
| 318 |
<xsl:param name="xrefstyle"/> |
| 319 |
<xsl:param name="verbose" select="1"/> |
| 320 |
</xsl:template> |
| 321 |
|
| 322 |
<xsl:template match="*" mode="xref-to"> |
| 323 |
<xsl:param name="referrer"/> |
| 324 |
<xsl:param name="xrefstyle"/> |
| 325 |
<xsl:param name="verbose" select="1"/> |
| 326 |
|
| 327 |
<xsl:if test="$verbose"> |
| 328 |
<xsl:message> |
| 329 |
<xsl:text>Don't know what gentext to create for xref to: "</xsl:text> |
| 330 |
<xsl:value-of select="name(.)"/> |
| 331 |
<xsl:text>", ("</xsl:text> |
| 332 |
<xsl:value-of select="(@id|@xml:id)[1]"/> |
| 333 |
<xsl:text>")</xsl:text> |
| 334 |
</xsl:message> |
| 335 |
</xsl:if> |
| 336 |
<xsl:text>???</xsl:text> |
| 337 |
</xsl:template> |
| 338 |
|
| 339 |
<xsl:template match="d:title" mode="xref-to"> |
| 340 |
<xsl:param name="referrer"/> |
| 341 |
<xsl:param name="xrefstyle"/> |
| 342 |
<xsl:param name="verbose" select="1"/> |
| 343 |
|
| 344 |
<!-- if you xref to a title, xref to the parent... --> |
| 345 |
<xsl:choose> |
| 346 |
<!-- FIXME: how reliable is this? --> |
| 347 |
<xsl:when test="contains(local-name(parent::*), 'info')"> |
| 348 |
<xsl:apply-templates select="parent::*[2]" mode="xref-to"> |
| 349 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 350 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 351 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 352 |
</xsl:apply-templates> |
| 353 |
</xsl:when> |
| 354 |
<xsl:otherwise> |
| 355 |
<xsl:apply-templates select="parent::*" mode="xref-to"> |
| 356 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 357 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 358 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 359 |
</xsl:apply-templates> |
| 360 |
</xsl:otherwise> |
| 361 |
</xsl:choose> |
| 362 |
</xsl:template> |
| 363 |
|
| 364 |
<xsl:template match="d:abstract|d:authorblurb|d:personblurb|d:bibliodiv|d:bibliomset |d:biblioset|d:blockquote|d:calloutlist|d:caution|d:colophon |d:constraintdef|d:formalpara|d:glossdiv|d:important|d:indexdiv |d:itemizedlist|d:legalnotice|d:lot|d:msg|d:msgexplan|d:msgmain |d:msgrel|d:msgset|d:msgsub|d:note|d:orderedlist|d:partintro |d:productionset|d:qandadiv|d:refsynopsisdiv|d:screenshot|d:segmentedlist |d:set|d:setindex|d:sidebar|d:tip|d:toc|d:variablelist|d:warning" mode="xref-to"> |
| 365 |
<xsl:param name="referrer"/> |
| 366 |
<xsl:param name="xrefstyle"/> |
| 367 |
<xsl:param name="verbose" select="1"/> |
| 368 |
|
| 369 |
<!-- catch-all for things with (possibly optional) titles --> |
| 370 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 371 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 372 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 373 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 374 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 375 |
</xsl:apply-templates> |
| 376 |
</xsl:template> |
| 377 |
|
| 378 |
<xsl:template match="d:author|d:editor|d:othercredit|d:personname" mode="xref-to"> |
| 379 |
<xsl:param name="referrer"/> |
| 380 |
<xsl:param name="xrefstyle"/> |
| 381 |
|
| 382 |
<xsl:call-template name="person.name"/> |
| 383 |
</xsl:template> |
| 384 |
|
| 385 |
<xsl:template match="d:authorgroup" mode="xref-to"> |
| 386 |
<xsl:param name="referrer"/> |
| 387 |
<xsl:param name="xrefstyle"/> |
| 388 |
|
| 389 |
<xsl:call-template name="person.name.list"/> |
| 390 |
</xsl:template> |
| 391 |
|
| 392 |
<xsl:template match="d:figure|d:example|d:table|d:equation" mode="xref-to"> |
| 393 |
<xsl:param name="referrer"/> |
| 394 |
<xsl:param name="xrefstyle"/> |
| 395 |
<xsl:param name="verbose" select="1"/> |
| 396 |
|
| 397 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 398 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 399 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 400 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 401 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 402 |
</xsl:apply-templates> |
| 403 |
</xsl:template> |
| 404 |
|
| 405 |
<xsl:template match="d:procedure" mode="xref-to"> |
| 406 |
<xsl:param name="referrer"/> |
| 407 |
<xsl:param name="xrefstyle"/> |
| 408 |
<xsl:param name="verbose"/> |
| 409 |
|
| 410 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 411 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 412 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 413 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 414 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 415 |
</xsl:apply-templates> |
| 416 |
</xsl:template> |
| 417 |
|
| 418 |
<xsl:template match="d:task" mode="xref-to"> |
| 419 |
<xsl:param name="referrer"/> |
| 420 |
<xsl:param name="xrefstyle"/> |
| 421 |
<xsl:param name="verbose"/> |
| 422 |
|
| 423 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 424 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 425 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 426 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 427 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 428 |
</xsl:apply-templates> |
| 429 |
</xsl:template> |
| 430 |
|
| 431 |
<xsl:template match="d:cmdsynopsis" mode="xref-to"> |
| 432 |
<xsl:apply-templates select="(.//d:command)[1]" mode="xref"/> |
| 433 |
</xsl:template> |
| 434 |
|
| 435 |
<xsl:template match="d:funcsynopsis" mode="xref-to"> |
| 436 |
<xsl:apply-templates select="(.//d:function)[1]" mode="xref"/> |
| 437 |
</xsl:template> |
| 438 |
|
| 439 |
<xsl:template match="d:dedication|d:acknowledgements|d:preface|d:chapter|d:appendix|d:article" mode="xref-to"> |
| 440 |
<xsl:param name="referrer"/> |
| 441 |
<xsl:param name="xrefstyle"/> |
| 442 |
<xsl:param name="verbose" select="1"/> |
| 443 |
|
| 444 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 445 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 446 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 447 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 448 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 449 |
</xsl:apply-templates> |
| 450 |
</xsl:template> |
| 451 |
|
| 452 |
<xsl:template match="d:bibliography" mode="xref-to"> |
| 453 |
<xsl:param name="referrer"/> |
| 454 |
<xsl:param name="xrefstyle"/> |
| 455 |
<xsl:param name="verbose" select="1"/> |
| 456 |
|
| 457 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 458 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 459 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 460 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 461 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 462 |
</xsl:apply-templates> |
| 463 |
</xsl:template> |
| 464 |
|
| 465 |
<xsl:template match="d:biblioentry|d:bibliomixed" mode="xref-to-prefix"> |
| 466 |
<xsl:text>[</xsl:text> |
| 467 |
</xsl:template> |
| 468 |
|
| 469 |
<xsl:template match="d:biblioentry|d:bibliomixed" mode="xref-to-suffix"> |
| 470 |
<xsl:text>]</xsl:text> |
| 471 |
</xsl:template> |
| 472 |
|
| 473 |
<xsl:template match="d:biblioentry|d:bibliomixed" mode="xref-to"> |
| 474 |
<xsl:param name="referrer"/> |
| 475 |
<xsl:param name="xrefstyle"/> |
| 476 |
<xsl:param name="verbose" select="1"/> |
| 477 |
|
| 478 |
<!-- handles both biblioentry and bibliomixed --> |
| 479 |
<xsl:choose> |
| 480 |
<xsl:when test="string(.) = ''"> |
| 481 |
<xsl:variable name="bib" select="document($bibliography.collection,.)"/> |
| 482 |
<xsl:variable name="id" select="(@id|@xml:id)[1]"/> |
| 483 |
<xsl:variable name="entry" select="$bib/d:bibliography/ *[@id=$id or @xml:id=$id][1]"/> |
| 484 |
<xsl:choose> |
| 485 |
<xsl:when test="$entry"> |
| 486 |
<xsl:choose> |
| 487 |
<xsl:when test="$bibliography.numbered != 0"> |
| 488 |
<xsl:number from="d:bibliography" count="d:biblioentry|d:bibliomixed" level="any" format="1"/> |
| 489 |
</xsl:when> |
| 490 |
<xsl:when test="local-name($entry/*[1]) = 'abbrev'"> |
| 491 |
<xsl:apply-templates select="$entry/*[1]" mode="no.anchor.mode"/> |
| 492 |
</xsl:when> |
| 493 |
<xsl:otherwise> |
| 494 |
<xsl:value-of select="(@id|@xml:id)[1]"/> |
| 495 |
</xsl:otherwise> |
| 496 |
</xsl:choose> |
| 497 |
</xsl:when> |
| 498 |
<xsl:otherwise> |
| 499 |
<xsl:message> |
| 500 |
<xsl:text>No bibliography entry: </xsl:text> |
| 501 |
<xsl:value-of select="$id"/> |
| 502 |
<xsl:text> found in </xsl:text> |
| 503 |
<xsl:value-of select="$bibliography.collection"/> |
| 504 |
</xsl:message> |
| 505 |
<xsl:value-of select="(@id|@xml:id)[1]"/> |
| 506 |
</xsl:otherwise> |
| 507 |
</xsl:choose> |
| 508 |
</xsl:when> |
| 509 |
<xsl:otherwise> |
| 510 |
<xsl:choose> |
| 511 |
<xsl:when test="$bibliography.numbered != 0"> |
| 512 |
<xsl:number from="d:bibliography" count="d:biblioentry|d:bibliomixed" level="any" format="1"/> |
| 513 |
</xsl:when> |
| 514 |
<xsl:when test="local-name(*[1]) = 'abbrev'"> |
| 515 |
<xsl:apply-templates select="*[1]" mode="no.anchor.mode"/> |
| 516 |
</xsl:when> |
| 517 |
<xsl:otherwise> |
| 518 |
<xsl:value-of select="(@id|@xml:id)[1]"/> |
| 519 |
</xsl:otherwise> |
| 520 |
</xsl:choose> |
| 521 |
</xsl:otherwise> |
| 522 |
</xsl:choose> |
| 523 |
</xsl:template> |
| 524 |
|
| 525 |
<xsl:template match="d:glossary" mode="xref-to"> |
| 526 |
<xsl:param name="referrer"/> |
| 527 |
<xsl:param name="xrefstyle"/> |
| 528 |
<xsl:param name="verbose" select="1"/> |
| 529 |
|
| 530 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 531 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 532 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 533 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 534 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 535 |
</xsl:apply-templates> |
| 536 |
</xsl:template> |
| 537 |
|
| 538 |
<xsl:template match="d:glossentry" mode="xref-to"> |
| 539 |
<xsl:param name="referrer"/> |
| 540 |
<xsl:param name="xrefstyle"/> |
| 541 |
<xsl:param name="verbose" select="1"/> |
| 542 |
<xsl:choose> |
| 543 |
<xsl:when test="$glossentry.show.acronym = 'primary'"> |
| 544 |
<xsl:choose> |
| 545 |
<xsl:when test="d:acronym|d:abbrev"> |
| 546 |
<xsl:apply-templates select="(d:acronym|d:abbrev)[1]" mode="no.anchor.mode"/> |
| 547 |
</xsl:when> |
| 548 |
<xsl:otherwise> |
| 549 |
<xsl:apply-templates select="d:glossterm[1]" mode="xref-to"> |
| 550 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 551 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 552 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 553 |
</xsl:apply-templates> |
| 554 |
</xsl:otherwise> |
| 555 |
</xsl:choose> |
| 556 |
</xsl:when> |
| 557 |
<xsl:otherwise> |
| 558 |
<xsl:apply-templates select="d:glossterm[1]" mode="xref-to"> |
| 559 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 560 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 561 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 562 |
</xsl:apply-templates> |
| 563 |
</xsl:otherwise> |
| 564 |
</xsl:choose> |
| 565 |
</xsl:template> |
| 566 |
|
| 567 |
<xsl:template match="d:glossterm|d:firstterm" mode="xref-to"> |
| 568 |
<xsl:apply-templates mode="no.anchor.mode"/> |
| 569 |
</xsl:template> |
| 570 |
|
| 571 |
<xsl:template match="d:index" mode="xref-to"> |
| 572 |
<xsl:param name="referrer"/> |
| 573 |
<xsl:param name="xrefstyle"/> |
| 574 |
<xsl:param name="verbose" select="1"/> |
| 575 |
|
| 576 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 577 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 578 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 579 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 580 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 581 |
</xsl:apply-templates> |
| 582 |
</xsl:template> |
| 583 |
|
| 584 |
<xsl:template match="d:listitem" mode="xref-to"> |
| 585 |
<xsl:param name="referrer"/> |
| 586 |
<xsl:param name="xrefstyle"/> |
| 587 |
<xsl:param name="verbose"/> |
| 588 |
|
| 589 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 590 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 591 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 592 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 593 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 594 |
</xsl:apply-templates> |
| 595 |
</xsl:template> |
| 596 |
|
| 597 |
<xsl:template match="d:section|d:simplesect |d:sect1|d:sect2|d:sect3|d:sect4|d:sect5 |d:refsect1|d:refsect2|d:refsect3|d:refsection" mode="xref-to"> |
| 598 |
<xsl:param name="referrer"/> |
| 599 |
<xsl:param name="xrefstyle"/> |
| 600 |
<xsl:param name="verbose" select="1"/> |
| 601 |
|
| 602 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 603 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 604 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 605 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 606 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 607 |
</xsl:apply-templates> |
| 608 |
<!-- FIXME: What about "in Chapter X"? --> |
| 609 |
</xsl:template> |
| 610 |
|
| 611 |
<xsl:template match="d:topic" mode="xref-to"> |
| 612 |
<xsl:param name="referrer"/> |
| 613 |
<xsl:param name="xrefstyle"/> |
| 614 |
<xsl:param name="verbose" select="1"/> |
| 615 |
|
| 616 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 617 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 618 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 619 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 620 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 621 |
</xsl:apply-templates> |
| 622 |
</xsl:template> |
| 623 |
|
| 624 |
<xsl:template match="d:bridgehead" mode="xref-to"> |
| 625 |
<xsl:param name="referrer"/> |
| 626 |
<xsl:param name="xrefstyle"/> |
| 627 |
<xsl:param name="verbose" select="1"/> |
| 628 |
|
| 629 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 630 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 631 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 632 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 633 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 634 |
</xsl:apply-templates> |
| 635 |
<!-- FIXME: What about "in Chapter X"? --> |
| 636 |
</xsl:template> |
| 637 |
|
| 638 |
<xsl:template match="d:qandaset" mode="xref-to"> |
| 639 |
<xsl:param name="referrer"/> |
| 640 |
<xsl:param name="xrefstyle"/> |
| 641 |
<xsl:param name="verbose" select="1"/> |
| 642 |
|
| 643 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 644 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 645 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 646 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 647 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 648 |
</xsl:apply-templates> |
| 649 |
</xsl:template> |
| 650 |
|
| 651 |
<xsl:template match="d:qandaentry" mode="xref-to"> |
| 652 |
<xsl:param name="referrer"/> |
| 653 |
<xsl:param name="xrefstyle"/> |
| 654 |
<xsl:param name="verbose" select="1"/> |
| 655 |
|
| 656 |
<xsl:apply-templates select="d:question[1]" mode="xref-to"> |
| 657 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 658 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 659 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 660 |
</xsl:apply-templates> |
| 661 |
</xsl:template> |
| 662 |
|
| 663 |
<xsl:template match="d:question|d:answer" mode="xref-to"> |
| 664 |
<xsl:param name="referrer"/> |
| 665 |
<xsl:param name="xrefstyle"/> |
| 666 |
<xsl:param name="verbose" select="1"/> |
| 667 |
|
| 668 |
<xsl:choose> |
| 669 |
<xsl:when test="string-length(d:label) != 0"> |
| 670 |
<xsl:apply-templates select="." mode="label.markup"/> |
| 671 |
</xsl:when> |
| 672 |
<xsl:otherwise> |
| 673 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 674 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 675 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 676 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 677 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 678 |
</xsl:apply-templates> |
| 679 |
</xsl:otherwise> |
| 680 |
</xsl:choose> |
| 681 |
</xsl:template> |
| 682 |
|
| 683 |
<xsl:template match="d:part|d:reference" mode="xref-to"> |
| 684 |
<xsl:param name="referrer"/> |
| 685 |
<xsl:param name="xrefstyle"/> |
| 686 |
<xsl:param name="verbose" select="1"/> |
| 687 |
|
| 688 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 689 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 690 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 691 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 692 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 693 |
</xsl:apply-templates> |
| 694 |
</xsl:template> |
| 695 |
|
| 696 |
<xsl:template match="d:refentry" mode="xref-to"> |
| 697 |
<xsl:param name="referrer"/> |
| 698 |
<xsl:param name="xrefstyle"/> |
| 699 |
|
| 700 |
<xsl:choose> |
| 701 |
<xsl:when test="d:refmeta/d:refentrytitle"> |
| 702 |
<xsl:apply-templates select="d:refmeta/d:refentrytitle" mode="no.anchor.mode"/> |
| 703 |
</xsl:when> |
| 704 |
<xsl:otherwise> |
| 705 |
<xsl:apply-templates select="d:refnamediv/d:refname[1]" mode="no.anchor.mode"/> |
| 706 |
</xsl:otherwise> |
| 707 |
</xsl:choose> |
| 708 |
<xsl:apply-templates select="d:refmeta/d:manvolnum" mode="no.anchor.mode"/> |
| 709 |
</xsl:template> |
| 710 |
|
| 711 |
<xsl:template match="d:refnamediv" mode="xref-to"> |
| 712 |
<xsl:param name="referrer"/> |
| 713 |
<xsl:param name="xrefstyle"/> |
| 714 |
<xsl:param name="verbose" select="1"/> |
| 715 |
|
| 716 |
<xsl:apply-templates select="d:refname[1]" mode="xref-to"> |
| 717 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 718 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 719 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 720 |
</xsl:apply-templates> |
| 721 |
</xsl:template> |
| 722 |
|
| 723 |
<xsl:template match="d:refname" mode="xref-to"> |
| 724 |
<xsl:param name="referrer"/> |
| 725 |
<xsl:param name="xrefstyle"/> |
| 726 |
<xsl:param name="verbose" select="1"/> |
| 727 |
|
| 728 |
<xsl:apply-templates mode="xref-to"/> |
| 729 |
</xsl:template> |
| 730 |
|
| 731 |
<xsl:template match="d:step" mode="xref-to"> |
| 732 |
<xsl:param name="referrer"/> |
| 733 |
<xsl:param name="xrefstyle"/> |
| 734 |
|
| 735 |
<xsl:call-template name="gentext"> |
| 736 |
<xsl:with-param name="key" select="'Step'"/> |
| 737 |
</xsl:call-template> |
| 738 |
<xsl:text> </xsl:text> |
| 739 |
<xsl:apply-templates select="." mode="number"/> |
| 740 |
</xsl:template> |
| 741 |
|
| 742 |
<xsl:template match="d:varlistentry" mode="xref-to"> |
| 743 |
<xsl:param name="referrer"/> |
| 744 |
<xsl:param name="xrefstyle"/> |
| 745 |
<xsl:param name="verbose" select="1"/> |
| 746 |
|
| 747 |
<xsl:apply-templates select="d:term[1]" mode="xref-to"> |
| 748 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 749 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 750 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 751 |
</xsl:apply-templates> |
| 752 |
</xsl:template> |
| 753 |
|
| 754 |
<xsl:template match="d:primary|d:secondary|d:tertiary" mode="xref-to"> |
| 755 |
<xsl:value-of select="."/> |
| 756 |
</xsl:template> |
| 757 |
|
| 758 |
<xsl:template match="d:indexterm" mode="xref-to"> |
| 759 |
<xsl:value-of select="d:primary"/> |
| 760 |
</xsl:template> |
| 761 |
|
| 762 |
<xsl:template match="d:varlistentry/d:term" mode="xref-to"> |
| 763 |
<xsl:param name="referrer"/> |
| 764 |
<xsl:param name="xrefstyle"/> |
| 765 |
|
| 766 |
<xsl:apply-templates mode="no.anchor.mode"/> |
| 767 |
</xsl:template> |
| 768 |
|
| 769 |
<xsl:template match="d:co" mode="xref-to"> |
| 770 |
<xsl:param name="referrer"/> |
| 771 |
<xsl:param name="xrefstyle"/> |
| 772 |
|
| 773 |
<xsl:apply-templates select="." mode="callout-bug"/> |
| 774 |
</xsl:template> |
| 775 |
|
| 776 |
<xsl:template match="d:area|d:areaset" mode="xref-to"> |
| 777 |
<xsl:param name="referrer"/> |
| 778 |
<xsl:param name="xrefstyle"/> |
| 779 |
|
| 780 |
<xsl:call-template name="callout-bug"> |
| 781 |
<xsl:with-param name="conum"> |
| 782 |
<xsl:apply-templates select="." mode="conumber"/> |
| 783 |
</xsl:with-param> |
| 784 |
</xsl:call-template> |
| 785 |
</xsl:template> |
| 786 |
|
| 787 |
<xsl:template match="d:book" mode="xref-to"> |
| 788 |
<xsl:param name="referrer"/> |
| 789 |
<xsl:param name="xrefstyle"/> |
| 790 |
<xsl:param name="verbose" select="1"/> |
| 791 |
|
| 792 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 793 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 794 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 795 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 796 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 797 |
</xsl:apply-templates> |
| 798 |
</xsl:template> |
| 799 |
|
| 800 |
<!-- These are elements for which no link text exists, so an xref to one |
| 801 |
uses the xrefstyle attribute if specified, or if not it falls back |
| 802 |
to the container element's link text --> |
| 803 |
<xsl:template match="d:para|d:phrase|d:simpara|d:anchor|d:quote" mode="xref-to"> |
| 804 |
<xsl:param name="referrer"/> |
| 805 |
<xsl:param name="xrefstyle"/> |
| 806 |
<xsl:param name="verbose" select="1"/> |
| 807 |
|
| 808 |
<xsl:variable name="context" select="(ancestor::d:simplesect |ancestor::d:section |ancestor::d:sect1 |ancestor::d:sect2 |ancestor::d:sect3 |ancestor::d:sect4 |ancestor::d:sect5 |ancestor::d:topic |ancestor::d:refsection |ancestor::d:refsect1 |ancestor::d:refsect2 |ancestor::d:refsect3 |ancestor::d:chapter |ancestor::d:appendix |ancestor::d:preface |ancestor::d:partintro |ancestor::d:dedication |ancestor::d:acknowledgements |ancestor::d:colophon |ancestor::d:bibliography |ancestor::d:index |ancestor::d:glossary |ancestor::d:glossentry |ancestor::d:listitem |ancestor::d:varlistentry)[last()]"/> |
| 809 |
|
| 810 |
<xsl:choose> |
| 811 |
<xsl:when test="$xrefstyle != ''"> |
| 812 |
<xsl:apply-templates select="." mode="object.xref.markup"> |
| 813 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 814 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 815 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 816 |
</xsl:apply-templates> |
| 817 |
</xsl:when> |
| 818 |
<xsl:otherwise> |
| 819 |
<xsl:apply-templates select="$context" mode="xref-to"> |
| 820 |
<xsl:with-param name="purpose" select="'xref'"/> |
| 821 |
<xsl:with-param name="xrefstyle" select="$xrefstyle"/> |
| 822 |
<xsl:with-param name="referrer" select="$referrer"/> |
| 823 |
<xsl:with-param name="verbose" select="$verbose"/> |
| 824 |
</xsl:apply-templates> |
| 825 |
</xsl:otherwise> |
| 826 |
</xsl:choose> |
| 827 |
</xsl:template> |
| 828 |
|
| 829 |
<!-- ==================================================================== --> |
| 830 |
|
| 831 |
<xsl:template match="*" mode="xref-title"> |
| 832 |
<xsl:variable name="title"> |
| 833 |
<xsl:apply-templates select="." mode="object.title.markup"/> |
| 834 |
</xsl:variable> |
| 835 |
|
| 836 |
<xsl:value-of select="$title"/> |
| 837 |
</xsl:template> |
| 838 |
|
| 839 |
<xsl:template match="d:author" mode="xref-title"> |
| 840 |
<xsl:variable name="title"> |
| 841 |
<xsl:call-template name="person.name"/> |
| 842 |
</xsl:variable> |
| 843 |
|
| 844 |
<xsl:value-of select="$title"/> |
| 845 |
</xsl:template> |
| 846 |
|
| 847 |
<xsl:template match="d:authorgroup" mode="xref-title"> |
| 848 |
<xsl:variable name="title"> |
| 849 |
<xsl:call-template name="person.name.list"/> |
| 850 |
</xsl:variable> |
| 851 |
|
| 852 |
<xsl:value-of select="$title"/> |
| 853 |
</xsl:template> |
| 854 |
|
| 855 |
<xsl:template match="d:cmdsynopsis" mode="xref-title"> |
| 856 |
<xsl:variable name="title"> |
| 857 |
<xsl:apply-templates select="(.//d:command)[1]" mode="xref"/> |
| 858 |
</xsl:variable> |
| 859 |
|
| 860 |
<xsl:value-of select="$title"/> |
| 861 |
</xsl:template> |
| 862 |
|
| 863 |
<xsl:template match="d:funcsynopsis" mode="xref-title"> |
| 864 |
<xsl:variable name="title"> |
| 865 |
<xsl:apply-templates select="(.//d:function)[1]" mode="xref"/> |
| 866 |
</xsl:variable> |
| 867 |
|
| 868 |
<xsl:value-of select="$title"/> |
| 869 |
</xsl:template> |
| 870 |
|
| 871 |
<xsl:template match="d:biblioentry|d:bibliomixed" mode="xref-title"> |
| 872 |
<!-- handles both biblioentry and bibliomixed --> |
| 873 |
<xsl:variable name="title"> |
| 874 |
<xsl:text>[</xsl:text> |
| 875 |
<xsl:choose> |
| 876 |
<xsl:when test="local-name(*[1]) = 'abbrev'"> |
| 877 |
<xsl:apply-templates select="*[1]" mode="no.anchor.mode"/> |
| 878 |
</xsl:when> |
| 879 |
<xsl:otherwise> |
| 880 |
<xsl:value-of select="(@id|@xml:id)[1]"/> |
| 881 |
</xsl:otherwise> |
| 882 |
</xsl:choose> |
| 883 |
<xsl:text>]</xsl:text> |
| 884 |
</xsl:variable> |
| 885 |
|
| 886 |
<xsl:value-of select="$title"/> |
| 887 |
</xsl:template> |
| 888 |
|
| 889 |
<xsl:template match="d:step" mode="xref-title"> |
| 890 |
<xsl:call-template name="gentext"> |
| 891 |
<xsl:with-param name="key" select="'Step'"/> |
| 892 |
</xsl:call-template> |
| 893 |
<xsl:text> </xsl:text> |
| 894 |
<xsl:apply-templates select="." mode="number"/> |
| 895 |
</xsl:template> |
| 896 |
|
| 897 |
<xsl:template match="d:step[not(./d:title)]" mode="title.markup"> |
| 898 |
<xsl:call-template name="gentext"> |
| 899 |
<xsl:with-param name="key" select="'Step'"/> |
| 900 |
</xsl:call-template> |
| 901 |
<xsl:text> </xsl:text> |
| 902 |
<xsl:apply-templates select="." mode="number"/> |
| 903 |
</xsl:template> |
| 904 |
|
| 905 |
<xsl:template match="d:co" mode="xref-title"> |
| 906 |
<xsl:variable name="title"> |
| 907 |
<xsl:apply-templates select="." mode="callout-bug"/> |
| 908 |
</xsl:variable> |
| 909 |
|
| 910 |
<xsl:value-of select="$title"/> |
| 911 |
</xsl:template> |
| 912 |
|
| 913 |
<!-- ==================================================================== --> |
| 914 |
|
| 915 |
<xsl:template match="d:link" name="link"> |
| 916 |
<xsl:param name="linkend" select="@linkend"/> |
| 917 |
<xsl:param name="a.target"/> |
| 918 |
<xsl:param name="xhref" select="@xlink:href"/> |
| 919 |
|
| 920 |
<xsl:variable name="content"> |
| 921 |
<xsl:call-template name="anchor"/> |
| 922 |
<xsl:choose> |
| 923 |
<xsl:when test="count(child::node()) > 0"> |
| 924 |
<!-- If it has content, use it --> |
| 925 |
<xsl:apply-templates mode="no.anchor.mode"/> |
| 926 |
</xsl:when> |
| 927 |
<!-- else look for an endterm --> |
| 928 |
<xsl:when test="@endterm"> |
| 929 |
<xsl:variable name="etargets" select="key('id',@endterm)"/> |
| 930 |
<xsl:variable name="etarget" select="$etargets[1]"/> |
| 931 |
<xsl:choose> |
| 932 |
<xsl:when test="count($etarget) = 0"> |
| 933 |
<xsl:message> |
| 934 |
<xsl:value-of select="count($etargets)"/> |
| 935 |
<xsl:text>Endterm points to nonexistent ID: </xsl:text> |
| 936 |
<xsl:value-of select="@endterm"/> |
| 937 |
</xsl:message> |
| 938 |
<xsl:text>???</xsl:text> |
| 939 |
</xsl:when> |
| 940 |
<xsl:otherwise> |
| 941 |
<xsl:apply-templates select="$etarget" mode="endterm"/> |
| 942 |
</xsl:otherwise> |
| 943 |
</xsl:choose> |
| 944 |
</xsl:when> |
| 945 |
<!-- Use the xlink:href if no other text --> |
| 946 |
<xsl:when test="@xlink:href"> |
| 947 |
<xsl:value-of select="@xlink:href"/> |
| 948 |
</xsl:when> |
| 949 |
<xsl:otherwise> |
| 950 |
<xsl:message> |
| 951 |
<xsl:text>Link element has no content and no Endterm. </xsl:text> |
| 952 |
<xsl:text>Nothing to show in the link to </xsl:text> |
| 953 |
<xsl:value-of select="(@xlink:href|@linkend)[1]"/> |
| 954 |
</xsl:message> |
| 955 |
<xsl:text>???</xsl:text> |
| 956 |
</xsl:otherwise> |
| 957 |
</xsl:choose> |
| 958 |
</xsl:variable> |
| 959 |
|
| 960 |
<xsl:variable name="id" select="(@id | @xml:id)[1]"/> |
| 961 |
|
| 962 |
<xsl:choose> |
| 963 |
<xsl:when test="$id"> |
| 964 |
<span id="{$id}"> |
| 965 |
<xsl:call-template name="simple.xlink"> |
| 966 |
<xsl:with-param name="node" select="."/> |
| 967 |
<xsl:with-param name="linkend" select="$linkend"/> |
| 968 |
<xsl:with-param name="content" select="$content"/> |
| 969 |
<xsl:with-param name="a.target" select="$a.target"/> |
| 970 |
<xsl:with-param name="xhref" select="$xhref"/> |
| 971 |
</xsl:call-template> |
| 972 |
</span> |
| 973 |
</xsl:when> |
| 974 |
<xsl:otherwise> |
| 975 |
<xsl:call-template name="simple.xlink"> |
| 976 |
<xsl:with-param name="node" select="."/> |
| 977 |
<xsl:with-param name="linkend" select="$linkend"/> |
| 978 |
<xsl:with-param name="content" select="$content"/> |
| 979 |
<xsl:with-param name="a.target" select="$a.target"/> |
| 980 |
<xsl:with-param name="xhref" select="$xhref"/> |
| 981 |
</xsl:call-template> |
| 982 |
</xsl:otherwise> |
| 983 |
</xsl:choose> |
| 984 |
|
| 985 |
</xsl:template> |
| 986 |
|
| 987 |
<xsl:template match="d:ulink" name="ulink"> |
| 988 |
<xsl:param name="url" select="@url"/> |
| 989 |
<xsl:variable name="link"> |
| 990 |
<a> |
| 991 |
<xsl:apply-templates select="." mode="common.html.attributes"/> |
| 992 |
<xsl:if test="@id or @xml:id"> |
| 993 |
<xsl:choose> |
| 994 |
<xsl:when test="$generate.id.attributes = 0"> |
| 995 |
<xsl:attribute name="id"> |
| 996 |
<xsl:value-of select="(@id|@xml:id)[1]"/> |
| 997 |
</xsl:attribute> |
| 998 |
</xsl:when> |
| 999 |
<xsl:otherwise> |
| 1000 |
<xsl:attribute name="id"> |
| 1001 |
<xsl:value-of select="(@id|@xml:id)[1]"/> |
| 1002 |
</xsl:attribute> |
| 1003 |
</xsl:otherwise> |
| 1004 |
</xsl:choose> |
| 1005 |
</xsl:if> |
| 1006 |
<xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute> |
| 1007 |
<xsl:if test="$ulink.target != ''"> |
| 1008 |
<xsl:attribute name="target"> |
| 1009 |
<xsl:value-of select="$ulink.target"/> |
| 1010 |
</xsl:attribute> |
| 1011 |
</xsl:if> |
| 1012 |
<xsl:choose> |
| 1013 |
<xsl:when test="count(child::node())=0"> |
| 1014 |
<xsl:value-of select="$url"/> |
| 1015 |
</xsl:when> |
| 1016 |
<xsl:otherwise> |
| 1017 |
<xsl:apply-templates mode="no.anchor.mode"/> |
| 1018 |
</xsl:otherwise> |
| 1019 |
</xsl:choose> |
| 1020 |
</a> |
| 1021 |
</xsl:variable> |
| 1022 |
|
| 1023 |
<xsl:choose> |
| 1024 |
<xsl:when test="function-available('suwl:unwrapLinks')"> |
| 1025 |
<xsl:copy-of select="suwl:unwrapLinks($link)"/> |
| 1026 |
</xsl:when> |
| 1027 |
<xsl:otherwise> |
| 1028 |
<xsl:copy-of select="$link"/> |
| 1029 |
</xsl:otherwise> |
| 1030 |
</xsl:choose> |
| 1031 |
</xsl:template> |
| 1032 |
|
| 1033 |
<xsl:template match="d:olink" name="olink"> |
| 1034 |
<!-- olink content may be passed in from xlink olink --> |
| 1035 |
<xsl:param name="content" select="NOTANELEMENT"/> |
| 1036 |
|
| 1037 |
<xsl:call-template name="anchor"/> |
| 1038 |
|
| 1039 |
<xsl:choose> |
| 1040 |
<!-- olinks resolved by stylesheet and target database --> |
| 1041 |
<xsl:when test="@targetdoc or @targetptr or (@xlink:role=$xolink.role and contains(@xlink:href, '#') )"> |
| 1042 |
|
| 1043 |
<xsl:variable name="targetdoc.att"> |
| 1044 |
<xsl:choose> |
| 1045 |
<xsl:when test="@targetdoc != ''"> |
| 1046 |
<xsl:value-of select="@targetdoc"/> |
| 1047 |
</xsl:when> |
| 1048 |
<xsl:when test="@xlink:role=$xolink.role and contains(@xlink:href, '#')"> |
| 1049 |
<xsl:value-of select="substring-before(@xlink:href, '#')"/> |
| 1050 |
</xsl:when> |
| 1051 |
</xsl:choose> |
| 1052 |
</xsl:variable> |
| 1053 |
|
| 1054 |
<xsl:variable name="targetptr.att"> |
| 1055 |
<xsl:choose> |
| 1056 |
<xsl:when test="@targetptr != ''"> |
| 1057 |
<xsl:value-of select="@targetptr"/> |
| 1058 |
</xsl:when> |
| 1059 |
<xsl:when test="@xlink:role=$xolink.role and contains(@xlink:href, '#')"> |
| 1060 |
<xsl:value-of select="substring-after(@xlink:href, '#')"/> |
| 1061 |
</xsl:when> |
| 1062 |
</xsl:choose> |
| 1063 |
</xsl:variable> |
| 1064 |
|
| 1065 |
<xsl:variable name="olink.lang"> |
| 1066 |
<xsl:call-template name="l10n.language"> |
| 1067 |
<xsl:with-param name="xref-context" select="true()"/> |
| 1068 |
</xsl:call-template> |
| 1069 |
</xsl:variable> |
| 1070 |
|
| 1071 |
<xsl:variable name="target.database.filename"> |
| 1072 |
<xsl:call-template name="select.target.database"> |
| 1073 |
<xsl:with-param name="targetdoc.att" select="$targetdoc.att"/> |
| 1074 |
<xsl:with-param name="targetptr.att" select="$targetptr.att"/> |
| 1075 |
<xsl:with-param name="olink.lang" select="$olink.lang"/> |
| 1076 |
</xsl:call-template> |
| 1077 |
</xsl:variable> |
| 1078 |
|
| 1079 |
<xsl:variable name="target.database" select="document($target.database.filename,/)"/> |
| 1080 |
|
| 1081 |
<xsl:if test="$olink.debug != 0"> |
| 1082 |
<xsl:message> |
| 1083 |
<xsl:text>Olink debug: root element of target.database '</xsl:text> |
| 1084 |
<xsl:value-of select="$target.database.filename"/> |
| 1085 |
<xsl:text>' is '</xsl:text> |
| 1086 |
<xsl:value-of select="local-name($target.database/*[1])"/> |
| 1087 |
<xsl:text>'.</xsl:text> |
| 1088 |
</xsl:message> |
| 1089 |
</xsl:if> |
| 1090 |
|
| 1091 |
<xsl:variable name="olink.key"> |
| 1092 |
<xsl:call-template name="select.olink.key"> |
| 1093 |
<xsl:with-param name="targetdoc.att" select="$targetdoc.att"/> |
| 1094 |
<xsl:with-param name="targetptr.att" select="$targetptr.att"/> |
| 1095 |
<xsl:with-param name="olink.lang" select="$olink.lang"/> |
| 1096 |
<xsl:with-param name="target.database" select="$target.database"/> |
| 1097 |
</xsl:call-template> |
| 1098 |
</xsl:variable> |
| 1099 |
|
| 1100 |
<xsl:if test="string-length($olink.key) = 0"> |
| 1101 |
<xsl:call-template name="olink.unresolved"> |
| 1102 |
<xsl:with-param name="targetdoc.att" select="$targetdoc.att"/> |
| 1103 |
<xsl:with-param name="targetptr.att" select="$targetptr.att"/> |
| 1104 |
</xsl:call-template> |
| 1105 |
</xsl:if> |
| 1106 |
|
| 1107 |
<xsl:variable name="href"> |
| 1108 |
<xsl:call-template name="make.olink.href"> |
| 1109 |
<xsl:with-param name="olink.key" select="$olink.key"/> |
| 1110 |
<xsl:with-param name="target.database" select="$target.database"/> |
| 1111 |
</xsl:call-template> |
| 1112 |
</xsl:variable> |
| 1113 |
|
| 1114 |
<xsl:variable name="hottext"> |
| 1115 |
<xsl:choose> |
| 1116 |
<xsl:when test="string-length($content) != 0"> |
| 1117 |
<xsl:copy-of select="$content"/> |
| 1118 |
</xsl:when> |
| 1119 |
<xsl:otherwise> |
| 1120 |
<xsl:call-template name="olink.hottext"> |
| 1121 |
<xsl:with-param name="olink.key" select="$olink.key"/> |
| 1122 |
<xsl:with-param name="olink.lang" select="$olink.lang"/> |
| 1123 |
<xsl:with-param name="target.database" select="$target.database"/> |
| 1124 |
</xsl:call-template> |
| 1125 |
</xsl:otherwise> |
| 1126 |
</xsl:choose> |
| 1127 |
</xsl:variable> |
| 1128 |
|
| 1129 |
<xsl:variable name="olink.docname.citation"> |
| 1130 |
<xsl:call-template name="olink.document.citation"> |
| 1131 |
<xsl:with-param name="olink.key" select="$olink.key"/> |
| 1132 |
<xsl:with-param name="target.database" select="$target.database"/> |
| 1133 |
<xsl:with-param name="olink.lang" select="$olink.lang"/> |
| 1134 |
</xsl:call-template> |
| 1135 |
</xsl:variable> |
| 1136 |
|
| 1137 |
<xsl:variable name="olink.page.citation"> |
| 1138 |
<xsl:call-template name="olink.page.citation"> |
| 1139 |
<xsl:with-param name="olink.key" select="$olink.key"/> |
| 1140 |
<xsl:with-param name="target.database" select="$target.database"/> |
| 1141 |
<xsl:with-param name="olink.lang" select="$olink.lang"/> |
| 1142 |
</xsl:call-template> |
| 1143 |
</xsl:variable> |
| 1144 |
|
| 1145 |
<xsl:choose> |
| 1146 |
<xsl:when test="$href != ''"> |
| 1147 |
<a href="{$href}"> |
| 1148 |
<xsl:apply-templates select="." mode="common.html.attributes"/> |
| 1149 |
<xsl:call-template name="id.attribute"/> |
| 1150 |
<xsl:copy-of select="$hottext"/> |
| 1151 |
</a> |
| 1152 |
<xsl:copy-of select="$olink.page.citation"/> |
| 1153 |
<xsl:copy-of select="$olink.docname.citation"/> |
| 1154 |
</xsl:when> |
| 1155 |
<xsl:otherwise> |
| 1156 |
<span class="olink"> |
| 1157 |
<xsl:call-template name="id.attribute"/> |
| 1158 |
<xsl:copy-of select="$hottext"/> |
| 1159 |
</span> |
| 1160 |
<xsl:copy-of select="$olink.page.citation"/> |
| 1161 |
<xsl:copy-of select="$olink.docname.citation"/> |
| 1162 |
</xsl:otherwise> |
| 1163 |
</xsl:choose> |
| 1164 |
|
| 1165 |
</xsl:when> |
| 1166 |
|
| 1167 |
<xsl:otherwise> |
| 1168 |
<xsl:choose> |
| 1169 |
<xsl:when test="@linkmode or @targetdocent or @localinfo"> |
| 1170 |
<!-- old olink mechanism --> |
| 1171 |
<xsl:message> |
| 1172 |
<xsl:text>ERROR: olink using obsolete attributes </xsl:text> |
| 1173 |
<xsl:text>@linkmode, @targetdocent, @localinfo are </xsl:text> |
| 1174 |
<xsl:text>not supported.</xsl:text> |
| 1175 |
</xsl:message> |
| 1176 |
</xsl:when> |
| 1177 |
<xsl:otherwise> |
| 1178 |
<xsl:message> |
| 1179 |
<xsl:text>ERROR: olink is missing linking attributes.</xsl:text> |
| 1180 |
</xsl:message> |
| 1181 |
</xsl:otherwise> |
| 1182 |
</xsl:choose> |
| 1183 |
</xsl:otherwise> |
| 1184 |
</xsl:choose> |
| 1185 |
</xsl:template> |
| 1186 |
|
| 1187 |
<xsl:template match="*" mode="pagenumber.markup"> |
| 1188 |
<!-- no-op in HTML --> |
| 1189 |
</xsl:template> |
| 1190 |
|
| 1191 |
<!-- ==================================================================== --> |
| 1192 |
|
| 1193 |
<xsl:template name="xref.xreflabel"> |
| 1194 |
<!-- called to process an xreflabel...you might use this to make --> |
| 1195 |
<!-- xreflabels come out in the right font for different targets, --> |
| 1196 |
<!-- for example. --> |
| 1197 |
<xsl:param name="target" select="."/> |
| 1198 |
<xsl:value-of select="$target/@xreflabel"/> |
| 1199 |
</xsl:template> |
| 1200 |
|
| 1201 |
<!-- ==================================================================== --> |
| 1202 |
|
| 1203 |
<xsl:template match="d:title" mode="xref"> |
| 1204 |
<xsl:apply-templates mode="no.anchor.mode"/> |
| 1205 |
</xsl:template> |
| 1206 |
|
| 1207 |
<xsl:template match="d:command" mode="xref"> |
| 1208 |
<xsl:call-template name="inline.boldseq"/> |
| 1209 |
</xsl:template> |
| 1210 |
|
| 1211 |
<xsl:template match="d:function" mode="xref"> |
| 1212 |
<xsl:call-template name="inline.monoseq"/> |
| 1213 |
</xsl:template> |
| 1214 |
|
| 1215 |
<!-- ==================================================================== --> |
| 1216 |
|
| 1217 |
<xsl:template match="*" mode="insert.title.markup"> |
| 1218 |
<xsl:param name="purpose"/> |
| 1219 |
<xsl:param name="xrefstyle"/> |
| 1220 |
<xsl:param name="title"/> |
| 1221 |
|
| 1222 |
<xsl:choose> |
| 1223 |
<xsl:when test="$purpose = 'xref'"> |
| 1224 |
<xsl:copy-of select="$title"/> |
| 1225 |
</xsl:when> |
| 1226 |
<xsl:otherwise> |
| 1227 |
<xsl:copy-of select="$title"/> |
| 1228 |
</xsl:otherwise> |
| 1229 |
</xsl:choose> |
| 1230 |
</xsl:template> |
| 1231 |
|
| 1232 |
<xsl:template match="d:chapter|d:appendix" mode="insert.title.markup"> |
| 1233 |
<xsl:param name="purpose"/> |
| 1234 |
<xsl:param name="xrefstyle"/> |
| 1235 |
<xsl:param name="title"/> |
| 1236 |
|
| 1237 |
<xsl:choose> |
| 1238 |
<xsl:when test="$purpose = 'xref'"> |
| 1239 |
<em> |
| 1240 |
<xsl:copy-of select="$title"/> |
| 1241 |
</em> |
| 1242 |
</xsl:when> |
| 1243 |
<xsl:otherwise> |
| 1244 |
<xsl:copy-of select="$title"/> |
| 1245 |
</xsl:otherwise> |
| 1246 |
</xsl:choose> |
| 1247 |
</xsl:template> |
| 1248 |
|
| 1249 |
<xsl:template match="*" mode="insert.subtitle.markup"> |
| 1250 |
<xsl:param name="purpose"/> |
| 1251 |
<xsl:param name="xrefstyle"/> |
| 1252 |
<xsl:param name="subtitle"/> |
| 1253 |
|
| 1254 |
<xsl:copy-of select="$subtitle"/> |
| 1255 |
</xsl:template> |
| 1256 |
|
| 1257 |
<xsl:template match="*" mode="insert.label.markup"> |
| 1258 |
<xsl:param name="purpose"/> |
| 1259 |
<xsl:param name="xrefstyle"/> |
| 1260 |
<xsl:param name="label"/> |
| 1261 |
|
| 1262 |
<xsl:copy-of select="$label"/> |
| 1263 |
</xsl:template> |
| 1264 |
|
| 1265 |
<xsl:template match="*" mode="insert.pagenumber.markup"> |
| 1266 |
<xsl:param name="purpose"/> |
| 1267 |
<xsl:param name="xrefstyle"/> |
| 1268 |
<xsl:param name="pagenumber"/> |
| 1269 |
|
| 1270 |
<xsl:copy-of select="$pagenumber"/> |
| 1271 |
</xsl:template> |
| 1272 |
|
| 1273 |
<xsl:template match="*" mode="insert.direction.markup"> |
| 1274 |
<xsl:param name="purpose"/> |
| 1275 |
<xsl:param name="xrefstyle"/> |
| 1276 |
<xsl:param name="direction"/> |
| 1277 |
|
| 1278 |
<xsl:copy-of select="$direction"/> |
| 1279 |
</xsl:template> |
| 1280 |
|
| 1281 |
<xsl:template match="*" mode="insert.olink.docname.markup"> |
| 1282 |
<xsl:param name="purpose"/> |
| 1283 |
<xsl:param name="xrefstyle"/> |
| 1284 |
<xsl:param name="docname"/> |
| 1285 |
|
| 1286 |
<span class="olinkdocname"> |
| 1287 |
<xsl:copy-of select="$docname"/> |
| 1288 |
</span> |
| 1289 |
|
| 1290 |
</xsl:template> |
| 1291 |
|
| 1292 |
</xsl:stylesheet> |