source: trunk/Distribution/XSL/htmlhelp/htmlhelp-common.xsl@ 3

Last change on this file since 3 was 2, checked in by jkacer, 18 years ago

Added all DocBook Framework stuff:

  • DocBook DTD
  • Transformation software FOP 0.20.5 and Saxon 6
  • XSL styles
  • Rexx scripts

Also added some WarpIN-related stuff for creation of WarpIN installation packages.
This state corresponds to version 1.0.0 from November 2005, just slightly modified to carry versioning information (Rexx scripts).

File size: 44.5 KB
Line 
1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
4 xmlns:exsl="http://exslt.org/common"
5 xmlns:set="http://exslt.org/sets"
6 xmlns:h="urn:x-hex"
7 version="1.0"
8 exclude-result-prefixes="doc exsl set h">
9
10<!-- ********************************************************************
11 $Id: htmlhelp-common.xsl,v 1.31 2005/06/21 07:50:58 kosek Exp $
12 ******************************************************************** -->
13
14<!-- ==================================================================== -->
15<!-- Customizations of standard HTML stylesheet parameters -->
16
17<!-- no navigation on pages by default, HTML Help provides its own navigation controls -->
18<xsl:param name="suppress.navigation" select="1"/>
19
20<!-- no separate HTML page with index, index is built inside CHM index pane -->
21<xsl:param name="generate.index" select="0"/>
22
23<!-- ==================================================================== -->
24
25<xsl:variable name="htmlhelp.generate.index" select="//indexterm[1]"/>
26
27<!-- Set up HTML Help flag -->
28<xsl:variable name="htmlhelp.output" select="1"/>
29
30<xsl:variable name="raw.help.title">
31 <xsl:choose>
32 <xsl:when test="$htmlhelp.title = ''">
33 <xsl:choose>
34 <xsl:when test="$rootid != ''">
35 <xsl:apply-templates select="key('id',$rootid)" mode="title.markup"/>
36 </xsl:when>
37 <xsl:otherwise>
38 <xsl:apply-templates select="/*" mode="title.markup"/>
39 </xsl:otherwise>
40 </xsl:choose>
41 </xsl:when>
42 <xsl:otherwise>
43 <xsl:value-of select="$htmlhelp.title"/>
44 </xsl:otherwise>
45 </xsl:choose>
46</xsl:variable>
47
48<xsl:variable name="help.title" select="normalize-space($raw.help.title)"/>
49
50<!-- ==================================================================== -->
51
52<xsl:template match="/">
53 <xsl:if test="$htmlhelp.only != 1">
54 <xsl:choose>
55 <xsl:when test="$rootid != ''">
56 <xsl:choose>
57 <xsl:when test="count(key('id',$rootid)) = 0">
58 <xsl:message terminate="yes">
59 <xsl:text>ID '</xsl:text>
60 <xsl:value-of select="$rootid"/>
61 <xsl:text>' not found in document.</xsl:text>
62 </xsl:message>
63 </xsl:when>
64 <xsl:otherwise>
65 <xsl:message>Formatting from <xsl:value-of select="$rootid"/></xsl:message>
66 <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
67 </xsl:otherwise>
68 </xsl:choose>
69 </xsl:when>
70 <xsl:otherwise>
71 <xsl:apply-templates select="/" mode="process.root"/>
72 </xsl:otherwise>
73 </xsl:choose>
74 </xsl:if>
75
76 <xsl:call-template name="hhp"/>
77 <xsl:call-template name="hhc"/>
78 <xsl:if test="($rootid = '' and //processing-instruction('dbhh')) or
79 ($rootid != '' and key('id',$rootid)//processing-instruction('dbhh'))">
80 <xsl:call-template name="hh-map"/>
81 <xsl:call-template name="hh-alias"/>
82 </xsl:if>
83 <xsl:if test="$htmlhelp.generate.index">
84 <xsl:call-template name="hhk"/>
85 </xsl:if>
86</xsl:template>
87
88<!-- ==================================================================== -->
89
90<xsl:template name="hhp">
91 <xsl:call-template name="write.text.chunk">
92 <xsl:with-param name="filename">
93 <xsl:if test="$manifest.in.base.dir != 0">
94 <xsl:value-of select="$base.dir"/>
95 </xsl:if>
96 <xsl:value-of select="$htmlhelp.hhp"/>
97 </xsl:with-param>
98 <xsl:with-param name="method" select="'text'"/>
99 <xsl:with-param name="content">
100 <xsl:call-template name="hhp-main"/>
101 </xsl:with-param>
102 <xsl:with-param name="encoding" select="$htmlhelp.encoding"/>
103 </xsl:call-template>
104</xsl:template>
105
106<!-- ==================================================================== -->
107<xsl:template name="hhp-main">
108<xsl:variable name="default.topic">
109 <xsl:choose>
110 <xsl:when test="$htmlhelp.default.topic != ''">
111 <xsl:value-of select="$htmlhelp.default.topic"/>
112 </xsl:when>
113 <xsl:otherwise>
114 <xsl:call-template name="make-relative-filename">
115 <xsl:with-param name="base.dir">
116 <xsl:if test="$manifest.in.base.dir = 0">
117 <xsl:value-of select="$base.dir"/>
118 </xsl:if>
119 </xsl:with-param>
120 <xsl:with-param name="base.name">
121 <xsl:choose>
122 <xsl:when test="$rootid != ''">
123 <xsl:apply-templates select="key('id',$rootid)" mode="chunk-filename"/>
124 </xsl:when>
125 <xsl:otherwise>
126 <xsl:apply-templates select="/" mode="chunk-filename"/>
127 </xsl:otherwise>
128 </xsl:choose>
129 </xsl:with-param>
130 </xsl:call-template>
131 </xsl:otherwise>
132 </xsl:choose>
133</xsl:variable>
134<xsl:variable name="xnavigation">
135 <xsl:text>0x</xsl:text>
136 <xsl:call-template name="toHex">
137 <xsl:with-param name="n" select="9504 + $htmlhelp.show.menu * 65536
138 + $htmlhelp.show.advanced.search * 131072
139 + $htmlhelp.show.favorities * 4096
140 + (1 - $htmlhelp.show.toolbar.text) * 64
141 + $htmlhelp.remember.window.position * 262144"/>
142 </xsl:call-template>
143</xsl:variable>
144<xsl:variable name="xbuttons">
145 <xsl:text>0x</xsl:text>
146 <xsl:call-template name="toHex">
147 <xsl:with-param name="n" select="0 + $htmlhelp.button.hideshow * 2
148 + $htmlhelp.button.back * 4
149 + $htmlhelp.button.forward * 8
150 + $htmlhelp.button.stop * 16
151 + $htmlhelp.button.refresh * 32
152 + $htmlhelp.button.home * 64
153 + $htmlhelp.button.options * 4096
154 + $htmlhelp.button.print * 8192
155 + $htmlhelp.button.locate * 2048
156 + $htmlhelp.button.jump1 * 262144
157 + $htmlhelp.button.jump2 * 524288
158 + $htmlhelp.button.next * 2097152
159 + $htmlhelp.button.prev * 4194304
160 + $htmlhelp.button.zoom * 1048576"/>
161 </xsl:call-template>
162</xsl:variable>
163<xsl:text>[OPTIONS]
164</xsl:text>
165<xsl:if test="$htmlhelp.generate.index">
166<xsl:text>Auto Index=Yes
167</xsl:text></xsl:if>
168<xsl:if test="$htmlhelp.hhc.binary != 0">
169<xsl:text>Binary TOC=Yes
170</xsl:text></xsl:if>
171<xsl:text>Compatibility=1.1 or later
172Compiled file=</xsl:text><xsl:value-of select="$htmlhelp.chm"/><xsl:text>
173Contents file=</xsl:text><xsl:value-of select="$htmlhelp.hhc"/><xsl:text>
174</xsl:text>
175<xsl:if test="$htmlhelp.hhp.window != ''">
176<xsl:text>Default Window=</xsl:text><xsl:value-of select="$htmlhelp.hhp.window"/><xsl:text>
177</xsl:text></xsl:if>
178<xsl:text>Default topic=</xsl:text><xsl:value-of select="$default.topic"/>
179<xsl:text>
180Display compile progress=</xsl:text>
181 <xsl:choose>
182 <xsl:when test="$htmlhelp.display.progress != 1">
183 <xsl:text>No</xsl:text>
184 </xsl:when>
185 <xsl:otherwise>
186 <xsl:text>Yes</xsl:text>
187 </xsl:otherwise>
188 </xsl:choose>
189<xsl:text>
190Full-text search=Yes
191</xsl:text>
192<xsl:if test="$htmlhelp.generate.index">
193<xsl:text>Index file=</xsl:text><xsl:value-of select="$htmlhelp.hhk"/><xsl:text>
194</xsl:text></xsl:if>
195<xsl:text>Language=</xsl:text>
196<xsl:for-each select="*"> <!-- Change context from / to root element -->
197 <xsl:call-template name="gentext.template">
198 <xsl:with-param name="context" select="'htmlhelp'"/>
199 <xsl:with-param name="name" select="'langcode'"/>
200 </xsl:call-template>
201</xsl:for-each>
202<xsl:text>
203Title=</xsl:text>
204 <xsl:value-of select="$help.title"/>
205<xsl:text>
206Enhanced decompilation=</xsl:text>
207 <xsl:choose>
208 <xsl:when test="$htmlhelp.enhanced.decompilation != 0">
209 <xsl:text>Yes</xsl:text>
210 </xsl:when>
211 <xsl:otherwise>
212 <xsl:text>No</xsl:text>
213 </xsl:otherwise>
214 </xsl:choose>
215
216<xsl:if test="$htmlhelp.hhp.window != ''">
217 <xsl:text>
218
219[WINDOWS]
220</xsl:text>
221<xsl:value-of select="$htmlhelp.hhp.window"/>
222<xsl:text>="</xsl:text>
223<xsl:value-of select="$help.title"/>
224<xsl:text>","</xsl:text><xsl:value-of select="$htmlhelp.hhc"/>
225<xsl:text>",</xsl:text>
226<xsl:if test="$htmlhelp.generate.index">
227 <xsl:text>"</xsl:text>
228 <xsl:value-of select="$htmlhelp.hhk"/>
229 <xsl:text>"</xsl:text>
230</xsl:if>
231<xsl:text>,"</xsl:text>
232<xsl:value-of select="$default.topic"/>
233<xsl:text>",</xsl:text>
234<xsl:text>"</xsl:text>
235<xsl:choose>
236 <xsl:when test="$htmlhelp.button.home != 0">
237 <xsl:value-of select="$htmlhelp.button.home.url"/>
238 </xsl:when>
239 <xsl:otherwise>
240 <xsl:value-of select="$default.topic"/>
241 </xsl:otherwise>
242</xsl:choose>
243<xsl:text>"</xsl:text>
244<xsl:text>,</xsl:text>
245<xsl:if test="$htmlhelp.button.jump1 != 0">
246 <xsl:text>"</xsl:text>
247 <xsl:value-of select="$htmlhelp.button.jump1.url"/>
248 <xsl:text>"</xsl:text>
249</xsl:if>
250<xsl:text>,</xsl:text>
251<xsl:if test="$htmlhelp.button.jump1 != 0">
252 <xsl:text>"</xsl:text>
253 <xsl:value-of select="$htmlhelp.button.jump1.title"/>
254 <xsl:text>"</xsl:text>
255</xsl:if>
256<xsl:text>,</xsl:text>
257<xsl:if test="$htmlhelp.button.jump2 != 0">
258 <xsl:text>"</xsl:text>
259 <xsl:value-of select="$htmlhelp.button.jump2.url"/>
260 <xsl:text>"</xsl:text>
261</xsl:if>
262<xsl:text>,</xsl:text>
263<xsl:if test="$htmlhelp.button.jump2 != 0">
264 <xsl:text>"</xsl:text>
265 <xsl:value-of select="$htmlhelp.button.jump2.title"/>
266 <xsl:text>"</xsl:text>
267</xsl:if>
268<xsl:text>,</xsl:text>
269<xsl:value-of select="$xnavigation"/>
270<xsl:text>,</xsl:text><xsl:value-of select="$htmlhelp.hhc.width"/><xsl:text>,</xsl:text>
271<xsl:value-of select="$xbuttons"/>
272<xsl:text>,</xsl:text><xsl:value-of select="$htmlhelp.window.geometry"/><xsl:text>,,,,,,,0
273</xsl:text>
274</xsl:if>
275
276<!--
277 Needs more investigation to generate propetly all fields
278<xsl:text>search="</xsl:text>
279<xsl:value-of select="normalize-space(//title[1])"/>
280<xsl:text>","toc.hhc","index.hhk","</xsl:text>
281<xsl:value-of select="$root.filename"/>
282<xsl:text>.html","</xsl:text>
283<xsl:value-of select="$root.filename"/>
284<xsl:text>.html",,,,,</xsl:text>
285<xsl:value-of select="$xnavigation"/>
286<xsl:text>,</xsl:text>
287<xsl:value-of select="$htmlhelp.hhc.width"/>
288<xsl:text>,</xsl:text>
289<xsl:value-of select="$xbuttons"/>
290<xsl:text>,</xsl:text>
291<xsl:value-of select="$htmlhelp.window.geometry"/>
292<xsl:text>,,,,,2,,0
293</xsl:text>
294-->
295
296<xsl:if test="$htmlhelp.hhp.windows">
297 <xsl:value-of select="$htmlhelp.hhp.windows"/>
298</xsl:if>
299<xsl:text>
300
301[FILES]
302</xsl:text>
303
304<xsl:choose>
305 <xsl:when test="$rootid != ''">
306 <xsl:apply-templates select="key('id',$rootid)" mode="enumerate-files"/>
307 </xsl:when>
308 <xsl:otherwise>
309 <xsl:apply-templates select="/" mode="enumerate-files"/>
310 </xsl:otherwise>
311</xsl:choose>
312
313<xsl:if test="$htmlhelp.enumerate.images">
314 <xsl:variable name="imagelist">
315 <xsl:choose>
316 <xsl:when test="$rootid != ''">
317 <xsl:apply-templates select="key('id',$rootid)" mode="enumerate-images"/>
318 </xsl:when>
319 <xsl:otherwise>
320 <xsl:apply-templates select="/" mode="enumerate-images"/>
321 </xsl:otherwise>
322 </xsl:choose>
323 </xsl:variable>
324 <xsl:choose>
325 <xsl:when test="function-available('exsl:node-set') and function-available('set:distinct')">
326 <xsl:for-each select="set:distinct(exsl:node-set($imagelist)/filename)">
327 <xsl:value-of select="."/>
328 <xsl:text>&#10;</xsl:text>
329 </xsl:for-each>
330 </xsl:when>
331 <xsl:otherwise>
332 <xsl:value-of select="$imagelist"/>
333 </xsl:otherwise>
334 </xsl:choose>
335</xsl:if>
336
337<xsl:if test="($htmlhelp.force.map.and.alias != 0) or
338 ($rootid = '' and //processing-instruction('dbhh')) or
339 ($rootid != '' and key('id',$rootid)//processing-instruction('dbhh'))">
340 <xsl:text>
341[ALIAS]
342#include </xsl:text><xsl:value-of select="$htmlhelp.alias.file"/><xsl:text>
343
344[MAP]
345#include </xsl:text><xsl:value-of select="$htmlhelp.map.file"/><xsl:text>
346</xsl:text>
347</xsl:if>
348
349<xsl:value-of select="$htmlhelp.hhp.tail"/>
350</xsl:template>
351
352<!-- ==================================================================== -->
353
354<xsl:template match="graphic|inlinegraphic[@format!='linespecific']" mode="enumerate-images">
355 <xsl:call-template name="write.filename.enumerate-images">
356 <xsl:with-param name="filename">
357 <xsl:call-template name="mediaobject.filename.enumerate-images">
358 <xsl:with-param name="object" select="."/>
359 </xsl:call-template>
360 </xsl:with-param>
361 </xsl:call-template>
362</xsl:template>
363
364<xsl:template match="mediaobject|inlinemediaobject" mode="enumerate-images">
365 <xsl:call-template name="select.mediaobject.enumerate-images"/>
366</xsl:template>
367
368<xsl:template name="select.mediaobject.enumerate-images">
369 <xsl:param name="olist"
370 select="imageobject|imageobjectco
371 |videoobject|audioobject|textobject"/>
372 <xsl:param name="count">1</xsl:param>
373
374 <xsl:if test="$count &lt;= count($olist)">
375 <xsl:variable name="object" select="$olist[position()=$count]"/>
376
377 <xsl:variable name="useobject">
378 <xsl:choose>
379 <!-- The phrase is never used -->
380 <xsl:when test="name($object)='textobject' and $object/phrase">
381 <xsl:text>0</xsl:text>
382 </xsl:when>
383 <!-- The first textobject is a reasonable fallback (but not for image in HH) -->
384 <xsl:when test="name($object)='textobject'">
385 <xsl:text>0</xsl:text>
386 </xsl:when>
387 <!-- If there's only one object, use it -->
388 <xsl:when test="$count = 1 and count($olist) = 1">
389 <xsl:text>1</xsl:text>
390 </xsl:when>
391 <!-- Otherwise, see if this one is a useable graphic -->
392 <xsl:otherwise>
393 <xsl:choose>
394 <!-- peek inside imageobjectco to simplify the test -->
395 <xsl:when test="local-name($object) = 'imageobjectco'">
396 <xsl:call-template name="is.acceptable.mediaobject">
397 <xsl:with-param name="object" select="$object/imageobject"/>
398 </xsl:call-template>
399 </xsl:when>
400 <xsl:otherwise>
401 <xsl:call-template name="is.acceptable.mediaobject">
402 <xsl:with-param name="object" select="$object"/>
403 </xsl:call-template>
404 </xsl:otherwise>
405 </xsl:choose>
406 </xsl:otherwise>
407 </xsl:choose>
408 </xsl:variable>
409
410 <xsl:choose>
411 <xsl:when test="$useobject='1' and $object[not(*/@format='linespecific')]">
412 <xsl:call-template name="write.filename.enumerate-images">
413 <xsl:with-param name="filename">
414 <xsl:call-template name="mediaobject.filename.enumerate-images">
415 <xsl:with-param name="object" select="$object"/>
416 </xsl:call-template>
417 </xsl:with-param>
418 </xsl:call-template>
419 </xsl:when>
420 <xsl:otherwise>
421 <xsl:call-template name="select.mediaobject.enumerate-images">
422 <xsl:with-param name="olist" select="$olist"/>
423 <xsl:with-param name="count" select="$count + 1"/>
424 </xsl:call-template>
425 </xsl:otherwise>
426 </xsl:choose>
427 </xsl:if>
428</xsl:template>
429
430<xsl:template name="mediaobject.filename.enumerate-images">
431 <xsl:param name="object"/>
432
433 <xsl:variable name="urifilename">
434 <xsl:call-template name="mediaobject.filename">
435 <xsl:with-param name="object" select="$object"/>
436 </xsl:call-template>
437 </xsl:variable>
438
439 <xsl:variable name="filename">
440 <xsl:choose>
441 <xsl:when test="starts-with($urifilename, 'file:/')">
442 <xsl:value-of select="substring-after($urifilename, 'file:/')"/>
443 </xsl:when>
444 <xsl:otherwise>
445 <xsl:value-of select="$urifilename"/>
446 </xsl:otherwise>
447 </xsl:choose>
448 </xsl:variable>
449
450 <xsl:value-of select="translate($filename, '/', '\')"/>
451
452</xsl:template>
453
454<xsl:template match="text()" mode="enumerate-images">
455</xsl:template>
456
457<xsl:template name="write.filename.enumerate-images">
458 <xsl:param name="filename"/>
459 <xsl:choose>
460 <xsl:when test="function-available('exsl:node-set') and function-available('set:distinct')">
461 <filename><xsl:value-of select="$filename"/></filename>
462 </xsl:when>
463 <xsl:otherwise>
464 <xsl:value-of select="$filename"/>
465 <xsl:text>&#10;</xsl:text>
466 </xsl:otherwise>
467 </xsl:choose>
468</xsl:template>
469
470<!-- ==================================================================== -->
471
472<!-- Following templates are not nice. It is because MS help compiler is unable
473 to process correct HTML files. We must generate following weird
474 stuff instead. -->
475
476<xsl:template name="hhc">
477 <xsl:call-template name="write.text.chunk">
478 <xsl:with-param name="filename">
479 <xsl:if test="$manifest.in.base.dir != 0">
480 <xsl:value-of select="$base.dir"/>
481 </xsl:if>
482 <xsl:value-of select="$htmlhelp.hhc"/>
483 </xsl:with-param>
484 <xsl:with-param name="method" select="'text'"/>
485 <xsl:with-param name="content">
486 <xsl:call-template name="hhc-main"/>
487 </xsl:with-param>
488 <xsl:with-param name="encoding" select="$htmlhelp.encoding"/>
489 </xsl:call-template>
490</xsl:template>
491
492<xsl:template name="hhc-main">
493 <xsl:text disable-output-escaping="yes">&lt;HTML&gt;
494&lt;HEAD&gt;
495&lt;/HEAD&gt;
496 &lt;BODY&gt;
497</xsl:text>
498 <xsl:if test="$htmlhelp.hhc.folders.instead.books != 0">
499 <xsl:text disable-output-escaping="yes">&lt;OBJECT type="text/site properties"&gt;
500 &lt;param name="ImageType" value="Folder"&gt;
501&lt;/OBJECT&gt;
502</xsl:text>
503 </xsl:if>
504 <xsl:if test="$htmlhelp.hhc.show.root != 0">
505<xsl:text disable-output-escaping="yes">&lt;UL&gt;
506</xsl:text>
507 </xsl:if>
508
509 <xsl:choose>
510 <xsl:when test="$rootid != ''">
511 <xsl:apply-templates select="key('id',$rootid)" mode="hhc"/>
512 </xsl:when>
513 <xsl:otherwise>
514 <xsl:apply-templates select="/" mode="hhc"/>
515 </xsl:otherwise>
516 </xsl:choose>
517
518 <xsl:if test="$htmlhelp.hhc.show.root != 0">
519 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;
520</xsl:text>
521 </xsl:if>
522 <xsl:text disable-output-escaping="yes">&lt;/BODY&gt;
523&lt;/HTML&gt;</xsl:text>
524</xsl:template>
525
526<xsl:template match="set" mode="hhc">
527 <xsl:variable name="title">
528 <xsl:if test="$htmlhelp.autolabel=1">
529 <xsl:variable name="label.markup">
530 <xsl:apply-templates select="." mode="label.markup"/>
531 </xsl:variable>
532 <xsl:if test="normalize-space($label.markup)">
533 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
534 </xsl:if>
535 </xsl:if>
536 <xsl:call-template name="escape-attr">
537 <xsl:with-param name="value">
538 <xsl:apply-templates select="." mode="title.markup"/>
539 </xsl:with-param>
540 </xsl:call-template>
541 </xsl:variable>
542
543 <xsl:if test="$htmlhelp.hhc.show.root != 0">
544 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
545 &lt;param name="Name" value="</xsl:text>
546 <xsl:value-of select="normalize-space($title)"/>
547 <xsl:text disable-output-escaping="yes">"&gt;
548 &lt;param name="Local" value="</xsl:text>
549 <xsl:call-template name="href.target.with.base.dir"/>
550 <xsl:text disable-output-escaping="yes">"&gt;
551 &lt;/OBJECT&gt;</xsl:text>
552 </xsl:if>
553 <xsl:if test="book">
554 <xsl:variable name="toc.params">
555 <xsl:call-template name="find.path.params">
556 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
557 </xsl:call-template>
558 </xsl:variable>
559 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
560 <xsl:if test="contains($toc.params, 'toc') and $htmlhelp.hhc.show.root = 0">
561 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
562 &lt;param name="Name" value="</xsl:text>
563 <xsl:call-template name="gentext">
564 <xsl:with-param name="key" select="'TableofContents'"/>
565 </xsl:call-template>
566 <xsl:text disable-output-escaping="yes">"&gt;
567 &lt;param name="Local" value="</xsl:text>
568 <xsl:call-template name="href.target.with.base.dir"/>
569 <xsl:text disable-output-escaping="yes">"&gt;
570 &lt;/OBJECT&gt;</xsl:text>
571 </xsl:if>
572 <xsl:apply-templates select="book" mode="hhc"/>
573 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
574 </xsl:if>
575</xsl:template>
576
577<xsl:template match="book" mode="hhc">
578 <xsl:variable name="title">
579 <xsl:if test="$htmlhelp.autolabel=1">
580 <xsl:variable name="label.markup">
581 <xsl:apply-templates select="." mode="label.markup"/>
582 </xsl:variable>
583 <xsl:if test="normalize-space($label.markup)">
584 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
585 </xsl:if>
586 </xsl:if>
587 <xsl:call-template name="escape-attr">
588 <xsl:with-param name="value">
589 <xsl:apply-templates select="." mode="title.markup"/>
590 </xsl:with-param>
591 </xsl:call-template>
592 </xsl:variable>
593
594 <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
595 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
596 &lt;param name="Name" value="</xsl:text>
597 <xsl:value-of select="normalize-space($title)"/>
598 <xsl:text disable-output-escaping="yes">"&gt;
599 &lt;param name="Local" value="</xsl:text>
600 <xsl:call-template name="href.target.with.base.dir"/>
601 <xsl:text disable-output-escaping="yes">"&gt;
602 &lt;/OBJECT&gt;</xsl:text>
603 </xsl:if>
604 <xsl:if test="part|reference|preface|chapter|appendix|bibliography|article|colophon|glossary">
605 <xsl:variable name="toc.params">
606 <xsl:call-template name="find.path.params">
607 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
608 </xsl:call-template>
609 </xsl:variable>
610 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
611 <xsl:if test="contains($toc.params, 'toc') and $htmlhelp.hhc.show.root = 0 and not(parent::*)">
612 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
613 &lt;param name="Name" value="</xsl:text>
614 <xsl:call-template name="gentext">
615 <xsl:with-param name="key" select="'TableofContents'"/>
616 </xsl:call-template>
617 <xsl:text disable-output-escaping="yes">"&gt;
618 &lt;param name="Local" value="</xsl:text>
619 <xsl:call-template name="href.target.with.base.dir"/>
620 <xsl:text disable-output-escaping="yes">"&gt;
621 &lt;/OBJECT&gt;</xsl:text>
622 </xsl:if>
623 <xsl:apply-templates select="part|reference|preface|chapter|bibliography|appendix|article|colophon|glossary"
624 mode="hhc"/>
625 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
626 </xsl:if>
627</xsl:template>
628
629<xsl:template match="part|reference|preface|chapter|bibliography|appendix|article|glossary"
630 mode="hhc">
631 <xsl:variable name="title">
632 <xsl:if test="$htmlhelp.autolabel=1">
633 <xsl:variable name="label.markup">
634 <xsl:apply-templates select="." mode="label.markup"/>
635 </xsl:variable>
636 <xsl:if test="normalize-space($label.markup)">
637 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
638 </xsl:if>
639 </xsl:if>
640 <xsl:call-template name="escape-attr">
641 <xsl:with-param name="value">
642 <xsl:apply-templates select="." mode="title.markup"/>
643 </xsl:with-param>
644 </xsl:call-template>
645 </xsl:variable>
646
647 <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
648 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
649 &lt;param name="Name" value="</xsl:text>
650 <xsl:value-of select="normalize-space($title)"/>
651 <xsl:text disable-output-escaping="yes">"&gt;
652 &lt;param name="Local" value="</xsl:text>
653 <xsl:call-template name="href.target.with.base.dir"/>
654 <xsl:text disable-output-escaping="yes">"&gt;
655 &lt;/OBJECT&gt;</xsl:text>
656 </xsl:if>
657 <xsl:if test="reference|preface|chapter|appendix|refentry|section|sect1|bibliodiv">
658 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
659 <xsl:apply-templates
660 select="reference|preface|chapter|appendix|refentry|section|sect1|bibliodiv"
661 mode="hhc"/>
662 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
663 </xsl:if>
664</xsl:template>
665
666<xsl:template match="section" mode="hhc">
667 <xsl:variable name="title">
668 <xsl:if test="$htmlhelp.autolabel=1">
669 <xsl:variable name="label.markup">
670 <xsl:apply-templates select="." mode="label.markup"/>
671 </xsl:variable>
672 <xsl:if test="normalize-space($label.markup)">
673 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
674 </xsl:if>
675 </xsl:if>
676 <xsl:call-template name="escape-attr">
677 <xsl:with-param name="value">
678 <xsl:apply-templates select="." mode="title.markup"/>
679 </xsl:with-param>
680 </xsl:call-template>
681 </xsl:variable>
682
683 <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
684 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
685 &lt;param name="Name" value="</xsl:text>
686 <xsl:value-of select="normalize-space($title)"/>
687 <xsl:text disable-output-escaping="yes">"&gt;
688 &lt;param name="Local" value="</xsl:text>
689 <xsl:call-template name="href.target.with.base.dir"/>
690 <xsl:text disable-output-escaping="yes">"&gt;
691 &lt;/OBJECT&gt;</xsl:text>
692 </xsl:if>
693 <xsl:if test="section[count(ancestor::section) &lt; $htmlhelp.hhc.section.depth]|refentry">
694 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
695 <xsl:apply-templates select="section|refentry" mode="hhc"/>
696 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
697 </xsl:if>
698</xsl:template>
699
700<xsl:template match="sect1" mode="hhc">
701 <xsl:variable name="title">
702 <xsl:if test="$htmlhelp.autolabel=1">
703 <xsl:variable name="label.markup">
704 <xsl:apply-templates select="." mode="label.markup"/>
705 </xsl:variable>
706 <xsl:if test="normalize-space($label.markup)">
707 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
708 </xsl:if>
709 </xsl:if>
710 <xsl:call-template name="escape-attr">
711 <xsl:with-param name="value">
712 <xsl:apply-templates select="." mode="title.markup"/>
713 </xsl:with-param>
714 </xsl:call-template>
715 </xsl:variable>
716
717 <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
718 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
719 &lt;param name="Name" value="</xsl:text>
720 <xsl:value-of select="normalize-space($title)"/>
721 <xsl:text disable-output-escaping="yes">"&gt;
722 &lt;param name="Local" value="</xsl:text>
723 <xsl:call-template name="href.target.with.base.dir"/>
724 <xsl:text disable-output-escaping="yes">"&gt;
725 &lt;/OBJECT&gt;</xsl:text>
726 </xsl:if>
727 <xsl:if test="sect2[$htmlhelp.hhc.section.depth > 1]|refentry">
728 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
729 <xsl:apply-templates select="sect2|refentry"
730 mode="hhc"/>
731 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
732 </xsl:if>
733</xsl:template>
734
735<xsl:template match="sect2" mode="hhc">
736 <xsl:variable name="title">
737 <xsl:if test="$htmlhelp.autolabel=1">
738 <xsl:variable name="label.markup">
739 <xsl:apply-templates select="." mode="label.markup"/>
740 </xsl:variable>
741 <xsl:if test="normalize-space($label.markup)">
742 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
743 </xsl:if>
744 </xsl:if>
745 <xsl:call-template name="escape-attr">
746 <xsl:with-param name="value">
747 <xsl:apply-templates select="." mode="title.markup"/>
748 </xsl:with-param>
749 </xsl:call-template>
750 </xsl:variable>
751
752 <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
753 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
754 &lt;param name="Name" value="</xsl:text>
755 <xsl:value-of select="normalize-space($title)"/>
756 <xsl:text disable-output-escaping="yes">"&gt;
757 &lt;param name="Local" value="</xsl:text>
758 <xsl:call-template name="href.target.with.base.dir"/>
759 <xsl:text disable-output-escaping="yes">"&gt;
760 &lt;/OBJECT&gt;</xsl:text>
761 </xsl:if>
762 <xsl:if test="sect3[$htmlhelp.hhc.section.depth > 2]|refentry">
763 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
764 <xsl:apply-templates select="sect3|refentry"
765 mode="hhc"/>
766 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
767 </xsl:if>
768</xsl:template>
769
770<xsl:template match="sect3" mode="hhc">
771 <xsl:variable name="title">
772 <xsl:if test="$htmlhelp.autolabel=1">
773 <xsl:variable name="label.markup">
774 <xsl:apply-templates select="." mode="label.markup"/>
775 </xsl:variable>
776 <xsl:if test="normalize-space($label.markup)">
777 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
778 </xsl:if>
779 </xsl:if>
780 <xsl:call-template name="escape-attr">
781 <xsl:with-param name="value">
782 <xsl:apply-templates select="." mode="title.markup"/>
783 </xsl:with-param>
784 </xsl:call-template>
785 </xsl:variable>
786
787 <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
788 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
789 &lt;param name="Name" value="</xsl:text>
790 <xsl:value-of select="normalize-space($title)"/>
791 <xsl:text disable-output-escaping="yes">"&gt;
792 &lt;param name="Local" value="</xsl:text>
793 <xsl:call-template name="href.target.with.base.dir"/>
794 <xsl:text disable-output-escaping="yes">"&gt;
795 &lt;/OBJECT&gt;</xsl:text>
796 </xsl:if>
797 <xsl:if test="sect4[$htmlhelp.hhc.section.depth > 3]|refentry">
798 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
799 <xsl:apply-templates select="sect4|refentry"
800 mode="hhc"/>
801 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
802 </xsl:if>
803</xsl:template>
804
805<xsl:template match="sect4" mode="hhc">
806 <xsl:variable name="title">
807 <xsl:if test="$htmlhelp.autolabel=1">
808 <xsl:variable name="label.markup">
809 <xsl:apply-templates select="." mode="label.markup"/>
810 </xsl:variable>
811 <xsl:if test="normalize-space($label.markup)">
812 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
813 </xsl:if>
814 </xsl:if>
815 <xsl:call-template name="escape-attr">
816 <xsl:with-param name="value">
817 <xsl:apply-templates select="." mode="title.markup"/>
818 </xsl:with-param>
819 </xsl:call-template>
820 </xsl:variable>
821
822 <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
823 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
824 &lt;param name="Name" value="</xsl:text>
825 <xsl:value-of select="normalize-space($title)"/>
826 <xsl:text disable-output-escaping="yes">"&gt;
827 &lt;param name="Local" value="</xsl:text>
828 <xsl:call-template name="href.target.with.base.dir"/>
829 <xsl:text disable-output-escaping="yes">"&gt;
830 &lt;/OBJECT&gt;</xsl:text>
831 </xsl:if>
832 <xsl:if test="sect5[$htmlhelp.hhc.section.depth > 4]|refentry">
833 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
834 <xsl:apply-templates select="sect5|refentry"
835 mode="hhc"/>
836 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
837 </xsl:if>
838</xsl:template>
839
840<xsl:template match="sect5|refentry|colophon|bibliodiv" mode="hhc">
841 <xsl:variable name="title">
842 <xsl:if test="$htmlhelp.autolabel=1">
843 <xsl:variable name="label.markup">
844 <xsl:apply-templates select="." mode="label.markup"/>
845 </xsl:variable>
846 <xsl:if test="normalize-space($label.markup)">
847 <xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
848 </xsl:if>
849 </xsl:if>
850 <xsl:call-template name="escape-attr">
851 <xsl:with-param name="value">
852 <xsl:apply-templates select="." mode="title.markup"/>
853 </xsl:with-param>
854 </xsl:call-template>
855 </xsl:variable>
856
857 <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
858 <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT type="text/sitemap"&gt;
859 &lt;param name="Name" value="</xsl:text>
860 <xsl:value-of select="normalize-space($title)"/>
861 <xsl:text disable-output-escaping="yes">"&gt;
862 &lt;param name="Local" value="</xsl:text>
863 <xsl:call-template name="href.target.with.base.dir"/>
864 <xsl:text disable-output-escaping="yes">"&gt;
865 &lt;/OBJECT&gt;</xsl:text>
866 </xsl:if>
867 <xsl:if test="refentry">
868 <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
869 <xsl:apply-templates select="refentry"
870 mode="hhc"/>
871 <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
872 </xsl:if>
873</xsl:template>
874
875<!-- ==================================================================== -->
876
877<xsl:template match="indexterm">
878 <xsl:choose>
879 <xsl:when test="$htmlhelp.use.hhk = 0">
880
881 <xsl:variable name="primary" select="normalize-space(primary)"/>
882 <xsl:variable name="secondary" select="normalize-space(secondary)"/>
883 <xsl:variable name="tertiary" select="normalize-space(tertiary)"/>
884
885 <xsl:variable name="text">
886 <xsl:value-of select="$primary"/>
887 <xsl:if test="secondary">
888 <xsl:text>, </xsl:text>
889 <xsl:value-of select="$secondary"/>
890 </xsl:if>
891 <xsl:if test="tertiary">
892 <xsl:text>, </xsl:text>
893 <xsl:value-of select="$tertiary"/>
894 </xsl:if>
895 </xsl:variable>
896
897 <xsl:if test="secondary">
898 <xsl:if test="not(//indexterm[normalize-space(primary)=$primary and not(secondary)])">
899 <xsl:call-template name="write.indexterm">
900 <xsl:with-param name="text" select="$primary"/>
901 </xsl:call-template>
902 </xsl:if>
903 </xsl:if>
904
905 <xsl:call-template name="write.indexterm">
906 <xsl:with-param name="text" select="$text"/>
907 </xsl:call-template>
908
909 </xsl:when>
910 <xsl:otherwise>
911 <a>
912 <xsl:attribute name="name">
913 <xsl:call-template name="object.id"/>
914 </xsl:attribute>
915 </a>
916 </xsl:otherwise>
917
918 </xsl:choose>
919</xsl:template>
920
921<xsl:template name="write.indexterm">
922 <xsl:param name="text"/>
923 <OBJECT type="application/x-oleobject"
924 classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
925 <param name="Keyword" value="{$text}"/>
926 </OBJECT>
927</xsl:template>
928
929<!-- ==================================================================== -->
930
931<xsl:template name="hhk">
932 <xsl:call-template name="write.text.chunk">
933 <xsl:with-param name="filename">
934 <xsl:if test="$manifest.in.base.dir != 0">
935 <xsl:value-of select="$base.dir"/>
936 </xsl:if>
937 <xsl:value-of select="$htmlhelp.hhk"/>
938 </xsl:with-param>
939 <xsl:with-param name="method" select="'text'"/>
940 <xsl:with-param name="content"><xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
941<HTML>
942<HEAD>
943<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
944<!-- Sitemap 1.0 -->
945</HEAD><BODY>
946<OBJECT type="text/site properties">
947</OBJECT>
948<UL>]]>
949</xsl:text>
950<xsl:if test="($htmlhelp.use.hhk != 0) and $htmlhelp.generate.index">
951 <xsl:choose>
952 <xsl:when test="$rootid != ''">
953 <xsl:apply-templates select="key('id',$rootid)" mode="hhk"/>
954 </xsl:when>
955 <xsl:otherwise>
956 <xsl:apply-templates select="/" mode="hhk"/>
957 </xsl:otherwise>
958 </xsl:choose>
959</xsl:if>
960<xsl:text disable-output-escaping="yes"><![CDATA[</UL>
961</BODY></HTML>]]>
962</xsl:text></xsl:with-param>
963 <xsl:with-param name="encoding" select="$htmlhelp.encoding"/>
964 </xsl:call-template>
965</xsl:template>
966
967<xsl:template match="indexterm[@class='endofrange']" mode="hhk"/>
968
969<xsl:template match="indexterm" mode="hhk">
970 <xsl:variable name="primary" select="normalize-space(primary)"/>
971 <xsl:variable name="secondary" select="normalize-space(secondary)"/>
972 <xsl:variable name="tertiary" select="normalize-space(tertiary)"/>
973
974 <xsl:call-template name="write.indexterm.hhk">
975 <xsl:with-param name="text" select="$primary"/>
976 <xsl:with-param name="seealso" select="seealso"/>
977 </xsl:call-template>
978
979 <xsl:if test="secondary">
980 <xsl:if test="not(//indexterm[normalize-space(primary)=$primary and not(secondary)])">
981 <xsl:call-template name="write.indexterm.hhk">
982 <!-- We must create fake entry when there is secondary without primary -->
983 <xsl:with-param name="text" select="$primary"/>
984 <xsl:with-param name="seealso" select="$primary"/>
985 </xsl:call-template>
986 </xsl:if>
987 <xsl:text disable-output-escaping="yes"><![CDATA[<UL>]]>&#10;</xsl:text>
988 <xsl:call-template name="write.indexterm.hhk">
989 <xsl:with-param name="text" select="$secondary"/>
990 <xsl:with-param name="seealso" select="secondary/seealso"/>
991 </xsl:call-template>
992 <xsl:if test="tertiary">
993 <xsl:text disable-output-escaping="yes"><![CDATA[<UL>]]>&#10;</xsl:text>
994 <xsl:call-template name="write.indexterm.hhk">
995 <xsl:with-param name="text" select="$tertiary"/>
996 <xsl:with-param name="seealso" select="tertiary/seealso"/>
997 </xsl:call-template>
998 <xsl:text disable-output-escaping="yes"><![CDATA[</UL>]]>&#10;</xsl:text>
999 </xsl:if>
1000 <xsl:text disable-output-escaping="yes"><![CDATA[</UL>]]>&#10;</xsl:text>
1001 </xsl:if>
1002
1003</xsl:template>
1004
1005<xsl:template name="write.indexterm.hhk">
1006 <xsl:param name="text"/>
1007 <xsl:param name="seealso"/>
1008 <xsl:variable name="text.escaped">
1009 <xsl:call-template name="escape-attr">
1010 <xsl:with-param name="value" select="$text"/>
1011 </xsl:call-template>
1012 </xsl:variable>
1013
1014 <xsl:text disable-output-escaping="yes"><![CDATA[<LI> <OBJECT type="text/sitemap">
1015 <param name="Name" value="]]></xsl:text><xsl:value-of select="$text.escaped"/><xsl:text disable-output-escaping="yes"><![CDATA[">]]></xsl:text>
1016 <xsl:if test="not(seealso)">
1017 <xsl:variable name="href">
1018 <xsl:call-template name="href.target.with.base.dir"/>
1019 </xsl:variable>
1020 <xsl:variable name="title">
1021 <xsl:call-template name="escape-attr">
1022 <xsl:with-param name="value">
1023 <xsl:call-template name="nearest.title">
1024 <xsl:with-param name="object" select=".."/>
1025 </xsl:call-template>
1026 </xsl:with-param>
1027 </xsl:call-template>
1028 </xsl:variable>
1029 <xsl:text disable-output-escaping="yes"><![CDATA[<param name="Name" value="]]></xsl:text>
1030 <xsl:value-of select="$title"/>
1031 <xsl:text disable-output-escaping="yes"><![CDATA[">]]></xsl:text>
1032 <xsl:text disable-output-escaping="yes"><![CDATA[<param name="Local" value="]]></xsl:text>
1033 <xsl:value-of select="$href"/>
1034 <xsl:text disable-output-escaping="yes"><![CDATA[">]]></xsl:text>
1035 </xsl:if>
1036 <xsl:if test="seealso">
1037 <xsl:text disable-output-escaping="yes"><![CDATA[<param name="See Also" value="]]></xsl:text>
1038 <xsl:value-of select="$seealso"/>
1039 <xsl:text disable-output-escaping="yes"><![CDATA[">]]></xsl:text>
1040 </xsl:if>
1041 <xsl:text disable-output-escaping="yes"><![CDATA[ </OBJECT>]]></xsl:text>
1042</xsl:template>
1043
1044<xsl:template match="text()" mode="hhk"/>
1045
1046<xsl:template name="nearest.title">
1047 <xsl:param name="object"/>
1048 <xsl:apply-templates select="$object/ancestor-or-self::*[title][1]" mode="title.markup"/>
1049</xsl:template>
1050
1051<!-- ==================================================================== -->
1052
1053<xsl:template name="hh-map">
1054 <xsl:call-template name="write.text.chunk">
1055 <xsl:with-param name="filename">
1056 <xsl:if test="$manifest.in.base.dir != 0">
1057 <xsl:value-of select="$base.dir"/>
1058 </xsl:if>
1059 <xsl:value-of select="$htmlhelp.map.file"/>
1060 </xsl:with-param>
1061 <xsl:with-param name="method" select="'text'"/>
1062 <xsl:with-param name="content">
1063 <xsl:choose>
1064 <xsl:when test="$rootid != ''">
1065 <xsl:apply-templates select="key('id',$rootid)" mode="hh-map"/>
1066 </xsl:when>
1067 <xsl:otherwise>
1068 <xsl:apply-templates select="/" mode="hh-map"/>
1069 </xsl:otherwise>
1070 </xsl:choose>
1071 </xsl:with-param>
1072 <xsl:with-param name="encoding" select="$htmlhelp.encoding"/>
1073 </xsl:call-template>
1074</xsl:template>
1075
1076<xsl:template match="processing-instruction('dbhh')" mode="hh-map">
1077 <xsl:variable name="topicname">
1078 <xsl:call-template name="pi-attribute">
1079 <xsl:with-param name="pis"
1080 select="."/>
1081 <xsl:with-param name="attribute" select="'topicname'"/>
1082 </xsl:call-template>
1083 </xsl:variable>
1084 <xsl:variable name="topicid">
1085 <xsl:call-template name="pi-attribute">
1086 <xsl:with-param name="pis"
1087 select="."/>
1088 <xsl:with-param name="attribute" select="'topicid'"/>
1089 </xsl:call-template>
1090 </xsl:variable>
1091 <xsl:text>#define </xsl:text>
1092 <xsl:value-of select="$topicname"/>
1093 <xsl:text>&#9;</xsl:text>
1094 <xsl:value-of select="$topicid"/>
1095 <xsl:text>&#xA;</xsl:text>
1096</xsl:template>
1097
1098<xsl:template match="text()" mode="hh-map"/>
1099
1100<!-- ==================================================================== -->
1101
1102<xsl:template name="hh-alias">
1103 <xsl:call-template name="write.text.chunk">
1104 <xsl:with-param name="filename">
1105 <xsl:if test="$manifest.in.base.dir != 0">
1106 <xsl:value-of select="$base.dir"/>
1107 </xsl:if>
1108 <xsl:value-of select="$htmlhelp.alias.file"/>
1109 </xsl:with-param>
1110 <xsl:with-param name="method" select="'text'"/>
1111 <xsl:with-param name="content">
1112 <xsl:choose>
1113 <xsl:when test="$rootid != ''">
1114 <xsl:apply-templates select="key('id',$rootid)" mode="hh-alias"/>
1115 </xsl:when>
1116 <xsl:otherwise>
1117 <xsl:apply-templates select="/" mode="hh-alias"/>
1118 </xsl:otherwise>
1119 </xsl:choose>
1120 </xsl:with-param>
1121 <xsl:with-param name="encoding" select="$htmlhelp.encoding"/>
1122 </xsl:call-template>
1123</xsl:template>
1124
1125<xsl:template match="processing-instruction('dbhh')" mode="hh-alias">
1126 <xsl:variable name="topicname">
1127 <xsl:call-template name="pi-attribute">
1128 <xsl:with-param name="pis"
1129 select="."/>
1130 <xsl:with-param name="attribute" select="'topicname'"/>
1131 </xsl:call-template>
1132 </xsl:variable>
1133 <xsl:variable name="href">
1134 <xsl:call-template name="href.target.with.base.dir">
1135 <xsl:with-param name="object" select=".."/>
1136 </xsl:call-template>
1137 </xsl:variable>
1138 <xsl:value-of select="$topicname"/>
1139 <xsl:text>=</xsl:text>
1140 <!-- Some versions of HH doesn't like fragment identifires, but some does. -->
1141 <!-- <xsl:value-of select="substring-before(concat($href, '#'), '#')"/> -->
1142 <xsl:value-of select="$href"/>
1143 <xsl:text>&#xA;</xsl:text>
1144</xsl:template>
1145
1146<xsl:template match="text()" mode="hh-alias"/>
1147
1148<!-- ==================================================================== -->
1149<!-- This code can be used to convert any number to hexadecimal format -->
1150
1151 <h:hex>
1152 <d>0</d>
1153 <d>1</d>
1154 <d>2</d>
1155 <d>3</d>
1156 <d>4</d>
1157 <d>5</d>
1158 <d>6</d>
1159 <d>7</d>
1160 <d>8</d>
1161 <d>9</d>
1162 <d>A</d>
1163 <d>B</d>
1164 <d>C</d>
1165 <d>D</d>
1166 <d>E</d>
1167 <d>F</d>
1168 </h:hex>
1169
1170 <xsl:template name="toHex">
1171 <xsl:param name="n" select="0"/>
1172 <xsl:param name="digit" select="$n mod 16"/>
1173 <xsl:param name="rest" select="floor($n div 16)"/>
1174 <xsl:if test="$rest > 0">
1175 <xsl:call-template name="toHex">
1176 <xsl:with-param name="n" select="$rest"/>
1177 </xsl:call-template>
1178 </xsl:if>
1179 <xsl:value-of select="document('')//h:hex/d[$digit+1]"/>
1180 </xsl:template>
1181
1182<!-- ==================================================================== -->
1183<!-- Template for escaping <, & and " in attribute values.
1184 We aren't using HTML output method, so we must do this job ourselves -->
1185
1186<xsl:template name="escape-attr">
1187 <xsl:param name="value"/>
1188
1189 <xsl:variable name="amp.escaped">
1190 <xsl:call-template name="string.subst">
1191 <xsl:with-param name="string" select="$value"/>
1192 <xsl:with-param name="target" select="'&amp;'"/>
1193 <xsl:with-param name="replacement" select="'&amp;amp;'"/>
1194 </xsl:call-template>
1195 </xsl:variable>
1196
1197 <xsl:variable name="quot.escaped">
1198 <xsl:call-template name="string.subst">
1199 <xsl:with-param name="string" select="$amp.escaped"/>
1200 <xsl:with-param name="target" select="'&quot;'"/>
1201 <xsl:with-param name="replacement" select="'&amp;quot;'"/>
1202 </xsl:call-template>
1203 </xsl:variable>
1204
1205 <xsl:variable name="angle.escaped">
1206 <xsl:call-template name="string.subst">
1207 <xsl:with-param name="string" select="$quot.escaped"/>
1208 <xsl:with-param name="target" select="'&lt;'"/>
1209 <xsl:with-param name="replacement" select="'&amp;lt;'"/>
1210 </xsl:call-template>
1211 </xsl:variable>
1212
1213 <xsl:value-of select="$angle.escaped"/>
1214
1215</xsl:template>
1216
1217<!-- ==================================================================== -->
1218<!-- Modification to standard HTML stylesheets -->
1219
1220<!-- There are links from ToC pane to bibliodivs, so there must be anchor -->
1221<xsl:template match="bibliodiv/title">
1222 <h3 class="{name(.)}">
1223 <xsl:call-template name="anchor">
1224 <xsl:with-param name="node" select=".."/>
1225 <xsl:with-param name="conditional" select="0"/>
1226 </xsl:call-template>
1227 <xsl:apply-templates/>
1228 </h3>
1229</xsl:template>
1230
1231</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.