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 9152 2011-11-12 00:17:33Z 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 or @xml: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 or @xml: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:param name="suppress.navigation" select="1"/>
|
---|
65 |
|
---|
66 | <!-- ==================================================================== -->
|
---|
67 |
|
---|
68 | <xsl:template name="helpset">
|
---|
69 | <xsl:call-template name="write.chunk.with.doctype">
|
---|
70 | <xsl:with-param name="filename" select="concat($chunk.base.dir,'jhelpset.hs')"/>
|
---|
71 | <xsl:with-param name="method" select="'xml'"/>
|
---|
72 | <xsl:with-param name="indent" select="'yes'"/>
|
---|
73 | <xsl:with-param name="doctype-public" select="'-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN'"/>
|
---|
74 | <xsl:with-param name="doctype-system" select="'http://java.sun.com/products/javahelp/helpset_1_0.dtd'"/>
|
---|
75 | <xsl:with-param name="content">
|
---|
76 | <xsl:call-template name="helpset.content"/>
|
---|
77 | </xsl:with-param>
|
---|
78 | <xsl:with-param name="quiet" select="$chunk.quietly"/>
|
---|
79 | </xsl:call-template>
|
---|
80 | </xsl:template>
|
---|
81 |
|
---|
82 | <xsl:template name="helpset.content">
|
---|
83 | <xsl:variable name="title">
|
---|
84 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
85 | </xsl:variable>
|
---|
86 |
|
---|
87 | <helpset version="1.0">
|
---|
88 | <title>
|
---|
89 | <xsl:value-of select="normalize-space($title)"/>
|
---|
90 | </title>
|
---|
91 |
|
---|
92 | <!-- maps -->
|
---|
93 | <maps>
|
---|
94 | <homeID>top</homeID>
|
---|
95 | <mapref location="jhelpmap.jhm"/>
|
---|
96 | </maps>
|
---|
97 |
|
---|
98 | <!-- views -->
|
---|
99 | <view>
|
---|
100 | <name>TOC</name>
|
---|
101 | <label>Table Of Contents</label>
|
---|
102 | <type>javax.help.TOCView</type>
|
---|
103 | <data>jhelptoc.xml</data>
|
---|
104 | </view>
|
---|
105 |
|
---|
106 | <view>
|
---|
107 | <name>Index</name>
|
---|
108 | <label>Index</label>
|
---|
109 | <type>javax.help.IndexView</type>
|
---|
110 | <data>jhelpidx.xml</data>
|
---|
111 | </view>
|
---|
112 |
|
---|
113 | <view>
|
---|
114 | <name>Search</name>
|
---|
115 | <label>Search</label>
|
---|
116 | <type>javax.help.SearchView</type>
|
---|
117 | <data engine="com.sun.java.help.search.DefaultSearchEngine">JavaHelpSearch</data>
|
---|
118 | </view>
|
---|
119 | </helpset>
|
---|
120 | </xsl:template>
|
---|
121 |
|
---|
122 | <!-- ==================================================================== -->
|
---|
123 |
|
---|
124 | <xsl:template name="helptoc">
|
---|
125 | <xsl:call-template name="write.chunk.with.doctype">
|
---|
126 | <xsl:with-param name="filename" select="concat($chunk.base.dir,'jhelptoc.xml')"/>
|
---|
127 | <xsl:with-param name="method" select="'xml'"/>
|
---|
128 | <xsl:with-param name="indent" select="'yes'"/>
|
---|
129 | <xsl:with-param name="doctype-public" select="'-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN'"/>
|
---|
130 | <xsl:with-param name="doctype-system" select="'http://java.sun.com/products/javahelp/toc_1_0.dtd'"/>
|
---|
131 | <xsl:with-param name="encoding" select="$javahelp.encoding"/>
|
---|
132 | <xsl:with-param name="content">
|
---|
133 | <xsl:call-template name="helptoc.content"/>
|
---|
134 | </xsl:with-param>
|
---|
135 | <xsl:with-param name="quiet" select="$chunk.quietly"/>
|
---|
136 | </xsl:call-template>
|
---|
137 | </xsl:template>
|
---|
138 |
|
---|
139 | <xsl:template name="helptoc.content">
|
---|
140 | <toc version="1.0">
|
---|
141 | <xsl:choose>
|
---|
142 | <xsl:when test="$rootid != ''">
|
---|
143 | <xsl:apply-templates select="key('id',$rootid)" mode="jhtoc"/>
|
---|
144 | </xsl:when>
|
---|
145 | <xsl:otherwise>
|
---|
146 | <xsl:apply-templates select="." mode="jhtoc"/>
|
---|
147 | </xsl:otherwise>
|
---|
148 | </xsl:choose>
|
---|
149 | </toc>
|
---|
150 | </xsl:template>
|
---|
151 |
|
---|
152 | <xsl:template match="set" mode="jhtoc">
|
---|
153 | <xsl:variable name="id">
|
---|
154 | <xsl:call-template name="object.id">
|
---|
155 | <xsl:with-param name="object" select="."/>
|
---|
156 | </xsl:call-template>
|
---|
157 | </xsl:variable>
|
---|
158 | <xsl:variable name="title">
|
---|
159 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
160 | </xsl:variable>
|
---|
161 |
|
---|
162 | <tocitem target="{$id}">
|
---|
163 | <xsl:attribute name="text">
|
---|
164 | <xsl:value-of select="normalize-space($title)"/>
|
---|
165 | </xsl:attribute>
|
---|
166 | <xsl:apply-templates select="book" mode="jhtoc"/>
|
---|
167 | </tocitem>
|
---|
168 | </xsl:template>
|
---|
169 |
|
---|
170 | <xsl:template match="book" mode="jhtoc">
|
---|
171 | <xsl:variable name="id">
|
---|
172 | <xsl:call-template name="object.id"/>
|
---|
173 | </xsl:variable>
|
---|
174 | <xsl:variable name="title">
|
---|
175 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
176 | </xsl:variable>
|
---|
177 |
|
---|
178 | <tocitem target="{$id}">
|
---|
179 | <xsl:attribute name="text">
|
---|
180 | <xsl:value-of select="normalize-space($title)"/>
|
---|
181 | </xsl:attribute>
|
---|
182 | <xsl:apply-templates select="part|reference|preface|chapter|appendix|article|colophon|glossary|bibliography" mode="jhtoc"/>
|
---|
183 | </tocitem>
|
---|
184 | </xsl:template>
|
---|
185 |
|
---|
186 | <xsl:template match="part|reference|preface|chapter|appendix|article" mode="jhtoc">
|
---|
187 | <xsl:variable name="id">
|
---|
188 | <xsl:call-template name="object.id"/>
|
---|
189 | </xsl:variable>
|
---|
190 | <xsl:variable name="title">
|
---|
191 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
192 | </xsl:variable>
|
---|
193 |
|
---|
194 | <tocitem target="{$id}">
|
---|
195 | <xsl:attribute name="text">
|
---|
196 | <xsl:value-of select="normalize-space($title)"/>
|
---|
197 | </xsl:attribute>
|
---|
198 | <xsl:apply-templates select="article|preface|chapter|appendix|refentry|section|sect1|glossary|bibliography" mode="jhtoc"/>
|
---|
199 | </tocitem>
|
---|
200 | </xsl:template>
|
---|
201 |
|
---|
202 | <xsl:template match="section" mode="jhtoc">
|
---|
203 | <xsl:variable name="id">
|
---|
204 | <xsl:call-template name="object.id"/>
|
---|
205 | </xsl:variable>
|
---|
206 | <xsl:variable name="title">
|
---|
207 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
208 | </xsl:variable>
|
---|
209 |
|
---|
210 | <tocitem target="{$id}">
|
---|
211 | <xsl:attribute name="text">
|
---|
212 | <xsl:value-of select="normalize-space($title)"/>
|
---|
213 | </xsl:attribute>
|
---|
214 | <xsl:apply-templates select="section" mode="jhtoc"/>
|
---|
215 | </tocitem>
|
---|
216 | </xsl:template>
|
---|
217 |
|
---|
218 | <xsl:template match="sect1" mode="jhtoc">
|
---|
219 | <xsl:variable name="id">
|
---|
220 | <xsl:call-template name="object.id"/>
|
---|
221 | </xsl:variable>
|
---|
222 | <xsl:variable name="title">
|
---|
223 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
224 | </xsl:variable>
|
---|
225 |
|
---|
226 | <tocitem target="{$id}">
|
---|
227 | <xsl:attribute name="text">
|
---|
228 | <xsl:value-of select="normalize-space($title)"/>
|
---|
229 | </xsl:attribute>
|
---|
230 | <xsl:apply-templates select="sect2" mode="jhtoc"/>
|
---|
231 | </tocitem>
|
---|
232 | </xsl:template>
|
---|
233 |
|
---|
234 | <xsl:template match="sect2" mode="jhtoc">
|
---|
235 | <xsl:variable name="id">
|
---|
236 | <xsl:call-template name="object.id"/>
|
---|
237 | </xsl:variable>
|
---|
238 | <xsl:variable name="title">
|
---|
239 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
240 | </xsl:variable>
|
---|
241 |
|
---|
242 | <tocitem target="{$id}">
|
---|
243 | <xsl:attribute name="text">
|
---|
244 | <xsl:value-of select="normalize-space($title)"/>
|
---|
245 | </xsl:attribute>
|
---|
246 | <xsl:apply-templates select="sect3" mode="jhtoc"/>
|
---|
247 | </tocitem>
|
---|
248 | </xsl:template>
|
---|
249 |
|
---|
250 | <xsl:template match="sect3" mode="jhtoc">
|
---|
251 | <xsl:variable name="id">
|
---|
252 | <xsl:call-template name="object.id"/>
|
---|
253 | </xsl:variable>
|
---|
254 | <xsl:variable name="title">
|
---|
255 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
256 | </xsl:variable>
|
---|
257 |
|
---|
258 | <tocitem target="{$id}">
|
---|
259 | <xsl:attribute name="text">
|
---|
260 | <xsl:value-of select="normalize-space($title)"/>
|
---|
261 | </xsl:attribute>
|
---|
262 | <xsl:apply-templates select="sect4" mode="jhtoc"/>
|
---|
263 | </tocitem>
|
---|
264 | </xsl:template>
|
---|
265 |
|
---|
266 | <xsl:template match="sect4" mode="jhtoc">
|
---|
267 | <xsl:variable name="id">
|
---|
268 | <xsl:call-template name="object.id"/>
|
---|
269 | </xsl:variable>
|
---|
270 | <xsl:variable name="title">
|
---|
271 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
272 | </xsl:variable>
|
---|
273 |
|
---|
274 | <tocitem target="{$id}">
|
---|
275 | <xsl:attribute name="text">
|
---|
276 | <xsl:value-of select="normalize-space($title)"/>
|
---|
277 | </xsl:attribute>
|
---|
278 | <xsl:apply-templates select="sect5" mode="jhtoc"/>
|
---|
279 | </tocitem>
|
---|
280 | </xsl:template>
|
---|
281 |
|
---|
282 | <xsl:template match="sect5|colophon|refentry" mode="jhtoc">
|
---|
283 | <xsl:variable name="id">
|
---|
284 | <xsl:call-template name="object.id"/>
|
---|
285 | </xsl:variable>
|
---|
286 | <xsl:variable name="title">
|
---|
287 | <xsl:apply-templates select="." mode="title.markup"/>
|
---|
288 | </xsl:variable>
|
---|
289 |
|
---|
290 | <tocitem target="{$id}">
|
---|
291 | <xsl:attribute name="text">
|
---|
292 | <xsl:value-of select="normalize-space($title)"/>
|
---|
293 | </xsl:attribute>
|
---|
294 | </tocitem>
|
---|
295 | </xsl:template>
|
---|
296 |
|
---|
297 |
|
---|
298 | <xsl:template match="glossary" mode="jhtoc">
|
---|
299 | <xsl:variable name="id">
|
---|
300 | <xsl:call-template name="object.id"/>
|
---|
301 | </xsl:variable>
|
---|
302 |
|
---|
303 | <xsl:variable name="title">
|
---|
304 | <xsl:call-template name="gentext">
|
---|
305 | <xsl:with-param name="key" select="'Glossary'"/>
|
---|
306 | </xsl:call-template>
|
---|
307 | </xsl:variable>
|
---|
308 |
|
---|
309 | <tocitem target="{$id}">
|
---|
310 | <xsl:attribute name="text">
|
---|
311 | <xsl:value-of select="$title"/>
|
---|
312 | </xsl:attribute>
|
---|
313 | </tocitem>
|
---|
314 |
|
---|
315 | </xsl:template>
|
---|
316 |
|
---|
317 | <xsl:template match="bibliography" mode="jhtoc">
|
---|
318 | <xsl:variable name="id">
|
---|
319 | <xsl:call-template name="object.id"/>
|
---|
320 | </xsl:variable>
|
---|
321 |
|
---|
322 | <xsl:variable name="title">
|
---|
323 | <xsl:call-template name="gentext">
|
---|
324 | <xsl:with-param name="key" select="'Bibliography'"/>
|
---|
325 | </xsl:call-template>
|
---|
326 | </xsl:variable>
|
---|
327 |
|
---|
328 | <tocitem target="{$id}">
|
---|
329 | <xsl:attribute name="text">
|
---|
330 | <xsl:value-of select="$title"/>
|
---|
331 | </xsl:attribute>
|
---|
332 |
|
---|
333 | </tocitem>
|
---|
334 | </xsl:template>
|
---|
335 |
|
---|
336 | <!-- ==================================================================== -->
|
---|
337 |
|
---|
338 | <xsl:template name="helpmap">
|
---|
339 | <xsl:call-template name="write.chunk.with.doctype">
|
---|
340 | <xsl:with-param name="filename" select="concat($chunk.base.dir, 'jhelpmap.jhm')"/>
|
---|
341 | <xsl:with-param name="method" select="'xml'"/>
|
---|
342 | <xsl:with-param name="indent" select="'yes'"/>
|
---|
343 | <xsl:with-param name="doctype-public" select="'-//Sun Microsystems Inc.//DTD JavaHelp Map Version 1.0//EN'"/>
|
---|
344 | <xsl:with-param name="doctype-system" select="'http://java.sun.com/products/javahelp/map_1_0.dtd'"/>
|
---|
345 | <xsl:with-param name="encoding" select="$javahelp.encoding"/>
|
---|
346 | <xsl:with-param name="content">
|
---|
347 | <xsl:call-template name="helpmap.content"/>
|
---|
348 | </xsl:with-param>
|
---|
349 | <xsl:with-param name="quiet" select="$chunk.quietly"/>
|
---|
350 | </xsl:call-template>
|
---|
351 | </xsl:template>
|
---|
352 |
|
---|
353 | <xsl:template name="helpmap.content">
|
---|
354 | <map version="1.0">
|
---|
355 | <xsl:choose>
|
---|
356 | <xsl:when test="$rootid != ''">
|
---|
357 | <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"/>
|
---|
358 | </xsl:when>
|
---|
359 | <xsl:otherwise>
|
---|
360 | <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"/>
|
---|
361 | </xsl:otherwise>
|
---|
362 | </xsl:choose>
|
---|
363 | </map>
|
---|
364 | </xsl:template>
|
---|
365 |
|
---|
366 | <xsl:template match="set" mode="map">
|
---|
367 | <xsl:variable name="id">
|
---|
368 | <xsl:call-template name="object.id">
|
---|
369 | <xsl:with-param name="object" select="."/>
|
---|
370 | </xsl:call-template>
|
---|
371 | </xsl:variable>
|
---|
372 |
|
---|
373 | <mapID target="{$id}">
|
---|
374 | <xsl:attribute name="url">
|
---|
375 | <xsl:call-template name="href.target.uri"/>
|
---|
376 | </xsl:attribute>
|
---|
377 | </mapID>
|
---|
378 | </xsl:template>
|
---|
379 |
|
---|
380 | <xsl:template match="book" mode="map">
|
---|
381 | <xsl:variable name="id">
|
---|
382 | <xsl:call-template name="object.id"/>
|
---|
383 | </xsl:variable>
|
---|
384 |
|
---|
385 | <mapID target="{$id}">
|
---|
386 | <xsl:attribute name="url">
|
---|
387 | <xsl:call-template name="href.target.uri"/>
|
---|
388 | </xsl:attribute>
|
---|
389 | </mapID>
|
---|
390 | </xsl:template>
|
---|
391 |
|
---|
392 | <xsl:template match="part|reference|preface|chapter|appendix|refentry|article|glossary|bibliography" mode="map">
|
---|
393 | <xsl:variable name="id">
|
---|
394 | <xsl:call-template name="object.id"/>
|
---|
395 | </xsl:variable>
|
---|
396 |
|
---|
397 | <mapID target="{$id}">
|
---|
398 | <xsl:attribute name="url">
|
---|
399 | <xsl:call-template name="href.target.uri"/>
|
---|
400 | </xsl:attribute>
|
---|
401 | </mapID>
|
---|
402 | </xsl:template>
|
---|
403 |
|
---|
404 | <xsl:template match="section|sect1|sect2|sect3|sect4|sect5|colophon" mode="map">
|
---|
405 | <xsl:variable name="id">
|
---|
406 | <xsl:call-template name="object.id"/>
|
---|
407 | </xsl:variable>
|
---|
408 |
|
---|
409 | <mapID target="{$id}">
|
---|
410 | <xsl:attribute name="url">
|
---|
411 | <xsl:call-template name="href.target.uri"/>
|
---|
412 | </xsl:attribute>
|
---|
413 | </mapID>
|
---|
414 | </xsl:template>
|
---|
415 |
|
---|
416 | <xsl:template match="indexterm[@class='endofrange']" mode="map"/>
|
---|
417 |
|
---|
418 | <xsl:template match="indexterm" mode="map">
|
---|
419 | <xsl:variable name="id">
|
---|
420 | <xsl:call-template name="object.id"/>
|
---|
421 | </xsl:variable>
|
---|
422 |
|
---|
423 | <mapID target="{$id}">
|
---|
424 | <xsl:attribute name="url">
|
---|
425 | <xsl:call-template name="href.target.uri"/>
|
---|
426 | </xsl:attribute>
|
---|
427 | </mapID>
|
---|
428 | </xsl:template>
|
---|
429 |
|
---|
430 | <xsl:template match="*[@id]" mode="map">
|
---|
431 | <xsl:variable name="id">
|
---|
432 | <xsl:call-template name="object.id"/>
|
---|
433 | </xsl:variable>
|
---|
434 |
|
---|
435 | <mapID target="{$id}">
|
---|
436 | <xsl:attribute name="url">
|
---|
437 | <xsl:call-template name="href.target.uri"/>
|
---|
438 | </xsl:attribute>
|
---|
439 | </mapID>
|
---|
440 | </xsl:template>
|
---|
441 |
|
---|
442 | <!-- ==================================================================== -->
|
---|
443 |
|
---|
444 | <xsl:template name="helpidx">
|
---|
445 | <xsl:call-template name="write.chunk.with.doctype">
|
---|
446 | <xsl:with-param name="filename" select="concat($chunk.base.dir, 'jhelpidx.xml')"/>
|
---|
447 | <xsl:with-param name="method" select="'xml'"/>
|
---|
448 | <xsl:with-param name="indent" select="'yes'"/>
|
---|
449 | <xsl:with-param name="doctype-public" select="'-//Sun Microsystems Inc.//DTD JavaHelp Index Version 1.0//EN'"/>
|
---|
450 | <xsl:with-param name="doctype-system" select="'http://java.sun.com/products/javahelp/index_1_0.dtd'"/>
|
---|
451 | <xsl:with-param name="encoding" select="$javahelp.encoding"/>
|
---|
452 | <xsl:with-param name="content">
|
---|
453 | <xsl:call-template name="helpidx.content"/>
|
---|
454 | </xsl:with-param>
|
---|
455 | <xsl:with-param name="quiet" select="$chunk.quietly"/>
|
---|
456 | </xsl:call-template>
|
---|
457 | </xsl:template>
|
---|
458 |
|
---|
459 | <xsl:template name="helpidx.content">
|
---|
460 | <index version="1.0">
|
---|
461 | <xsl:choose>
|
---|
462 | <xsl:when test="$rootid != ''">
|
---|
463 | <xsl:apply-templates select="key('id',$rootid)//indexterm" mode="idx">
|
---|
464 | <xsl:sort select="primary"/>
|
---|
465 | <xsl:sort select="secondary"/>
|
---|
466 | <xsl:sort select="tertiary"/>
|
---|
467 | </xsl:apply-templates>
|
---|
468 | </xsl:when>
|
---|
469 | <xsl:otherwise>
|
---|
470 | <xsl:apply-templates select="//indexterm" mode="idx">
|
---|
471 | <xsl:sort select="primary"/>
|
---|
472 | <xsl:sort select="secondary"/>
|
---|
473 | <xsl:sort select="tertiary"/>
|
---|
474 | </xsl:apply-templates>
|
---|
475 | </xsl:otherwise>
|
---|
476 | </xsl:choose>
|
---|
477 | </index>
|
---|
478 | </xsl:template>
|
---|
479 |
|
---|
480 | <xsl:template match="indexterm[@class='endofrange']" mode="idx"/>
|
---|
481 |
|
---|
482 | <xsl:template match="indexterm" mode="idx">
|
---|
483 | <xsl:variable name="id">
|
---|
484 | <xsl:call-template name="object.id"/>
|
---|
485 | </xsl:variable>
|
---|
486 |
|
---|
487 | <xsl:variable name="text">
|
---|
488 | <xsl:value-of select="normalize-space(primary)"/>
|
---|
489 | <xsl:if test="secondary">
|
---|
490 | <xsl:text>, </xsl:text>
|
---|
491 | <xsl:value-of select="normalize-space(secondary)"/>
|
---|
492 | </xsl:if>
|
---|
493 | <xsl:if test="tertiary">
|
---|
494 | <xsl:text>, </xsl:text>
|
---|
495 | <xsl:value-of select="normalize-space(tertiary)"/>
|
---|
496 | </xsl:if>
|
---|
497 | </xsl:variable>
|
---|
498 |
|
---|
499 | <xsl:choose>
|
---|
500 | <xsl:when test="see">
|
---|
501 | <xsl:variable name="see"><xsl:value-of select="normalize-space(see)"/></xsl:variable>
|
---|
502 | <indexitem text="{$text} see '{$see}'"/>
|
---|
503 | </xsl:when>
|
---|
504 | <xsl:otherwise>
|
---|
505 | <indexitem text="{$text}" target="{$id}"/>
|
---|
506 | </xsl:otherwise>
|
---|
507 | </xsl:choose>
|
---|
508 | </xsl:template>
|
---|
509 |
|
---|
510 | <!-- ==================================================================== -->
|
---|
511 | <!-- Kludge for Xalan outputting ™ which fails in javahelp -->
|
---|
512 | <xsl:template name="dingbat.characters">
|
---|
513 | <!-- now that I'm using the real serializer, all that dingbat malarky -->
|
---|
514 | <!-- isn't necessary anymore... -->
|
---|
515 | <xsl:param name="dingbat">bullet</xsl:param>
|
---|
516 |
|
---|
517 | <xsl:choose>
|
---|
518 | <xsl:when test="$dingbat='bullet'">•</xsl:when>
|
---|
519 | <xsl:when test="$dingbat='copyright'">©</xsl:when>
|
---|
520 | <xsl:when test="$dingbat='trademark' or $dingbat='trade'">
|
---|
521 | <xsl:choose>
|
---|
522 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
|
---|
523 | <sup>TM</sup>
|
---|
524 | </xsl:when>
|
---|
525 | <xsl:otherwise>™</xsl:otherwise>
|
---|
526 | </xsl:choose>
|
---|
527 | </xsl:when>
|
---|
528 | <xsl:when test="$dingbat='registered'">®</xsl:when>
|
---|
529 | <xsl:when test="$dingbat='service'">(SM)</xsl:when>
|
---|
530 | <xsl:when test="$dingbat='nbsp'"> </xsl:when>
|
---|
531 | <xsl:when test="$dingbat='ldquo'">“</xsl:when>
|
---|
532 | <xsl:when test="$dingbat='rdquo'">”</xsl:when>
|
---|
533 | <xsl:when test="$dingbat='lsquo'">‘</xsl:when>
|
---|
534 | <xsl:when test="$dingbat='rsquo'">’</xsl:when>
|
---|
535 | <xsl:when test="$dingbat='em-dash'">—</xsl:when>
|
---|
536 | <xsl:when test="$dingbat='mdash'">—</xsl:when>
|
---|
537 | <xsl:when test="$dingbat='en-dash'">–</xsl:when>
|
---|
538 | <xsl:when test="$dingbat='ndash'">–</xsl:when>
|
---|
539 | <xsl:otherwise>
|
---|
540 | <xsl:text>•</xsl:text>
|
---|
541 | </xsl:otherwise>
|
---|
542 | </xsl:choose>
|
---|
543 | </xsl:template>
|
---|
544 |
|
---|
545 | </xsl:stylesheet>
|
---|