Whamcloud - gitweb
LUDOC-11 e2fsck: fix typo in description
[doc/manual.git] / webhelp / webhelp-common.xsl
1 <xsl:stylesheet
2         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3         xmlns:exsl="http://exslt.org/common"
4         xmlns:ng="http://docbook.org/docbook-ng" 
5         xmlns:db="http://docbook.org/ns/docbook"
6         version="1.0" xmlns="http://www.w3.org/1999/xhtml"
7         exclude-result-prefixes="exsl ng db">
8
9     <!-- ********************************************************************
10      $Id$
11      ******************************************************************** 
12
13      This file is part customization layer on top of the XSL DocBook
14      Stylesheet distribution that generates webhelp output.
15
16      ******************************************************************** -->
17
18     <xsl:param name="chunker.output.method">
19         <xsl:choose>
20             <xsl:when test="contains(system-property('xsl:vendor'), 'SAXON 6')">saxon:xhtml</xsl:when>
21             <xsl:otherwise>html</xsl:otherwise>
22         </xsl:choose>
23     </xsl:param>
24
25     <xsl:param name="doc.title">
26       <xsl:call-template name="get.doc.title"/>
27     </xsl:param>
28
29     <!-- Set some reasonable defaults for webhelp output -->
30     <xsl:param name="webhelp.common.dir">common/</xsl:param>
31     <xsl:param name="chunker.output.indent">yes</xsl:param>
32     <xsl:param name="navig.showtitles">0</xsl:param>
33     <xsl:param name="manifest.in.base.dir" select="0"/>
34     <xsl:param name="base.dir" select="concat($webhelp.base.dir,'/')"/>
35     <xsl:param name="suppress.navigation">0</xsl:param>
36     <!-- Generate the end-of-the-book index -->
37     <xsl:param name="generate.index" select="1"/>
38     <xsl:param name="inherit.keywords" select="'0'"/>
39     <xsl:param name="para.propagates.style" select="1"/>
40     <xsl:param name="phrase.propagates.style" select="1"/>
41     <xsl:param name="chunk.first.sections" select="1"/>
42     <xsl:param name="chunk.section.depth" select="3"/>
43     <xsl:param name="use.id.as.filename" select="1"/>
44     <xsl:param name="branding">not set</xsl:param>
45     <xsl:param name="brandname"> </xsl:param>
46
47     <xsl:param name="section.autolabel" select="0"/>
48     <xsl:param name="chapter.autolabel" select="0"/>
49     <xsl:param name="appendix.autolabel" select="0"/>
50     <xsl:param name="qandadiv.autolabel" select="0"/>
51     <xsl:param name="reference.autolabel" select="0"/>
52     <xsl:param name="part.autolabel" select="0"/>    
53     <xsl:param name="section.label.includes.component.label" select="1"/>
54
55     <xsl:param name="generate.section.toc.level" select="5"/>
56     <xsl:param name="component.label.includes.part.label" select="1"/>
57     <xsl:param name="suppress.footer.navigation">0</xsl:param>
58     <xsl:param name="callout.graphics.path"><xsl:value-of select="$webhelp.common.dir"/>images/callouts/</xsl:param>
59     <xsl:param name="callouts.extension">1</xsl:param>
60     <xsl:param name="admon.graphics.path"><xsl:value-of select="$webhelp.common.dir"/>images/admon/</xsl:param>
61     <xsl:param name="admon.graphics" select="0"/>
62     <!--xsl:param name="generate.toc">book toc</xsl:param-->
63
64 <xsl:param name="generate.toc">
65 appendix  toc,title
66 article/appendix  nop
67 article   toc,title
68 book      title,figure,table,example,equation
69 chapter   toc,title
70 part      toc,title
71 preface   toc,title
72 qandadiv  toc
73 qandaset  toc
74 reference toc,title
75 sect1     toc
76 sect2     toc
77 sect3     toc
78 sect4     toc
79 sect5     toc
80 section   toc
81 set       toc,title
82 </xsl:param>
83
84     <!-- Localizations of webhelp specific words. Your contributions for other languages are appreciated.
85         Currently, only around 10 translations needed. -->
86     <!-- Moved to files under 'gentext/locale/', search for WebHelp -->
87     
88     <xsl:template name="user.head.title">
89       <xsl:param name="node" select="."/>
90       <xsl:param name="title">
91         <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
92       </xsl:param>
93       <xsl:param name="document-title">
94         <xsl:apply-templates select="/*" mode="object.title.markup.textonly"/>
95       </xsl:param>
96
97       <title>
98                 <xsl:copy-of select="$title"/> - <xsl:if test="parent::*"> - <xsl:copy-of select="$document-title"/></xsl:if>
99        </title>
100         
101     </xsl:template>
102
103   <xsl:template name="system.head.content">
104   <xsl:param name="node" select="."/>
105 <xsl:text>
106 </xsl:text>
107        <!-- 
108 The meta tag tells the IE rendering engine that it should use the latest, or edge, version of the IE rendering environment;It prevents IE from entring compatibility mode.
109  -->
110        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
111         <xsl:text>
112 </xsl:text>
113         <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
114         <xsl:text>
115 </xsl:text>
116     </xsl:template>
117
118     <!-- HTML <head> section customizations --> 
119     <xsl:template name="user.head.content">
120         <xsl:param name="title">
121                 <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
122         </xsl:param>
123          <meta name="Section-title" content="{$title}"/>   
124
125         <!--  <xsl:message>
126             webhelp.tree.cookie.id = <xsl:value-of select="$webhelp.tree.cookie.id"/> +++ <xsl:value-of select="count(//node())"/>
127             $webhelp.indexer.language = <xsl:value-of select="$webhelp.indexer.language"/> +++ <xsl:value-of select="count(//node())"/>
128         </xsl:message>-->
129         <script type="text/javascript">
130             //The id for tree cookie
131             var treeCookieId = "<xsl:value-of select="$webhelp.tree.cookie.id"/>";
132             var language = "<xsl:value-of select="$webhelp.indexer.language"/>";
133             var w = new Object();
134             //Localization
135             txt_filesfound = '<xsl:call-template name="gentext.template">
136                 <xsl:with-param name="name" select="'txt_filesfound'"/>
137                 <xsl:with-param name="context" select="'webhelp'"/>
138                 </xsl:call-template>';
139             txt_enter_at_least_1_char = "<xsl:call-template name="gentext.template">
140                 <xsl:with-param name="name" select="'txt_enter_at_least_1_char'"/>
141                 <xsl:with-param name="context" select="'webhelp'"/>
142                 </xsl:call-template>";
143             txt_browser_not_supported = "<xsl:call-template name="gentext.template">
144                 <xsl:with-param name="name" select="'txt_browser_not_supported'"/>
145                 <xsl:with-param name="context" select="'webhelp'"/>
146                 </xsl:call-template>";
147             txt_please_wait = "<xsl:call-template name="gentext.template">
148                 <xsl:with-param name="name" select="'txt_please_wait'"/>
149                 <xsl:with-param name="context" select="'webhelp'"/>
150                 </xsl:call-template>";
151             txt_results_for = "<xsl:call-template name="gentext.template">
152                 <xsl:with-param name="name" select="'txt_results_for'"/>
153                 <xsl:with-param name="context" select="'webhelp'"/>
154                 </xsl:call-template>";
155         </script>
156
157 <!-- kasunbg: Order is important between the in-html-file css and the linked css files. Some css declarations in jquery-ui-1.8.2.custom.css are over-ridden. 
158      If that's a concern, just remove the additional css contents inside these default jquery css files. I thought of keeping them intact for easier maintenance! -->
159         <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
160         <link rel="stylesheet" type="text/css" href="{$webhelp.common.dir}css/positioning.css"/>
161         <link rel="stylesheet" type="text/css" href="{$webhelp.common.dir}jquery/theme-redmond/jquery-ui-1.8.2.custom.css"/>
162         <link rel="stylesheet" type="text/css" href="{$webhelp.common.dir}jquery/treeview/jquery.treeview.css"/>
163
164         <style type="text/css">
165
166 #noscript{
167     font-weight:bold;
168         background-color: #55AA55;
169     font-weight: bold;
170     height: 25spx;
171     z-index: 3000;
172         top:0px;
173         width:100%;
174         position: relative;
175         border-bottom: solid 5px black;
176         text-align:center;
177         color: white;
178 }
179
180 input {
181     margin-bottom: 5px;
182     margin-top: 2px;
183 }
184 .folder {
185     display: block;
186     height: 22px;
187     padding-left: 20px;
188     background: transparent url(<xsl:value-of select="$webhelp.common.dir"/>jquery/treeview/images/folder.gif) 0 0px no-repeat;
189 }
190 span.contentsTab {
191     padding-left: 20px;
192     background: url(<xsl:value-of select="$webhelp.common.dir"/>images/toc-icon.png) no-repeat 0 center;
193 }
194 span.searchTab {
195     padding-left: 20px;
196     background: url(<xsl:value-of select="$webhelp.common.dir"/>images/search-icon.png) no-repeat 0 center;
197 }
198
199 /* Overide jquery treeview's defaults for ul. */
200 .treeview ul {
201     background-color: transparent;
202     margin-top: 4px;
203 }               
204 #webhelp-currentid {
205     background-color: #D8D8D8 !important;
206 }
207 .treeview .hover { color: black; }
208 .filetree li span a { text-decoration: none; font-size: 12px; color: #517291; }
209
210 /* Override jquery-ui's default css customizations. These are supposed to take precedence over those.*/
211 .ui-widget-content {
212     border: 0px; 
213     background: none; 
214     color: none;     
215 }
216 .ui-widget-header {
217     color: #e9e8e9;
218     border-left: 1px solid #e5e5e5;
219     border-right: 1px solid #e5e5e5;
220     border-bottom: 1px solid #bbc4c5;
221     border-top: 4px solid #e5e5e5;
222     border: medium none;
223     background: #F4F4F4; /* old browsers */
224     background: -moz-linear-gradient(top, #F4F4F4 0%, #E6E4E5 100%); /* firefox */
225     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F4F4), color-stop(100%,#E6E4E5)); /* webkit */    
226     font-weight: none;
227 }
228 .ui-widget-header a { color: none; }
229 .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { 
230 border: none; background: none; font-weight: none; color: none; }
231 .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: black; text-decoration: none; }
232 .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: none; background: none; font-weight: none; color: none; }
233
234 .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: none; background: none; font-weight: none; color: none; }
235 .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { 
236     color: black; text-decoration: none;        
237     background: #C6C6C6; /* old browsers */
238     background: -moz-linear-gradient(top, #C6C6C6 0%, #D8D8D8 100%); /* firefox */
239     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#C6C6C6), color-stop(100%,#D8D8D8)); /* webkit */
240     -webkit-border-radius:15px; -moz-border-radius:10px;
241     border: 1px solid #f1f1f1;
242 }    
243 .ui-corner-all { border-radius: 0 0 0 0; }
244
245 .ui-tabs { padding: .2em;}
246 .ui-tabs .ui-tabs-nav li { top: 0px; margin: -2px 0 1px; text-transform: uppercase; font-size: 10.5px;}
247 .ui-tabs .ui-tabs-nav li a { padding: .25em 2em .25em 1em; margin: .5em; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
248        /**
249          *      Basic Layout Theme
250          * 
251          *      This theme uses the default layout class-names for all classes
252          *      Add any 'custom class-names', from options: paneClass, resizerClass, togglerClass
253          */
254
255         .ui-layout-pane { /* all 'panes' */ 
256                 background: #FFF; 
257                 border: 1px solid #BBB; 
258                 padding: 05x; 
259                 overflow: auto;
260         } 
261         
262         .ui-layout-resizer { /* all 'resizer-bars' */ 
263                 background: #DDD; 
264                 top:100px
265         } 
266
267         .ui-layout-toggler { /* all 'toggler-buttons' */ 
268                 background: #AAA; 
269         } 
270     
271        </style>
272         <xsl:comment><xsl:text>[if IE]>
273         &lt;link rel="stylesheet" type="text/css" href="../common/css/ie.css"/>
274         &lt;![endif]</xsl:text></xsl:comment>
275
276         <!-- 
277              browserDetect is an Oxygen addition to warn the user if they're using chrome from the file system.
278              This breaks the Oxygen search highlighting.
279         -->
280         <script type="text/javascript" src="{$webhelp.common.dir}browserDetect.js">
281             <xsl:comment> </xsl:comment>
282         </script>
283         <script type="text/javascript" src="{$webhelp.common.dir}jquery/jquery-1.7.2.min.js">
284             <xsl:comment> </xsl:comment>
285         </script>
286         <script type="text/javascript" src="{$webhelp.common.dir}jquery/jquery.ui.all.js">
287             <xsl:comment> </xsl:comment>
288         </script>
289         <script type="text/javascript" src="{$webhelp.common.dir}jquery/jquery.cookie.js">
290             <xsl:comment> </xsl:comment>
291         </script>
292         <script type="text/javascript" src="{$webhelp.common.dir}jquery/treeview/jquery.treeview.min.js">
293             <xsl:comment> </xsl:comment>
294         </script>
295          <script type="text/javascript" src="{$webhelp.common.dir}jquery/layout/jquery.layout.js">
296             <xsl:comment> </xsl:comment>
297         </script>
298         <xsl:if test="$webhelp.include.search.tab != '0'">
299             <!--Scripts/css stylesheets for Search-->
300             <!-- TODO: Why THREE files? There's absolutely no need for having separate files. 
301                 These should have been identified at the optimization phase! -->
302             <script type="text/javascript" src="search/l10n.js">
303             <xsl:comment/>
304           </script>
305       <script type="text/javascript" src="search/htmlFileInfoList.js">
306               <xsl:comment> </xsl:comment>
307           </script>
308           <script type="text/javascript" src="search/nwSearchFnt.js">
309               <xsl:comment> </xsl:comment>
310           </script>
311
312           <!--
313              NOTE: Stemmer javascript files should be in format <language>_stemmer.js.
314              For example, for English(en), source should be: "search/stemmers/en_stemmer.js"
315              For country codes, see: http://www.uspto.gov/patft/help/helpctry.htm
316           -->
317           <!--<xsl:message><xsl:value-of select="concat('search/stemmers/',$webhelp.indexer.language,'_stemmer.js')"/></xsl:message>-->
318           <script type="text/javascript" src="{concat('search/stemmers/',$webhelp.indexer.language,'_stemmer.js')}">
319               <xsl:comment>//make this scalable to other languages as well.</xsl:comment>
320           </script>
321
322           <!--Index Files:
323               Index is broken in to three equal sized(number of index items) files. This is to help parallel downloading
324               of files to make it faster.
325                 TODO: Generate webhelp index for largest docbook document that can be find, and analyze the file sizes.
326                 IF the file size is still around ~50KB for a given file, we should consider merging these files together. again.        
327           -->
328           <script type="text/javascript" src="search/index-1.js">
329               <xsl:comment> </xsl:comment>
330           </script>
331           <script type="text/javascript" src="search/index-2.js">
332               <xsl:comment> </xsl:comment>
333           </script>
334           <script type="text/javascript" src="search/index-3.js">
335               <xsl:comment> </xsl:comment>
336           </script>
337           <!--End of index files -->
338         </xsl:if>
339         <xsl:call-template name="user.webhelp.head.content"/>
340     </xsl:template>
341
342     <!-- This is for the USERS. Users who want to customize webhelp may over-ride this template to add content to <head>. -->
343     <xsl:template name="user.webhelp.head.content"/>
344
345     <xsl:template name="user.header.navigation">
346         <xsl:param name="prev"/>
347         <xsl:param name="next"/>
348         <xsl:param name="nav.context"/>
349         <xsl:call-template name="webhelpheader">
350             <xsl:with-param name="prev" select="$prev"/>
351             <xsl:with-param name="next" select="$next"/>
352             <xsl:with-param name="nav.context" select="$nav.context"/>
353         </xsl:call-template>
354         <!--xsl:call-template name="webhelptoc"/-->
355
356         <!--testing toc in the content page>
357         <xsl:call-template name="webhelptoctoc"/>
358         <xsl:if test="$webhelp.include.search.tab != '0'">
359             <xsl:call-template name="search"/>
360         </xsl:if-->
361     </xsl:template>
362
363     <xsl:template name="user.header.content">
364         <xsl:comment> <!-- KEEP this code. --> </xsl:comment>
365     </xsl:template>
366
367     <xsl:template name="user.footer.navigation">
368         <xsl:call-template name="webhelptoc">
369                   <xsl:with-param name="currentid" select="generate-id(.)"/>
370              </xsl:call-template>
371     </xsl:template>
372
373   <xsl:template match="/">
374         <xsl:message>language: <xsl:value-of select="$webhelp.indexer.language"/> </xsl:message>
375         <!-- * Get a title for current doc so that we let the user -->
376         <!-- * know what document we are processing at this point. -->
377         <xsl:choose>
378           <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
379           toss the namespace and continue.  Use the docbook5 namespaced
380           stylesheets for DocBook5 if you don't want to use this feature.-->
381           <!-- include extra test for Xalan quirk -->
382           <xsl:when test="$exsl.node.set.available != 0 and 
383                   namespace-uri(/*) = 'http://docbook.org/ns/docbook'">
384                 <xsl:call-template name="log.message">
385                   <xsl:with-param name="level">Note</xsl:with-param>
386                   <xsl:with-param name="source" select="$doc.title"/>
387                   <xsl:with-param name="context-desc">
388                         <xsl:text>namesp. cut</xsl:text>
389                   </xsl:with-param>
390                   <xsl:with-param name="message">
391                         <xsl:text>stripped namespace before processing</xsl:text>
392                   </xsl:with-param>
393                 </xsl:call-template>
394                 <xsl:variable name="nons">
395         <xsl:apply-templates mode="stripNS"/>
396       </xsl:variable>
397                 <!--
398                 <xsl:message>Saving stripped document.</xsl:message>
399                 <xsl:call-template name="write.chunk">
400         <xsl:with-param name="filename" select="'/tmp/stripped.xml'"/>
401         <xsl:with-param name="method" select="'xml'"/>
402         <xsl:with-param name="content">
403                 <xsl:copy-of select="exsl:node-set($nons)"/>
404           </xsl:with-param>
405       </xsl:call-template>
406                 -->
407                 <xsl:apply-templates select="exsl:node-set($nons)"/>
408           </xsl:when>
409           <!-- Can't process unless namespace fixed with exsl node-set()-->
410           <xsl:when test="namespace-uri(/*) = 'http://docbook.org/ns/docbook'">
411             <xsl:message terminate="yes">
412               <xsl:text>Unable to strip the namespace from DB5 document,</xsl:text>
413               <xsl:text> cannot proceed.</xsl:text>
414             </xsl:message>
415           </xsl:when>
416           <xsl:otherwise>
417                 <xsl:choose>
418                   <xsl:when test="$rootid != ''">
419                         <xsl:choose>
420                           <xsl:when test="count(key('id',$rootid)) = 0">
421                                 <xsl:message terminate="yes">
422                                   <xsl:text>ID '</xsl:text>
423                                   <xsl:value-of select="$rootid"/>
424                                   <xsl:text>' not found in document.</xsl:text>
425                                 </xsl:message>
426                           </xsl:when>
427                           <xsl:otherwise>
428                                 <xsl:if test="$collect.xref.targets = 'yes' or                             $collect.xref.targets = 'only'">
429                                   <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
430                                 </xsl:if>
431                                 <xsl:if test="$collect.xref.targets != 'only'">
432                                   <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
433                                   <xsl:if test="$tex.math.in.alt != ''">
434                                         <xsl:apply-templates select="key('id',$rootid)" mode="collect.tex.math"/>
435                                   </xsl:if>
436                                 </xsl:if>
437                           </xsl:otherwise>
438                         </xsl:choose>
439                   </xsl:when>
440                   <xsl:otherwise>
441                         <xsl:if test="$collect.xref.targets = 'yes' or                         $collect.xref.targets = 'only'">
442                           <xsl:apply-templates select="/" mode="collect.targets"/>
443                         </xsl:if>
444                         <xsl:if test="$collect.xref.targets != 'only'">
445                           <xsl:apply-templates select="/" mode="process.root"/>
446                           <xsl:if test="$tex.math.in.alt != ''">
447               <xsl:apply-templates select="/" mode="collect.tex.math"/>
448             </xsl:if>
449           </xsl:if>
450                   </xsl:otherwise>
451                 </xsl:choose>
452           </xsl:otherwise>
453         </xsl:choose>
454         
455
456         <xsl:if test="$collect.xref.targets != 'only'">
457           <xsl:call-template name="l10n.js"/>
458         </xsl:if>
459     </xsl:template>
460
461
462     <!-- The WebHelp output structure. similar to main() method.
463         basic format:
464         <html>
465                 <head> calls-appropriate-template </head>
466                 <body> 
467                        some-generic-content
468                        <div id="content"> 
469                                 All your docbook document content goes here
470                                 ....
471                        </div>
472                        some-other-generic-content-at-footer             
473                 </body>
474         </html>
475     --> 
476     <xsl:template name="chunk-element-content">
477         <xsl:param name="prev"/>
478         <xsl:param name="next"/>
479         <xsl:param name="nav.context"/>
480         <xsl:param name="content">
481             <xsl:apply-imports/>
482         </xsl:param>
483
484         <xsl:call-template name="user.preroot"/>
485
486         <html>
487             <xsl:call-template name="html.head">
488                 <xsl:with-param name="prev" select="$prev"/>
489                 <xsl:with-param name="next" select="$next"/>
490             </xsl:call-template>
491
492             <body>
493                 <noscript>
494                     <div id="noscript">
495
496                         <xsl:call-template name="gentext.template">
497                             <xsl:with-param name="name" select="'txt_browser_not_supported'"/>
498                             <xsl:with-param name="context" select="'webhelp'"/>
499                         </xsl:call-template>
500
501                     </div>
502                 </noscript>
503
504                 <xsl:call-template name="body.attributes"/>
505
506                 <xsl:call-template name="user.header.navigation">
507                     <xsl:with-param name="prev" select="$prev"/>
508                     <xsl:with-param name="next" select="$next"/>
509                     <xsl:with-param name="nav.context" select="$nav.context"/>
510                 </xsl:call-template>
511
512                 <div id="content">
513
514                     <xsl:call-template name="user.header.content"/>
515
516                                         <xsl:call-template name='condition-decorator'>
517                                                 <xsl:with-param name='content' select="$content"/>
518                                         </xsl:call-template>
519                                                 
520                     <xsl:call-template name="user.footer.content"/>
521
522                                         <!-- Redundant since the upper navigation bar always visible -->
523                     <xsl:call-template name="footer.navigation">
524                         <xsl:with-param name="prev" select="$prev"/>
525                         <xsl:with-param name="next" select="$next"/>
526                         <xsl:with-param name="nav.context" select="$nav.context"/>
527                     </xsl:call-template>
528
529                     <xsl:call-template name="user.webhelp.content.footer"/>
530                 </div>
531
532                 <xsl:call-template name="user.footer.navigation"/>
533             </body>
534         </html>
535         <xsl:value-of select="$chunk.append"/>
536     </xsl:template>
537
538     <!-- This is for the USERS. Users who want to customize webhelp may over-ride this template to add content to the footer of the content DIV. 
539          i.e. within <div id="content"> ... </div> -->
540     <xsl:template name="user.webhelp.content.footer"/>
541
542     <!-- The Header with the company logo -->
543     <xsl:template name="webhelpheader">
544         <xsl:param name="prev"/>
545         <xsl:param name="next"/>
546         <xsl:param name="nav.context"/>
547
548         <xsl:variable name="home" select="/*[1]"/>
549         <xsl:variable name="up" select="parent::*"/>
550
551         <div id="header">
552             <xsl:call-template name="webhelpheader.logo"/>
553             <!-- Display the page title and the main heading(parent) of it-->
554             <h1>
555               <xsl:apply-templates select="/*[1]" mode="title.markup"/>
556               <br/>
557                 <xsl:choose>
558                     <xsl:when
559                         test="count($up) &gt; 0 and generate-id($up) != generate-id($home)">
560                       <xsl:apply-templates select="$up" mode="object.title.markup"/>
561                     </xsl:when>
562                     <xsl:when test="not(generate-id(.) = generate-id(/*))">
563                       <xsl:apply-templates select="." mode="object.title.markup"/>
564                     </xsl:when>
565                     <xsl:otherwise>&#160;</xsl:otherwise>
566                 </xsl:choose>
567             </h1>
568             <!-- Prev and Next links generation-->
569             <div id="navheader">
570               <xsl:call-template name="user.webhelp.navheader.content"/>
571                 <xsl:comment>
572                     <!-- KEEP this code. In case of neither prev nor next links are available, this will help to
573                         keep the integrity of the DOM tree-->
574                 </xsl:comment>
575                 <!--xsl:with-param name="prev" select="$prev"/>
576                 <xsl:with-param name="next" select="$next"/>
577                 <xsl:with-param name="nav.context" select="$nav.context"/-->
578                 <table class="navLinks">
579                     <tr>
580                         <td>
581                             <a id="showHideButton" href="#" onclick="myLayout.toggle('west')"
582                                 class="pointLeft" tabindex="5" title="Hide TOC tree">Sidebar
583                             </a>
584                         </td>
585                         <xsl:if test="count($prev) &gt; 0
586                             or (count($up) &gt; 0
587                             and generate-id($up) != generate-id($home)
588                             and $navig.showtitles != 0)
589                             or count($next) &gt; 0">
590                             <td>
591                                 <xsl:if test="count($prev)>0">
592                                     <a accesskey="p" class="navLinkPrevious" tabindex="5">
593                                         <xsl:attribute name="href">
594                                             <xsl:call-template name="href.target">
595                                                 <xsl:with-param name="object" select="$prev"/>
596                                             </xsl:call-template>
597                                         </xsl:attribute>
598                                         <xsl:call-template name="navig.content">
599                                             <xsl:with-param name="direction" select="'prev'"/>
600                                         </xsl:call-template>
601                                     </a>
602                                 </xsl:if>
603
604                                 <!-- "Up" link-->
605                                 <xsl:choose>
606                                     <xsl:when test="count($up)&gt;0
607                                               and generate-id($up) != generate-id($home)">
608                                         |
609                                         <a accesskey="u" class="navLinkUp" tabindex="5">
610                                             <xsl:attribute name="href">
611                                                 <xsl:call-template name="href.target">
612                                                     <xsl:with-param name="object" select="$up"/>
613                                                 </xsl:call-template>
614                                             </xsl:attribute>
615                                             <xsl:call-template name="navig.content">
616                                                 <xsl:with-param name="direction" select="'up'"/>
617                                             </xsl:call-template>
618                                         </a>
619                                     </xsl:when>
620                                     <xsl:otherwise>&#160;</xsl:otherwise>
621                                 </xsl:choose>
622                                 
623                                 <xsl:if test="count($next)>0">
624                                     |
625                                     <a accesskey="n" class="navLinkNext" tabindex="5">
626                                         <xsl:attribute name="href">
627                                             <xsl:call-template name="href.target">
628                                                 <xsl:with-param name="object" select="$next"/>
629                                             </xsl:call-template>
630                                         </xsl:attribute>
631                                         <xsl:call-template name="navig.content">
632                                             <xsl:with-param name="direction" select="'next'"/>
633                                         </xsl:call-template>
634                                     </a>
635                                 </xsl:if>
636                             </td>
637                         </xsl:if>
638                     </tr>
639                 </table>
640             </div>
641         </div>
642     </xsl:template>
643
644     <xsl:template name="webhelpheader.logo">
645         <a href="index.html">
646         <img style='margin-right: 2px; height: 59px; padding-right: 25px; padding-top: 8px' align="right"
647             src='{$webhelp.common.dir}images/logo.png' alt="{$brandname} Documentation"/>
648         </a>
649     </xsl:template>
650
651     <xsl:template name="user.webhelp.navheader.content"/>
652
653     <xsl:template name="webhelptoc">
654         <xsl:param name="currentid"/>
655         <xsl:choose>
656             <xsl:when test="$rootid != ''">
657                 <xsl:variable name="title">
658                     <xsl:if test="$webhelp.autolabel=1">
659                         <xsl:variable name="label.markup">
660                             <xsl:apply-templates select="key('id',$rootid)" mode="label.markup"/>
661                         </xsl:variable>
662                         <xsl:if test="normalize-space($label.markup)">
663                             <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
664                         </xsl:if>
665                     </xsl:if>
666                     <xsl:apply-templates select="key('id',$rootid)" mode="titleabbrev.markup"/>
667                 </xsl:variable>
668                 <xsl:variable name="href">
669                     <xsl:choose>
670                         <xsl:when test="$manifest.in.base.dir != 0">
671                             <xsl:call-template name="href.target">
672                                 <xsl:with-param name="object" select="key('id',$rootid)"/>
673                             </xsl:call-template>
674                         </xsl:when>
675                         <xsl:otherwise>
676                             <xsl:call-template name="href.target.with.base.dir">
677                                 <xsl:with-param name="object" select="key('id',$rootid)"/>
678                             </xsl:call-template>
679                         </xsl:otherwise>
680                     </xsl:choose>
681                 </xsl:variable>
682             </xsl:when>
683
684             <xsl:otherwise>
685                 <xsl:variable name="title">
686                     <xsl:if test="$webhelp.autolabel=1">
687                         <xsl:variable name="label.markup">
688                             <xsl:apply-templates select="/*" mode="label.markup"/>
689                         </xsl:variable>
690                         <xsl:if test="normalize-space($label.markup)">
691                             <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
692                         </xsl:if>
693                     </xsl:if>
694                     <xsl:apply-templates select="/*" mode="titleabbrev.markup"/>
695                 </xsl:variable>
696                 <xsl:variable name="href">
697                     <xsl:choose>
698                         <xsl:when test="$manifest.in.base.dir != 0">
699                             <xsl:call-template name="href.target">
700                                 <xsl:with-param name="object" select="/"/>
701                             </xsl:call-template>
702                         </xsl:when>
703                         <xsl:otherwise>
704                             <xsl:call-template name="href.target.with.base.dir">
705                                 <xsl:with-param name="object" select="/"/>
706                             </xsl:call-template>
707                         </xsl:otherwise>
708                     </xsl:choose>
709                 </xsl:variable>
710
711                 <div id="sidebar"> <!--#sidebar id is used for showing and hiding the side bar -->
712                     <div id="leftnavigation" style="padding-top:3px;">
713                         <div id="tabs">
714                             <ul>
715                                 <li>
716                                     <a href="#treeDiv" style="outline:0;" tabindex="1">
717                                         <span class="contentsTab">
718                                             <xsl:call-template name="gentext.template">
719                                                 <xsl:with-param name="name" select="'TableofContents'"/>
720                                                 <xsl:with-param name="context" select="'webhelp'"/>
721                                             </xsl:call-template>
722                                         </span>
723                                     </a>
724                                 </li>
725                                 <xsl:if test="$webhelp.include.search.tab != '0'">
726                                     <li>
727                                         <a href="#searchDiv" style="outline:0;" tabindex="1" onclick="doSearch()">
728                                             <span class="searchTab">
729                                                 <xsl:call-template name="gentext.template">
730                                                     <xsl:with-param name="name" select="'Search'"/>
731                                                     <xsl:with-param name="context" select="'webhelp'"/>
732                                                 </xsl:call-template>
733                                             </span>
734                                         </a>
735                                     </li>
736                                 </xsl:if>
737                                 <xsl:call-template name="user.webhelp.tabs.title"/>
738                             </ul>
739                             <div id="treeDiv">
740                                 <img src="{$webhelp.common.dir}images/loading.gif" alt="loading table of contents..."
741                                      id="tocLoading" style="display:block;"/>
742                                 <div id="ulTreeDiv" style="display:none">
743                                     <ul id="tree" class="filetree">
744                                         <xsl:apply-templates select="/*/*" mode="webhelptoc">
745                                             <xsl:with-param name="currentid" select="$currentid"/>
746                                         </xsl:apply-templates>
747                                     </ul>
748                                 </div>
749
750                             </div>
751                             <xsl:if test="$webhelp.include.search.tab != '0'">
752                                 <div id="searchDiv">
753                                     <div id="search">
754                                         <form onsubmit="Verifie(searchForm);return false"
755                                             name="searchForm" class="searchForm">
756                                             <div>
757                                                 
758 <!--                                                    <xsl:call-template name="gentext.template">
759                                                         <xsl:with-param name="name" select="'Search'"/>
760                                                         <xsl:with-param name="context" select="'webhelp'"/>
761                                                     </xsl:call-template>-->
762                                                 
763                                                 
764                                                     <input id="textToSearch" name="textToSearch" type="search" placeholder="Search"
765                                                            class="searchText" tabindex="1"/>
766                                                     <xsl:text disable-output-escaping="yes"> <![CDATA[&nbsp;]]> </xsl:text>
767                                                     <input onclick="Verifie(searchForm)" type="button"
768                                                            class="searchButton"
769                                                            value="Go" id="doSearch" tabindex="1"/>
770                                                 
771                                             </div>
772                                         </form>
773                                     </div>
774                                     <div id="searchResults">
775                                            <center> </center>
776                                     </div>
777                                     <p class="searchHighlight"><a href="#" onclick="toggleHighlight()">Search Highlighter (On/Off)</a></p>
778                                 </div>
779                             </xsl:if>
780                             <xsl:call-template name="user.webhelp.tabs.content"/>
781                         </div>
782                     </div>
783                 </div>
784             </xsl:otherwise>
785         </xsl:choose>
786     </xsl:template>
787
788     <!-- Hooks for adding customs tabs -->
789     <xsl:template name="user.webhelp.tabs.title"/>
790     <xsl:template name="user.webhelp.tabs.content"/>
791
792     <!-- Generates the webhelp table-of-contents (TOC). -->
793     <xsl:template
794             match="book|part|reference|preface|chapter|bibliography|appendix|article|topic|glossary|section|simplesect|sect1|sect2|sect3|sect4|sect5|refentry|colophon|bibliodiv|index|setindex"
795             mode="webhelptoc">
796         <xsl:param name="currentid"/>
797         <xsl:variable name="title">
798             <xsl:if test="$webhelp.autolabel=1">
799                 <xsl:variable name="label.markup">
800                     <xsl:apply-templates select="." mode="label.markup"/>
801                 </xsl:variable>
802                 <xsl:if test="normalize-space($label.markup)">
803                     <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
804                 </xsl:if>
805             </xsl:if>
806             <xsl:apply-templates select="." mode="titleabbrev.markup"/>
807         </xsl:variable>
808
809         <xsl:variable name="href">
810             <xsl:choose>
811                 <xsl:when test="$manifest.in.base.dir != 0">
812                     <xsl:call-template name="href.target"/>
813                 </xsl:when>
814                 <xsl:otherwise>
815                     <xsl:call-template name="href.target.with.base.dir"/>
816                 </xsl:otherwise>
817             </xsl:choose>
818         </xsl:variable>
819
820         <xsl:variable name="id" select="generate-id(.)"/>
821
822         <xsl:if test="not(self::index) or (self::index and not($generate.index = 0))">
823             <!--li style="white-space: pre; line-height: 0em;"-->
824             <li>
825                 <xsl:if test="$id = $currentid">
826                     <xsl:attribute name="id">webhelp-currentid</xsl:attribute>
827                 </xsl:if>
828                 <span class="file">
829                     <a href="{substring-after($href, $base.dir)}"  tabindex="1">
830                         <xsl:value-of select="$title"/>
831                                                 <xsl:call-template name="condition-title">
832                                 <xsl:with-param name="condition" select="@condition"/>
833                                                 </xsl:call-template>
834                     </a>
835                 </span>
836                 <xsl:if test="part|reference|preface|chapter|bibliography|appendix|article|topic|glossary|section|simplesect|sect1|sect2|sect3|sect4|sect5|refentry|colophon|bibliodiv">
837                     <ul>
838                         <xsl:apply-templates
839                                 select="part|reference|preface|chapter|bibliography|appendix|article|topic|glossary|section|simplesect|sect1|sect2|sect3|sect4|sect5|refentry|colophon|bibliodiv"
840                                 mode="webhelptoc">
841                             <xsl:with-param name="currentid" select="$currentid"/>
842                         </xsl:apply-templates>
843                     </ul>
844                 </xsl:if>
845             </li>
846         </xsl:if>
847     </xsl:template>
848
849     <xsl:template match="text()" mode="webhelptoc"/>
850
851     <xsl:template name="user.footer.content">
852         <script type="text/javascript" src="{$webhelp.common.dir}main.js">
853             <xsl:comment> </xsl:comment>
854         </script>
855         <script type="text/javascript" src="{$webhelp.common.dir}splitterInit.js">
856             <xsl:comment> </xsl:comment>
857         </script>
858     </xsl:template>
859  
860     <!-- Generates index.html file at docs/. This is simply a redirection to content/$default.topic --> 
861     <xsl:template name="index.html">
862         <xsl:variable name="default.topic">
863             <xsl:choose>
864                 <xsl:when test="$webhelp.default.topic != ''">
865                     <xsl:value-of select="$webhelp.default.topic"/>
866                 </xsl:when>
867                 <xsl:when test="$htmlhelp.default.topic != ''">
868                     <xsl:value-of select="$htmlhelp.default.topic"/>
869                 </xsl:when>
870                 <xsl:otherwise>
871                     <xsl:call-template name="make-relative-filename">
872                         <xsl:with-param name="base.dir"/>
873                         <xsl:with-param name="base.name">
874                             <xsl:choose>
875                                 <xsl:when test="$rootid != ''">
876                                     <xsl:apply-templates select="key('id',$rootid)" mode="chunk-filename"/>
877                                 </xsl:when>
878                                 <xsl:otherwise>
879                                     <xsl:apply-templates
880                                             select="*/*[self::preface|self::chapter|self::appendix|self::part][1]"
881                                             mode="chunk-filename"/>
882                                 </xsl:otherwise>
883                             </xsl:choose>
884                         </xsl:with-param>
885                     </xsl:call-template>
886                 </xsl:otherwise>
887             </xsl:choose>
888         </xsl:variable>
889         <xsl:call-template name="write.chunk">
890             <xsl:with-param name="filename">
891                 <!--       <xsl:if test="$manifest.in.base.dir != 0"> -->
892                 <!--         <xsl:value-of select="$base.dir"/> -->
893                 <!--       </xsl:if> -->
894                 <xsl:choose>
895                     <xsl:when test="$webhelp.start.filename">
896                         <xsl:value-of select="concat($webhelp.base.dir,'/',$webhelp.start.filename)"/>
897                     </xsl:when>
898                     <xsl:otherwise>
899                         <xsl:value-of select="'index.html'"/>
900                     </xsl:otherwise>
901                 </xsl:choose>
902             </xsl:with-param>
903             <xsl:with-param name="method" select="'xml'"/>
904             <xsl:with-param name="encoding" select="'utf-8'"/>
905             <xsl:with-param name="indent" select="'yes'"/>
906             <xsl:with-param name="content">
907                 <html>
908                     <head>
909                       <link rel="shortcut icon" href="favicon.ico"/>
910                       <meta http-equiv="Refresh" content="1; URL=content/{$default.topic}"/>
911                       <title><xsl:value-of select="//title[1]"/>&#160;</title>
912                     </head>
913                     <body>
914                       If not automatically redirected, click <a href="content/{$default.topic}">content/<xsl:value-of select="$default.topic"/></a>
915                     </body>
916                 </html>
917             </xsl:with-param>
918         </xsl:call-template>
919     </xsl:template>
920
921     <xsl:template name="l10n.js">
922         <xsl:call-template name="write.chunk">
923             <xsl:with-param name="filename">
924               <xsl:value-of select="concat($base.dir,'search/l10n.js')"/>
925             </xsl:with-param>
926             <xsl:with-param name="method" select="'text'"/>
927             <xsl:with-param name="encoding" select="'utf-8'"/>
928             <xsl:with-param name="indent" select="'no'"/>
929             <xsl:with-param name="content">
930               //Resource strings for localization
931               var localeresource = new Object;
932               localeresource["search_no_results"]="<xsl:call-template name="gentext.template">
933                 <xsl:with-param name="name" select="'Your_search_returned_no_results'"/>
934                 <xsl:with-param name="context" select="'webhelp'"/>
935                 </xsl:call-template>";
936             </xsl:with-param>
937         </xsl:call-template>    
938     </xsl:template>
939
940 </xsl:stylesheet> 
941