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