webhelp-common.xsl 42 KB

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