1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by xsl2profile-->
3 <!--from the DocBook XSL stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns:exsl="http://exslt.org/common" xmlns:exslt="http://exslt.org/common" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" version="1.0" exclude-result-prefixes="doc ng db exsl exslt">
6 <xsl:import href="../html/chunk.xsl"/>
8 <xsl:output method="html"/>
10 <!-- ********************************************************************
11 $Id: javahelp.xsl 8400 2009-04-08 07:44:54Z bobstayton $
12 ********************************************************************
14 This file is part of the XSL DocBook Stylesheet distribution.
15 See ../README or http://docbook.sf.net/release/xsl/current/ for
16 copyright and other information.
18 ******************************************************************** -->
20 <!-- ==================================================================== -->
22 <xslo:include xmlns:xslo="http://www.w3.org/1999/XSL/Transform" href="../profiling/profile-mode.xsl"/><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content"><xslo:choose><xslo:when test="*/self::ng:* or */self::db:*"><xslo:message>Note: namesp. cut : stripped namespace before processing</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>Note: namesp. cut : processing stripped document</xslo:message><xslo:apply-templates select="exslt:node-set($stripped-content)" mode="profile"/></xslo:when><xslo:otherwise><xslo:apply-templates select="/" mode="profile"/></xslo:otherwise></xslo:choose></xslo:variable><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" select="exslt:node-set($profiled-content)"/><xsl:template match="/">
23 <!-- * Get a title for current doc so that we let the user -->
24 <!-- * know what document we are processing at this point. -->
25 <xsl:variable name="doc.title">
26 <xsl:call-template name="get.doc.title"/>
29 <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
30 toss the namespace and continue. Use the docbook5 namespaced
31 stylesheets for DocBook5 if you don't want to use this feature.-->
32 <xsl:when test="false()"/>
35 <xsl:when test="$rootid != ''">
37 <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
38 <xsl:message terminate="yes">
39 <xsl:text>ID '</xsl:text>
40 <xsl:value-of select="$rootid"/>
41 <xsl:text>' not found in document.</xsl:text>
45 <xsl:message>Formatting from <xsl:value-of select="$rootid"/></xsl:message>
46 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
51 <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
54 <xsl:for-each select="$profiled-nodes"> <!-- This is just a hook for building profiling stylesheets -->
55 <xsl:call-template name="helpset"/>
56 <xsl:call-template name="helptoc"/>
57 <xsl:call-template name="helpmap"/>
58 <xsl:call-template name="helpidx"/>
64 <xsl:template name="header.navigation">
67 <xsl:template name="footer.navigation">
70 <!-- ==================================================================== -->
72 <xsl:template name="helpset">
73 <xsl:call-template name="write.chunk.with.doctype">
74 <xsl:with-param name="filename" select="concat($base.dir,'jhelpset.hs')"/>
75 <xsl:with-param name="method" select="'xml'"/>
76 <xsl:with-param name="indent" select="'yes'"/>
77 <xsl:with-param name="doctype-public" select="'-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN'"/>
78 <xsl:with-param name="doctype-system" select="'http://java.sun.com/products/javahelp/helpset_1_0.dtd'"/>
79 <xsl:with-param name="content">
80 <xsl:call-template name="helpset.content"/>
82 <xsl:with-param name="quiet" select="$chunk.quietly"/>
86 <xsl:template name="helpset.content">
87 <xsl:variable name="title">
88 <xsl:apply-templates select="." mode="title.markup"/>
91 <helpset version="1.0">
93 <xsl:value-of select="normalize-space($title)"/>
99 <mapref location="jhelpmap.jhm"/>
105 <label>Table Of Contents</label>
106 <type>javax.help.TOCView</type>
107 <data>jhelptoc.xml</data>
113 <type>javax.help.IndexView</type>
114 <data>jhelpidx.xml</data>
119 <label>Search</label>
120 <type>javax.help.SearchView</type>
121 <data engine="com.sun.java.help.search.DefaultSearchEngine">JavaHelpSearch</data>
126 <!-- ==================================================================== -->
128 <xsl:template name="helptoc">
129 <xsl:call-template name="write.chunk.with.doctype">
130 <xsl:with-param name="filename" select="concat($base.dir,'jhelptoc.xml')"/>
131 <xsl:with-param name="method" select="'xml'"/>
132 <xsl:with-param name="indent" select="'yes'"/>
133 <xsl:with-param name="doctype-public" select="'-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN'"/>
134 <xsl:with-param name="doctype-system" select="'http://java.sun.com/products/javahelp/toc_1_0.dtd'"/>
135 <xsl:with-param name="encoding" select="$javahelp.encoding"/>
136 <xsl:with-param name="content">
137 <xsl:call-template name="helptoc.content"/>
139 <xsl:with-param name="quiet" select="$chunk.quietly"/>
143 <xsl:template name="helptoc.content">
146 <xsl:when test="$rootid != ''">
147 <xsl:apply-templates select="key('id',$rootid)" mode="jhtoc"/>
150 <xsl:apply-templates select="." mode="jhtoc"/>
156 <xsl:template match="set" mode="jhtoc">
157 <xsl:variable name="id">
158 <xsl:call-template name="object.id">
159 <xsl:with-param name="object" select="."/>
162 <xsl:variable name="title">
163 <xsl:apply-templates select="." mode="title.markup"/>
166 <tocitem target="{$id}">
167 <xsl:attribute name="text">
168 <xsl:value-of select="normalize-space($title)"/>
170 <xsl:apply-templates select="book" mode="jhtoc"/>
174 <xsl:template match="book" mode="jhtoc">
175 <xsl:variable name="id">
176 <xsl:call-template name="object.id"/>
178 <xsl:variable name="title">
179 <xsl:apply-templates select="." mode="title.markup"/>
182 <tocitem target="{$id}">
183 <xsl:attribute name="text">
184 <xsl:value-of select="normalize-space($title)"/>
186 <xsl:apply-templates select="part|reference|preface|chapter|appendix|article|colophon|glossary|bibliography" mode="jhtoc"/>
190 <xsl:template match="part|reference|preface|chapter|appendix|article" mode="jhtoc">
191 <xsl:variable name="id">
192 <xsl:call-template name="object.id"/>
194 <xsl:variable name="title">
195 <xsl:apply-templates select="." mode="title.markup"/>
198 <tocitem target="{$id}">
199 <xsl:attribute name="text">
200 <xsl:value-of select="normalize-space($title)"/>
202 <xsl:apply-templates select="article|preface|chapter|appendix|refentry|section|sect1|glossary|bibliography" mode="jhtoc"/>
206 <xsl:template match="section" mode="jhtoc">
207 <xsl:variable name="id">
208 <xsl:call-template name="object.id"/>
210 <xsl:variable name="title">
211 <xsl:apply-templates select="." mode="title.markup"/>
214 <tocitem target="{$id}">
215 <xsl:attribute name="text">
216 <xsl:value-of select="normalize-space($title)"/>
218 <xsl:apply-templates select="section" mode="jhtoc"/>
222 <xsl:template match="sect1" mode="jhtoc">
223 <xsl:variable name="id">
224 <xsl:call-template name="object.id"/>
226 <xsl:variable name="title">
227 <xsl:apply-templates select="." mode="title.markup"/>
230 <tocitem target="{$id}">
231 <xsl:attribute name="text">
232 <xsl:value-of select="normalize-space($title)"/>
234 <xsl:apply-templates select="sect2" mode="jhtoc"/>
238 <xsl:template match="sect2" mode="jhtoc">
239 <xsl:variable name="id">
240 <xsl:call-template name="object.id"/>
242 <xsl:variable name="title">
243 <xsl:apply-templates select="." mode="title.markup"/>
246 <tocitem target="{$id}">
247 <xsl:attribute name="text">
248 <xsl:value-of select="normalize-space($title)"/>
250 <xsl:apply-templates select="sect3" mode="jhtoc"/>
254 <xsl:template match="sect3" mode="jhtoc">
255 <xsl:variable name="id">
256 <xsl:call-template name="object.id"/>
258 <xsl:variable name="title">
259 <xsl:apply-templates select="." mode="title.markup"/>
262 <tocitem target="{$id}">
263 <xsl:attribute name="text">
264 <xsl:value-of select="normalize-space($title)"/>
266 <xsl:apply-templates select="sect4" mode="jhtoc"/>
270 <xsl:template match="sect4" mode="jhtoc">
271 <xsl:variable name="id">
272 <xsl:call-template name="object.id"/>
274 <xsl:variable name="title">
275 <xsl:apply-templates select="." mode="title.markup"/>
278 <tocitem target="{$id}">
279 <xsl:attribute name="text">
280 <xsl:value-of select="normalize-space($title)"/>
282 <xsl:apply-templates select="sect5" mode="jhtoc"/>
286 <xsl:template match="sect5|colophon|refentry" mode="jhtoc">
287 <xsl:variable name="id">
288 <xsl:call-template name="object.id"/>
290 <xsl:variable name="title">
291 <xsl:apply-templates select="." mode="title.markup"/>
294 <tocitem target="{$id}">
295 <xsl:attribute name="text">
296 <xsl:value-of select="normalize-space($title)"/>
302 <xsl:template match="glossary" mode="jhtoc">
303 <xsl:variable name="id">
304 <xsl:call-template name="object.id"/>
307 <xsl:variable name="title">
308 <xsl:call-template name="gentext">
309 <xsl:with-param name="key" select="'Glossary'"/>
313 <tocitem target="{$id}">
314 <xsl:attribute name="text">
315 <xsl:value-of select="$title"/>
321 <xsl:template match="bibliography" mode="jhtoc">
322 <xsl:variable name="id">
323 <xsl:call-template name="object.id"/>
326 <xsl:variable name="title">
327 <xsl:call-template name="gentext">
328 <xsl:with-param name="key" select="'Bibliography'"/>
332 <tocitem target="{$id}">
333 <xsl:attribute name="text">
334 <xsl:value-of select="$title"/>
340 <!-- ==================================================================== -->
342 <xsl:template name="helpmap">
343 <xsl:call-template name="write.chunk.with.doctype">
344 <xsl:with-param name="filename" select="concat($base.dir, 'jhelpmap.jhm')"/>
345 <xsl:with-param name="method" select="'xml'"/>
346 <xsl:with-param name="indent" select="'yes'"/>
347 <xsl:with-param name="doctype-public" select="'-//Sun Microsystems Inc.//DTD JavaHelp Map Version 1.0//EN'"/>
348 <xsl:with-param name="doctype-system" select="'http://java.sun.com/products/javahelp/map_1_0.dtd'"/>
349 <xsl:with-param name="encoding" select="$javahelp.encoding"/>
350 <xsl:with-param name="content">
351 <xsl:call-template name="helpmap.content"/>
353 <xsl:with-param name="quiet" select="$chunk.quietly"/>
357 <xsl:template name="helpmap.content">
360 <xsl:when test="$rootid != ''">
361 <xsl:apply-templates select="key('id',$rootid)//set | key('id',$rootid)//book | key('id',$rootid)//part | key('id',$rootid)//reference | key('id',$rootid)//preface | key('id',$rootid)//chapter | key('id',$rootid)//appendix | key('id',$rootid)//article | key('id',$rootid)//colophon | key('id',$rootid)//refentry | key('id',$rootid)//section | key('id',$rootid)//sect1 | key('id',$rootid)//sect2 | key('id',$rootid)//sect3 | key('id',$rootid)//sect4 | key('id',$rootid)//sect5 | key('id',$rootid)//indexterm | key('id',$rootid)//glossary | key('id',$rootid)//bibliography | key('id',$rootid)//*[@id]" mode="map"/>
364 <xsl:apply-templates select="//set | //book | //part | //reference | //preface | //chapter | //appendix | //article | //colophon | //refentry | //section | //sect1 | //sect2 | //sect3 | //sect4 | //sect5 | //indexterm | //glossary | //bibliography | //*[@id]" mode="map"/>
370 <xsl:template match="set" mode="map">
371 <xsl:variable name="id">
372 <xsl:call-template name="object.id">
373 <xsl:with-param name="object" select="."/>
377 <mapID target="{$id}">
378 <xsl:attribute name="url">
379 <xsl:call-template name="href.target.uri"/>
384 <xsl:template match="book" mode="map">
385 <xsl:variable name="id">
386 <xsl:call-template name="object.id"/>
389 <mapID target="{$id}">
390 <xsl:attribute name="url">
391 <xsl:call-template name="href.target.uri"/>
396 <xsl:template match="part|reference|preface|chapter|appendix|refentry|article|glossary|bibliography" mode="map">
397 <xsl:variable name="id">
398 <xsl:call-template name="object.id"/>
401 <mapID target="{$id}">
402 <xsl:attribute name="url">
403 <xsl:call-template name="href.target.uri"/>
408 <xsl:template match="section|sect1|sect2|sect3|sect4|sect5|colophon" mode="map">
409 <xsl:variable name="id">
410 <xsl:call-template name="object.id"/>
413 <mapID target="{$id}">
414 <xsl:attribute name="url">
415 <xsl:call-template name="href.target.uri"/>
420 <xsl:template match="indexterm[@class='endofrange']" mode="map"/>
422 <xsl:template match="indexterm" mode="map">
423 <xsl:variable name="id">
424 <xsl:call-template name="object.id"/>
427 <mapID target="{$id}">
428 <xsl:attribute name="url">
429 <xsl:call-template name="href.target.uri"/>
434 <xsl:template match="*[@id]" mode="map">
435 <xsl:variable name="id">
436 <xsl:call-template name="object.id"/>
439 <mapID target="{$id}">
440 <xsl:attribute name="url">
441 <xsl:call-template name="href.target.uri"/>
446 <!-- ==================================================================== -->
448 <xsl:template name="helpidx">
449 <xsl:call-template name="write.chunk.with.doctype">
450 <xsl:with-param name="filename" select="concat($base.dir, 'jhelpidx.xml')"/>
451 <xsl:with-param name="method" select="'xml'"/>
452 <xsl:with-param name="indent" select="'yes'"/>
453 <xsl:with-param name="doctype-public" select="'-//Sun Microsystems Inc.//DTD JavaHelp Index Version 1.0//EN'"/>
454 <xsl:with-param name="doctype-system" select="'http://java.sun.com/products/javahelp/index_1_0.dtd'"/>
455 <xsl:with-param name="encoding" select="$javahelp.encoding"/>
456 <xsl:with-param name="content">
457 <xsl:call-template name="helpidx.content"/>
459 <xsl:with-param name="quiet" select="$chunk.quietly"/>
463 <xsl:template name="helpidx.content">
464 <index version="1.0">
466 <xsl:when test="$rootid != ''">
467 <xsl:apply-templates select="key('id',$rootid)//indexterm" mode="idx">
468 <xsl:sort select="primary"/>
469 <xsl:sort select="secondary"/>
470 <xsl:sort select="tertiary"/>
471 </xsl:apply-templates>
474 <xsl:apply-templates select="//indexterm" mode="idx">
475 <xsl:sort select="primary"/>
476 <xsl:sort select="secondary"/>
477 <xsl:sort select="tertiary"/>
478 </xsl:apply-templates>
484 <xsl:template match="indexterm[@class='endofrange']" mode="idx"/>
486 <xsl:template match="indexterm" mode="idx">
487 <xsl:variable name="id">
488 <xsl:call-template name="object.id"/>
491 <xsl:variable name="text">
492 <xsl:value-of select="normalize-space(primary)"/>
493 <xsl:if test="secondary">
494 <xsl:text>, </xsl:text>
495 <xsl:value-of select="normalize-space(secondary)"/>
497 <xsl:if test="tertiary">
498 <xsl:text>, </xsl:text>
499 <xsl:value-of select="normalize-space(tertiary)"/>
504 <xsl:when test="see">
505 <xsl:variable name="see"><xsl:value-of select="normalize-space(see)"/></xsl:variable>
506 <indexitem text="{$text} see '{$see}'"/>
509 <indexitem text="{$text}" target="{$id}"/>
514 <!-- ==================================================================== -->
515 <!-- Kludge for Xalan outputting ™ which fails in javahelp -->
516 <xsl:template name="dingbat.characters">
517 <!-- now that I'm using the real serializer, all that dingbat malarky -->
518 <!-- isn't necessary anymore... -->
519 <xsl:param name="dingbat">bullet</xsl:param>
522 <xsl:when test="$dingbat='bullet'">•</xsl:when>
523 <xsl:when test="$dingbat='copyright'">©</xsl:when>
524 <xsl:when test="$dingbat='trademark' or $dingbat='trade'">
526 <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
529 <xsl:otherwise>™</xsl:otherwise>
532 <xsl:when test="$dingbat='registered'">®</xsl:when>
533 <xsl:when test="$dingbat='service'">(SM)</xsl:when>
534 <xsl:when test="$dingbat='nbsp'"> </xsl:when>
535 <xsl:when test="$dingbat='ldquo'">“</xsl:when>
536 <xsl:when test="$dingbat='rdquo'">”</xsl:when>
537 <xsl:when test="$dingbat='lsquo'">‘</xsl:when>
538 <xsl:when test="$dingbat='rsquo'">’</xsl:when>
539 <xsl:when test="$dingbat='em-dash'">—</xsl:when>
540 <xsl:when test="$dingbat='mdash'">—</xsl:when>
541 <xsl:when test="$dingbat='en-dash'">–</xsl:when>
542 <xsl:when test="$dingbat='ndash'">–</xsl:when>
544 <xsl:text>•</xsl:text>