1<?xml version="1.0" encoding="US-ASCII"?> 2<!--This file was created automatically by xsl2profile--> 3<!--from the DocBook XSL stylesheets. Do not edit this file.--> 4<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns:exsl="http://exslt.org/common" xmlns:exslt="http://exslt.org/common" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="db ng exsl exslt" version="1.0"> 5 6<xsl:output method="html" encoding="ISO-8859-1" indent="no"/> 7 8<!-- ******************************************************************** 9 $Id: docbook.xsl,v 1.41 2006/04/21 14:37:19 nwalsh Exp $ 10 ******************************************************************** 11 12 This file is part of the XSL DocBook Stylesheet distribution. 13 See /README or http://nwalsh.com/docbook/xsl/ for copyright 14 and other information. 15 16 ******************************************************************** --> 17 18<!-- ==================================================================== --> 19 20<xsl:include href="/VERSION"/> 21<xsl:include href="param.xsl"/> 22<xsl:include href="/lib/lib.xsl"/> 23<xsl:include href="/common/l10n.xsl"/> 24<xsl:include href="/common/common.xsl"/> 25<xsl:include href="/common/labels.xsl"/> 26<xsl:include href="/common/titles.xsl"/> 27<xsl:include href="/common/subtitles.xsl"/> 28<xsl:include href="/common/gentext.xsl"/> 29<xsl:include href="/common/targets.xsl"/> 30<xsl:include href="/common/olink.xsl"/> 31<xsl:include href="/common/pi.xsl"/> 32<xsl:include href="autotoc.xsl"/> 33<xsl:include href="autoidx.xsl"/> 34<xsl:include href="lists.xsl"/> 35<xsl:include href="callout.xsl"/> 36<xsl:include href="verbatim.xsl"/> 37<xsl:include href="graphics.xsl"/> 38<xsl:include href="xref.xsl"/> 39<xsl:include href="formal.xsl"/> 40<xsl:include href="table.xsl"/> 41<xsl:include href="htmltbl.xsl"/> 42<xsl:include href="sections.xsl"/> 43<xsl:include href="inline.xsl"/> 44<xsl:include href="footnote.xsl"/> 45<xsl:include href="html.xsl"/> 46<xsl:include href="info.xsl"/> 47<xsl:include href="keywords.xsl"/> 48<xsl:include href="division.xsl"/> 49<xsl:include href="toc.xsl"/> 50<xsl:include href="index.xsl"/> 51<xsl:include href="refentry.xsl"/> 52<xsl:include href="math.xsl"/> 53<xsl:include href="admon.xsl"/> 54<xsl:include href="component.xsl"/> 55<xsl:include href="biblio.xsl"/> 56<xsl:include href="glossary.xsl"/> 57<xsl:include href="block.xsl"/> 58<xsl:include href="task.xsl"/> 59<xsl:include href="qandaset.xsl"/> 60<xsl:include href="synop.xsl"/> 61<xsl:include href="titlepage.xsl"/> 62<xsl:include href="titlepage.templates.xsl"/> 63<xsl:include href="pi.xsl"/> 64<xsl:include href="ebnf.xsl"/> 65<xsl:include href="chunker.xsl"/> 66<xsl:include href="html-rtf.xsl"/> 67<xsl:include href="docbookng.xsl"/> 68<xsl:include href="annotations.xsl"/> 69<xsl:include href="/common/stripns.xsl"/> 70 71<xsl:param name="stylesheet.result.type" select="'html'"/> 72<xsl:param name="htmlhelp.output" select="0"/> 73 74<!-- ==================================================================== --> 75 76<xsl:key name="id" match="*" use="@id|@xml:id"/> 77<xsl:key name="gid" match="*" use="generate-id()"/> 78 79<!-- ==================================================================== --> 80 81<xsl:template match="*"> 82 <xsl:message> 83 <xsl:text>No template matches </xsl:text> 84 <xsl:value-of select="name(.)"/> 85 <xsl:if test="parent::*"> 86 <xsl:text> in </xsl:text> 87 <xsl:value-of select="name(parent::*)"/> 88 </xsl:if> 89 <xsl:text>.</xsl:text> 90 </xsl:message> 91 92 <font color="red"> 93 <xsl:text><</xsl:text> 94 <xsl:value-of select="name(.)"/> 95 <xsl:text>></xsl:text> 96 <xsl:apply-templates/> 97 <xsl:text></</xsl:text> 98 <xsl:value-of select="name(.)"/> 99 <xsl:text>></xsl:text> 100 </font> 101</xsl:template> 102 103<xsl:template match="text()"> 104 <xsl:value-of select="."/> 105</xsl:template> 106 107<xsl:template name="body.attributes"> 108 <xsl:attribute name="bgcolor">white</xsl:attribute> 109 <xsl:attribute name="text">black</xsl:attribute> 110 <xsl:attribute name="link">#0000FF</xsl:attribute> 111 <xsl:attribute name="vlink">#840084</xsl:attribute> 112 <xsl:attribute name="alink">#0000FF</xsl:attribute> 113</xsl:template> 114 115<xsl:template name="head.content"> 116 <xsl:param name="node" select="."/> 117 <xsl:param name="title"> 118 <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/> 119 </xsl:param> 120 121 <title> 122 <xsl:copy-of select="$title"/> 123 </title> 124 125 <xsl:if test="$html.stylesheet != ''"> 126 <xsl:call-template name="output.html.stylesheets"> 127 <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/> 128 </xsl:call-template> 129 </xsl:if> 130 131 <xsl:if test="$link.mailto.url != ''"> 132 <link rev="made" href="{$link.mailto.url}"/> 133 </xsl:if> 134 135 <xsl:if test="$html.base != ''"> 136 <base href="{$html.base}"/> 137 </xsl:if> 138 139 <meta name="generator" content="DocBook XSL Stylesheets V{$VERSION}"/> 140 141 <xsl:if test="$generate.meta.abstract != 0"> 142 <xsl:variable name="info" select="(articleinfo |bookinfo |prefaceinfo |chapterinfo |appendixinfo |sectioninfo |sect1info |sect2info |sect3info |sect4info |sect5info |referenceinfo |refentryinfo |partinfo |info |docinfo)[1]"/> 143 <xsl:if test="$info and $info/abstract"> 144 <meta name="description"> 145 <xsl:attribute name="content"> 146 <xsl:for-each select="$info/abstract[1]/*"> 147 <xsl:value-of select="normalize-space(.)"/> 148 <xsl:if test="position() < last()"> 149 <xsl:text> </xsl:text> 150 </xsl:if> 151 </xsl:for-each> 152 </xsl:attribute> 153 </meta> 154 </xsl:if> 155 </xsl:if> 156 157 <xsl:if test="($draft.mode = 'yes' or ($draft.mode = 'maybe' and ancestor-or-self::*[@status][1]/@status = 'draft')) and $draft.watermark.image != ''"> 158 <style type="text/css"><xsl:text> 159body { background-image: url('</xsl:text> 160<xsl:value-of select="$draft.watermark.image"/><xsl:text>'); 161 background-repeat: no-repeat; 162 background-position: top left; 163 /* The following properties make the watermark "fixed" on the page. */ 164 /* I think that's just a bit too distracting for the reader... */ 165 /* background-attachment: fixed; */ 166 /* background-position: center center; */ 167 }</xsl:text> 168 </style> 169 </xsl:if> 170 <xsl:apply-templates select="." mode="head.keywords.content"/> 171</xsl:template> 172 173<xsl:template name="output.html.stylesheets"> 174 <xsl:param name="stylesheets" select="''"/> 175 176 <xsl:choose> 177 <xsl:when test="contains($stylesheets, ' ')"> 178 <link rel="stylesheet" href="{substring-before($stylesheets, ' ')}"> 179 <xsl:if test="$html.stylesheet.type != ''"> 180 <xsl:attribute name="type"> 181 <xsl:value-of select="$html.stylesheet.type"/> 182 </xsl:attribute> 183 </xsl:if> 184 </link> 185 <xsl:call-template name="output.html.stylesheets"> 186 <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/> 187 </xsl:call-template> 188 </xsl:when> 189 <xsl:when test="$stylesheets != ''"> 190 <link rel="stylesheet" href="{$stylesheets}"> 191 <xsl:if test="$html.stylesheet.type != ''"> 192 <xsl:attribute name="type"> 193 <xsl:value-of select="$html.stylesheet.type"/> 194 </xsl:attribute> 195 </xsl:if> 196 </link> 197 </xsl:when> 198 </xsl:choose> 199</xsl:template> 200 201<!-- ============================================================ --> 202 203<xsl:template match="*" mode="head.keywords.content"> 204 <xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/> 205 <xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/> 206 <xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/> 207 <xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/> 208 <xsl:apply-templates select="setinfo/keywordset" mode="html.header"/> 209 <xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/> 210 <xsl:apply-templates select="artheader/keywordset" mode="html.header"/> 211 <xsl:apply-templates select="sect1info/keywordset" mode="html.header"/> 212 <xsl:apply-templates select="sect2info/keywordset" mode="html.header"/> 213 <xsl:apply-templates select="sect3info/keywordset" mode="html.header"/> 214 <xsl:apply-templates select="sect4info/keywordset" mode="html.header"/> 215 <xsl:apply-templates select="sect5info/keywordset" mode="html.header"/> 216 <xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/> 217 <xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/> 218 <xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/> 219 <xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/> 220 <xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/> 221 <xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/> 222 <xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/> 223 <xsl:apply-templates select="partinfo/keywordset" mode="html.header"/> 224 <xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/> 225 <xsl:apply-templates select="docinfo/keywordset" mode="html.header"/> 226 <xsl:apply-templates select="info/keywordset" mode="html.header"/> 227 228 <xsl:if test="$inherit.keywords != 0 and parent::*"> 229 <xsl:apply-templates select="parent::*" mode="head.keywords.content"/> 230 </xsl:if> 231</xsl:template> 232 233<!-- ============================================================ --> 234 235<xsl:template name="system.head.content"> 236 <xsl:param name="node" select="."/> 237 238 <!-- FIXME: When chunking, only the annotations actually used 239 in this chunk should be referenced. I don't think it 240 does any harm to reference them all, but it adds 241 unnecessary bloat to each chunk. --> 242 <xsl:if test="$annotation.support != 0 and //annotation"> 243 <xsl:call-template name="add.annotation.links"/> 244 <script type="text/javascript"> 245 <xsl:text> 246// Create PopupWindow objects</xsl:text> 247 <xsl:for-each select="//annotation"> 248 <xsl:text> 249var popup_</xsl:text> 250 <xsl:value-of select="generate-id(.)"/> 251 <xsl:text> = new PopupWindow("popup-</xsl:text> 252 <xsl:value-of select="generate-id(.)"/> 253 <xsl:text>"); 254</xsl:text> 255 <xsl:text>popup_</xsl:text> 256 <xsl:value-of select="generate-id(.)"/> 257 <xsl:text>.offsetY = 15; 258</xsl:text> 259 <xsl:text>popup_</xsl:text> 260 <xsl:value-of select="generate-id(.)"/> 261 <xsl:text>.autoHide(); 262</xsl:text> 263 </xsl:for-each> 264 </script> 265 266 <style type="text/css"> 267 <xsl:value-of select="$annotation.css"/> 268 </style> 269 </xsl:if> 270 271 <!-- system.head.content is like user.head.content, except that 272 it is called before head.content. This is important because it 273 means, for example, that <style> elements output by system.head.content 274 have a lower CSS precedence than the users stylesheet. --> 275</xsl:template> 276 277<!-- ============================================================ --> 278 279<xsl:template name="user.preroot"> 280 <!-- Pre-root output, can be used to output comments and PIs. --> 281 <!-- This must not output any element content! --> 282</xsl:template> 283 284<xsl:template name="user.head.content"> 285 <xsl:param name="node" select="."/> 286</xsl:template> 287 288<xsl:template name="user.header.navigation"> 289 <xsl:param name="node" select="."/> 290</xsl:template> 291 292<xsl:template name="user.header.content"> 293 <xsl:param name="node" select="."/> 294</xsl:template> 295 296<xsl:template name="user.footer.content"> 297 <xsl:param name="node" select="."/> 298</xsl:template> 299 300<xsl:template name="user.footer.navigation"> 301 <xsl:param name="node" select="."/> 302</xsl:template> 303 304<xslo:include xmlns:xslo="http://www.w3.org/1999/XSL/Transform" href="/profiling/profile-mode.xsl"/><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content"><xslo:choose><xslo:when test="*/self::ng:* or */self::db:*"><xslo:message>Stripping NS from DocBook 5/NG document.</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>Processing stripped document.</xslo:message><xslo:apply-templates select="exslt:node-set($stripped-content)" mode="profile"/></xslo:when><xslo:otherwise><xslo:apply-templates select="/" mode="profile"/></xslo:otherwise></xslo:choose></xslo:variable><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" select="exslt:node-set($profiled-content)"/><xsl:template match="/"> 305 <xsl:choose> 306 <xsl:when test="false()"/> 307 <xsl:otherwise> 308 <xsl:choose> 309 <xsl:when test="$rootid != ''"> 310 <xsl:choose> 311 <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0"> 312 <xsl:message terminate="yes"> 313 <xsl:text>ID '</xsl:text> 314 <xsl:value-of select="$rootid"/> 315 <xsl:text>' not found in document.</xsl:text> 316 </xsl:message> 317 </xsl:when> 318 <xsl:otherwise> 319 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'"> 320 <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/> 321 </xsl:if> 322 <xsl:if test="$collect.xref.targets != 'only'"> 323 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/> 324 <xsl:if test="$tex.math.in.alt != ''"> 325 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/> 326 </xsl:if> 327 </xsl:if> 328 </xsl:otherwise> 329 </xsl:choose> 330 </xsl:when> 331 <xsl:otherwise> 332 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'"> 333 <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/> 334 </xsl:if> 335 <xsl:if test="$collect.xref.targets != 'only'"> 336 <xsl:apply-templates select="$profiled-nodes" mode="process.root"/> 337 <xsl:if test="$tex.math.in.alt != ''"> 338 <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/> 339 </xsl:if> 340 </xsl:if> 341 </xsl:otherwise> 342 </xsl:choose> 343 </xsl:otherwise> 344 </xsl:choose> 345</xsl:template> 346 347<xsl:template match="*" mode="process.root"> 348 <xsl:variable name="doc" select="self::*"/> 349 350 <xsl:call-template name="user.preroot"/> 351 <xsl:call-template name="root.messages"/> 352 353 <html> 354 <head> 355 <xsl:call-template name="system.head.content"> 356 <xsl:with-param name="node" select="$doc"/> 357 </xsl:call-template> 358 <xsl:call-template name="head.content"> 359 <xsl:with-param name="node" select="$doc"/> 360 </xsl:call-template> 361 <xsl:call-template name="user.head.content"> 362 <xsl:with-param name="node" select="$doc"/> 363 </xsl:call-template> 364 </head> 365 <body> 366 <xsl:call-template name="body.attributes"/> 367 <xsl:call-template name="user.header.content"> 368 <xsl:with-param name="node" select="$doc"/> 369 </xsl:call-template> 370 <xsl:apply-templates select="."/> 371 <xsl:call-template name="user.footer.content"> 372 <xsl:with-param name="node" select="$doc"/> 373 </xsl:call-template> 374 </body> 375 </html> 376</xsl:template> 377 378<xsl:template name="root.messages"> 379 <!-- redefine this any way you'd like to output messages --> 380 <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE --> 381</xsl:template> 382 383<!-- ==================================================================== --> 384 385<xsl:template name="chunk"> 386 <xsl:param name="node" select="."/> 387 388 <!-- The default is that we are not chunking... --> 389 <xsl:text>0</xsl:text> 390</xsl:template> 391 392<!-- ==================================================================== --> 393 394</xsl:stylesheet> 395