]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/evergreen_docbook_files/docbook-xsl-1.75.2/javahelp/profile-javahelp.xsl
Capitalized the start of a sentence in the bucket section of cataloging.
[working/Evergreen.git] / stylesheets / evergreen_docbook_files / docbook-xsl-1.75.2 / javahelp / profile-javahelp.xsl
1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by xsl2profile-->
3 <!--from the DocBook XSL stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns: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">
5
6 <xsl:import href="../html/chunk.xsl"/>
7
8 <xsl:output method="html"/>
9
10 <!-- ********************************************************************
11      $Id: javahelp.xsl 8400 2009-04-08 07:44:54Z bobstayton $
12      ********************************************************************
13
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.
17
18      ******************************************************************** -->
19
20 <!-- ==================================================================== -->
21
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"/>
27   </xsl:variable>
28   <xsl:choose>
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()"/>
33     <xsl:otherwise>
34   <xsl:choose>
35     <xsl:when test="$rootid != ''">
36       <xsl:choose>
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>
42           </xsl:message>
43         </xsl:when>
44         <xsl:otherwise>
45           <xsl:message>Formatting from <xsl:value-of select="$rootid"/></xsl:message>
46           <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
47         </xsl:otherwise>
48       </xsl:choose>
49     </xsl:when>
50     <xsl:otherwise>
51       <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
52     </xsl:otherwise>
53   </xsl:choose>
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"/>
59   </xsl:for-each>
60 </xsl:otherwise>
61 </xsl:choose>
62 </xsl:template>
63
64 <xsl:template name="header.navigation">
65 </xsl:template>
66
67 <xsl:template name="footer.navigation">
68 </xsl:template>
69
70 <!-- ==================================================================== -->
71
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"/>
81     </xsl:with-param>
82     <xsl:with-param name="quiet" select="$chunk.quietly"/>
83   </xsl:call-template>
84 </xsl:template>
85
86 <xsl:template name="helpset.content">
87   <xsl:variable name="title">
88     <xsl:apply-templates select="." mode="title.markup"/>
89   </xsl:variable>
90
91   <helpset version="1.0">
92     <title>
93       <xsl:value-of select="normalize-space($title)"/>
94     </title>
95
96     <!-- maps -->
97     <maps>
98       <homeID>top</homeID>
99       <mapref location="jhelpmap.jhm"/>
100     </maps>
101
102     <!-- views -->
103     <view>
104       <name>TOC</name>
105       <label>Table Of Contents</label>
106       <type>javax.help.TOCView</type>
107       <data>jhelptoc.xml</data>
108     </view>
109
110     <view>
111       <name>Index</name>
112       <label>Index</label>
113       <type>javax.help.IndexView</type>
114       <data>jhelpidx.xml</data>
115     </view>
116
117     <view>
118       <name>Search</name>
119       <label>Search</label>
120       <type>javax.help.SearchView</type>
121       <data engine="com.sun.java.help.search.DefaultSearchEngine">JavaHelpSearch</data>
122     </view>
123   </helpset>
124 </xsl:template>
125
126 <!-- ==================================================================== -->
127
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"/>
138     </xsl:with-param>
139     <xsl:with-param name="quiet" select="$chunk.quietly"/>
140   </xsl:call-template>
141 </xsl:template>
142
143 <xsl:template name="helptoc.content">
144   <toc version="1.0">
145     <xsl:choose>
146       <xsl:when test="$rootid != ''">
147         <xsl:apply-templates select="key('id',$rootid)" mode="jhtoc"/>
148       </xsl:when>
149       <xsl:otherwise>
150         <xsl:apply-templates select="." mode="jhtoc"/>
151       </xsl:otherwise>
152     </xsl:choose>
153   </toc>
154 </xsl:template>
155
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="."/>
160     </xsl:call-template>
161   </xsl:variable>
162   <xsl:variable name="title">
163     <xsl:apply-templates select="." mode="title.markup"/>
164   </xsl:variable>
165
166   <tocitem target="{$id}">
167     <xsl:attribute name="text">
168       <xsl:value-of select="normalize-space($title)"/>
169     </xsl:attribute>
170     <xsl:apply-templates select="book" mode="jhtoc"/>
171   </tocitem>
172 </xsl:template>
173
174 <xsl:template match="book" mode="jhtoc">
175   <xsl:variable name="id">
176     <xsl:call-template name="object.id"/>
177   </xsl:variable>
178   <xsl:variable name="title">
179     <xsl:apply-templates select="." mode="title.markup"/>
180   </xsl:variable>
181
182   <tocitem target="{$id}">
183     <xsl:attribute name="text">
184       <xsl:value-of select="normalize-space($title)"/>
185     </xsl:attribute>
186     <xsl:apply-templates select="part|reference|preface|chapter|appendix|article|colophon|glossary|bibliography" mode="jhtoc"/>
187   </tocitem>
188 </xsl:template>
189
190 <xsl:template match="part|reference|preface|chapter|appendix|article" mode="jhtoc">
191   <xsl:variable name="id">
192     <xsl:call-template name="object.id"/>
193   </xsl:variable>
194   <xsl:variable name="title">
195     <xsl:apply-templates select="." mode="title.markup"/>
196   </xsl:variable>
197
198   <tocitem target="{$id}">
199     <xsl:attribute name="text">
200       <xsl:value-of select="normalize-space($title)"/>
201     </xsl:attribute>
202     <xsl:apply-templates select="article|preface|chapter|appendix|refentry|section|sect1|glossary|bibliography" mode="jhtoc"/>
203   </tocitem>
204 </xsl:template>
205
206 <xsl:template match="section" mode="jhtoc">
207   <xsl:variable name="id">
208     <xsl:call-template name="object.id"/>
209   </xsl:variable>
210   <xsl:variable name="title">
211     <xsl:apply-templates select="." mode="title.markup"/>
212   </xsl:variable>
213
214   <tocitem target="{$id}">
215     <xsl:attribute name="text">
216       <xsl:value-of select="normalize-space($title)"/>
217     </xsl:attribute>
218     <xsl:apply-templates select="section" mode="jhtoc"/>
219   </tocitem>
220 </xsl:template>
221
222 <xsl:template match="sect1" mode="jhtoc">
223   <xsl:variable name="id">
224     <xsl:call-template name="object.id"/>
225   </xsl:variable>
226   <xsl:variable name="title">
227     <xsl:apply-templates select="." mode="title.markup"/>
228   </xsl:variable>
229
230   <tocitem target="{$id}">
231     <xsl:attribute name="text">
232       <xsl:value-of select="normalize-space($title)"/>
233     </xsl:attribute>
234     <xsl:apply-templates select="sect2" mode="jhtoc"/>
235   </tocitem>
236 </xsl:template>
237
238 <xsl:template match="sect2" mode="jhtoc">
239   <xsl:variable name="id">
240     <xsl:call-template name="object.id"/>
241   </xsl:variable>
242   <xsl:variable name="title">
243     <xsl:apply-templates select="." mode="title.markup"/>
244   </xsl:variable>
245
246   <tocitem target="{$id}">
247     <xsl:attribute name="text">
248       <xsl:value-of select="normalize-space($title)"/>
249     </xsl:attribute>
250     <xsl:apply-templates select="sect3" mode="jhtoc"/>
251   </tocitem>
252 </xsl:template>
253
254 <xsl:template match="sect3" mode="jhtoc">
255   <xsl:variable name="id">
256     <xsl:call-template name="object.id"/>
257   </xsl:variable>
258   <xsl:variable name="title">
259     <xsl:apply-templates select="." mode="title.markup"/>
260   </xsl:variable>
261
262   <tocitem target="{$id}">
263     <xsl:attribute name="text">
264       <xsl:value-of select="normalize-space($title)"/>
265     </xsl:attribute>
266     <xsl:apply-templates select="sect4" mode="jhtoc"/>
267   </tocitem>
268 </xsl:template>
269
270 <xsl:template match="sect4" mode="jhtoc">
271   <xsl:variable name="id">
272     <xsl:call-template name="object.id"/>
273   </xsl:variable>
274   <xsl:variable name="title">
275     <xsl:apply-templates select="." mode="title.markup"/>
276   </xsl:variable>
277
278   <tocitem target="{$id}">
279     <xsl:attribute name="text">
280       <xsl:value-of select="normalize-space($title)"/>
281     </xsl:attribute>
282     <xsl:apply-templates select="sect5" mode="jhtoc"/>
283   </tocitem>
284 </xsl:template>
285
286 <xsl:template match="sect5|colophon|refentry" mode="jhtoc">
287   <xsl:variable name="id">
288     <xsl:call-template name="object.id"/>
289   </xsl:variable>
290   <xsl:variable name="title">
291     <xsl:apply-templates select="." mode="title.markup"/>
292   </xsl:variable>
293
294   <tocitem target="{$id}">
295     <xsl:attribute name="text">
296       <xsl:value-of select="normalize-space($title)"/>
297     </xsl:attribute>
298   </tocitem>
299 </xsl:template>
300
301
302 <xsl:template match="glossary" mode="jhtoc">
303   <xsl:variable name="id">
304     <xsl:call-template name="object.id"/>
305   </xsl:variable>
306
307   <xsl:variable name="title">
308     <xsl:call-template name="gentext">
309       <xsl:with-param name="key" select="'Glossary'"/>
310     </xsl:call-template>
311   </xsl:variable>
312
313   <tocitem target="{$id}">
314     <xsl:attribute name="text">
315       <xsl:value-of select="$title"/>
316     </xsl:attribute>
317   </tocitem>
318
319 </xsl:template>
320
321 <xsl:template match="bibliography" mode="jhtoc">
322   <xsl:variable name="id">
323     <xsl:call-template name="object.id"/>
324   </xsl:variable>
325
326   <xsl:variable name="title">
327     <xsl:call-template name="gentext">
328       <xsl:with-param name="key" select="'Bibliography'"/>
329     </xsl:call-template>
330   </xsl:variable>
331
332   <tocitem target="{$id}">
333     <xsl:attribute name="text">
334       <xsl:value-of select="$title"/>
335     </xsl:attribute>
336     
337   </tocitem>
338 </xsl:template>
339
340 <!-- ==================================================================== -->
341
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"/>
352     </xsl:with-param>
353     <xsl:with-param name="quiet" select="$chunk.quietly"/>
354   </xsl:call-template>
355 </xsl:template>
356
357 <xsl:template name="helpmap.content">
358   <map version="1.0">
359     <xsl:choose>
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"/>
362       </xsl:when>
363       <xsl:otherwise>
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"/>
365       </xsl:otherwise>
366     </xsl:choose>
367   </map>
368 </xsl:template>
369
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="."/>
374     </xsl:call-template>
375   </xsl:variable>
376
377   <mapID target="{$id}">
378     <xsl:attribute name="url">
379       <xsl:call-template name="href.target.uri"/>
380     </xsl:attribute>
381   </mapID>
382 </xsl:template>
383
384 <xsl:template match="book" mode="map">
385   <xsl:variable name="id">
386     <xsl:call-template name="object.id"/>
387   </xsl:variable>
388
389   <mapID target="{$id}">
390     <xsl:attribute name="url">
391       <xsl:call-template name="href.target.uri"/>
392     </xsl:attribute>
393   </mapID>
394 </xsl:template>
395
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"/>
399   </xsl:variable>
400
401   <mapID target="{$id}">
402     <xsl:attribute name="url">
403       <xsl:call-template name="href.target.uri"/>
404     </xsl:attribute>
405   </mapID>
406 </xsl:template>
407
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"/>
411   </xsl:variable>
412
413   <mapID target="{$id}">
414     <xsl:attribute name="url">
415       <xsl:call-template name="href.target.uri"/>
416     </xsl:attribute>
417   </mapID>
418 </xsl:template>
419
420 <xsl:template match="indexterm[@class='endofrange']" mode="map"/>
421
422 <xsl:template match="indexterm" mode="map">
423   <xsl:variable name="id">
424     <xsl:call-template name="object.id"/>
425   </xsl:variable>
426
427   <mapID target="{$id}">
428     <xsl:attribute name="url">
429       <xsl:call-template name="href.target.uri"/>
430     </xsl:attribute>
431   </mapID>
432 </xsl:template>
433
434 <xsl:template match="*[@id]" mode="map">
435   <xsl:variable name="id">
436     <xsl:call-template name="object.id"/>
437   </xsl:variable>
438
439   <mapID target="{$id}">
440     <xsl:attribute name="url">
441       <xsl:call-template name="href.target.uri"/>
442     </xsl:attribute>
443   </mapID>
444 </xsl:template>
445
446 <!-- ==================================================================== -->
447
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"/>
458     </xsl:with-param>
459     <xsl:with-param name="quiet" select="$chunk.quietly"/>
460   </xsl:call-template>
461 </xsl:template>
462
463 <xsl:template name="helpidx.content">
464   <index version="1.0">
465     <xsl:choose>
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>
472       </xsl:when>
473       <xsl:otherwise>
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>
479       </xsl:otherwise>
480     </xsl:choose>
481   </index>
482 </xsl:template>
483
484 <xsl:template match="indexterm[@class='endofrange']" mode="idx"/>
485
486 <xsl:template match="indexterm" mode="idx">
487   <xsl:variable name="id">
488     <xsl:call-template name="object.id"/>
489   </xsl:variable>
490
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)"/>
496     </xsl:if>
497     <xsl:if test="tertiary">
498       <xsl:text>, </xsl:text>
499       <xsl:value-of select="normalize-space(tertiary)"/>
500     </xsl:if>
501   </xsl:variable>
502
503   <xsl:choose>
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}'"/>
507     </xsl:when>
508     <xsl:otherwise>
509       <indexitem text="{$text}" target="{$id}"/>
510     </xsl:otherwise>
511   </xsl:choose>
512 </xsl:template>
513
514 <!-- ==================================================================== -->
515 <!-- Kludge for Xalan outputting &trade; 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>
520
521   <xsl:choose>
522     <xsl:when test="$dingbat='bullet'">&#8226;</xsl:when>
523     <xsl:when test="$dingbat='copyright'">&#169;</xsl:when>
524     <xsl:when test="$dingbat='trademark' or $dingbat='trade'">
525       <xsl:choose>
526         <xsl:when test="contains(system-property('xsl:vendor'),                                  'Apache Software Foundation')">
527           <sup>TM</sup>
528         </xsl:when>
529         <xsl:otherwise>&#8482;</xsl:otherwise>
530       </xsl:choose>
531     </xsl:when>
532     <xsl:when test="$dingbat='registered'">&#174;</xsl:when>
533     <xsl:when test="$dingbat='service'">(SM)</xsl:when>
534     <xsl:when test="$dingbat='nbsp'">&#160;</xsl:when>
535     <xsl:when test="$dingbat='ldquo'">&#8220;</xsl:when>
536     <xsl:when test="$dingbat='rdquo'">&#8221;</xsl:when>
537     <xsl:when test="$dingbat='lsquo'">&#8216;</xsl:when>
538     <xsl:when test="$dingbat='rsquo'">&#8217;</xsl:when>
539     <xsl:when test="$dingbat='em-dash'">&#8212;</xsl:when>
540     <xsl:when test="$dingbat='mdash'">&#8212;</xsl:when>
541     <xsl:when test="$dingbat='en-dash'">&#8211;</xsl:when>
542     <xsl:when test="$dingbat='ndash'">&#8211;</xsl:when>
543     <xsl:otherwise>
544       <xsl:text>&#8226;</xsl:text>
545     </xsl:otherwise>
546   </xsl:choose>
547 </xsl:template>
548
549 </xsl:stylesheet>