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