Debian Codegraph @

xslt/dita/html/dita2html-topic.xsl

raw
1 <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
2 <!--
3 This program is free software; you can redistribute it and/or modify it under
4 the terms of the GNU Lesser General Public License as published by the Free
5 Software Foundation; either version 2 of the License, or (at your option) any
6 later version.
7
8 This program is distributed in the hope that it will be useful, but WITHOUT
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 details.
12
13 You should have received a copy of the GNU Lesser General Public License
14 along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu.org/licenses/>.
15 -->
16 <!DOCTYPE xsl:stylesheet [
17 <!ENTITY % selectors SYSTEM "../common/dita-selectors.mod">
18 %selectors;
19 ]>
20
21 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22 xmlns:exsl="http://exslt.org/common"
23 xmlns:str="http://exslt.org/strings"
24 xmlns:yelp="http://projects.gnome.org/yelp/"
25 xmlns:msg="http://projects.gnome.org/yelp/gettext/"
26 xmlns="http://www.w3.org/1999/xhtml"
27 exclude-result-prefixes="exsl str yelp msg"
28 version="1.0">
29
30 <!--!!==========================================================================
31 DITA to HTML - Topics
32
33 REMARK: Describe this module
34 -->
35
36
37 <xsl:template match="/">
38 <xsl:choose>
39 <xsl:when test="&map_map;">
40 <xsl:for-each select="$dita.map">
41 <xsl:call-template name="html.output">
42 <xsl:with-param name="node" select="&map_map;"/>
43 <xsl:with-param name="href" select="concat('index', $html.extension)"/>
44 </xsl:call-template>
45 </xsl:for-each>
46 </xsl:when>
47 <xsl:when test="&topic_topic;">
48 <!-- Don't call the stylesheets this way for publishing, but
49 sometimes it's useful for one-off simple topic tests. -->
50 <xsl:call-template name="html.output">
51 <xsl:with-param name="node" select="&topic_topic;"/>
52 </xsl:call-template>
53 </xsl:when>
54 <xsl:otherwise>
55 <xsl:message>
56 <xsl:text>Unmatched root element: </xsl:text>
57 <xsl:value-of select="local-name(*)"/>
58 </xsl:message>
59 </xsl:otherwise>
60 </xsl:choose>
61 </xsl:template>
62
63
64 <!-- == dita2html.links.prevnext == -->
65 <xsl:template name="dita2html.links.prevnext">
66 <xsl:param name="node" select="."/>
67 <xsl:variable name="prev" select="($node/ancestor::&map_topicref;[@href][1] |
68 $node/preceding::&map_topicref;[@href][1] |
69 $node/ancestor::&map_map;[1]
70 )[last()]"/>
71 <xsl:variable name="next" select="($node//&map_topicref;[@href][1] |
72 $node/following::&map_topicref;[@href]
73 )[1]"/>
74 <nav class="prevnext pagewide"><div class="inner">
75 <xsl:if test="$prev">
76 <a>
77 <xsl:attribute name="href">
78 <xsl:for-each select="str:split($node/@href, '/')">
79 <xsl:if test="position() != last()">
80 <xsl:text>../</xsl:text>
81 </xsl:if>
82 </xsl:for-each>
83 <xsl:choose>
84 <xsl:when test="$prev[self::&map_map;]">
85 <xsl:call-template name="dita.ref.href.target">
86 <xsl:with-param name="href" select="'index'"/>
87 </xsl:call-template>
88 </xsl:when>
89 <xsl:otherwise>
90 <xsl:call-template name="dita.ref.href.target">
91 <xsl:with-param name="node" select="$prev"/>
92 </xsl:call-template>
93 </xsl:otherwise>
94 </xsl:choose>
95 </xsl:attribute>
96 <xsl:attribute name="title">
97 <xsl:call-template name="dita.ref.topicref.navtitle">
98 <xsl:with-param name="node" select="$prev"/>
99 </xsl:call-template>
100 </xsl:attribute>
101 <xsl:call-template name="l10n.gettext">
102 <xsl:with-param name="msgid" select="'Previous'"/>
103 </xsl:call-template>
104 </a>
105 </xsl:if>
106 <xsl:choose>
107 <xsl:when test="$next">
108 <a>
109 <xsl:attribute name="href">
110 <xsl:for-each select="str:split($node/@href, '/')">
111 <xsl:if test="position() != last()">
112 <xsl:text>../</xsl:text>
113 </xsl:if>
114 </xsl:for-each>
115 <xsl:call-template name="dita.ref.href.target">
116 <xsl:with-param name="node" select="$next"/>
117 </xsl:call-template>
118 </xsl:attribute>
119 <xsl:attribute name="title">
120 <xsl:call-template name="dita.ref.topicref.navtitle">
121 <xsl:with-param name="node" select="$next"/>
122 </xsl:call-template>
123 </xsl:attribute>
124 <xsl:call-template name="l10n.gettext">
125 <xsl:with-param name="msgid" select="'Next'"/>
126 </xsl:call-template>
127 </a>
128 </xsl:when>
129 <xsl:otherwise>
130 <span>
131 <xsl:call-template name="l10n.gettext">
132 <xsl:with-param name="msgid" select="'Next'"/>
133 </xsl:call-template>
134 </span>
135 </xsl:otherwise>
136 </xsl:choose>
137 </div></nav>
138 </xsl:template>
139
140
141 <!-- == dita2html.links.topic == -->
142 <xsl:template name="dita2html.links.topic">
143 <xsl:param name="source" select="."/>
144 <xsl:if test="$source/&map_topicref;">
145 <div class="links sectionlinks" role="navigation">
146 <ul>
147 <xsl:apply-templates mode="dita2html.links.topic.mode" select="$source/&map_topicref;">
148 <xsl:with-param name="source" select="$source"/>
149 </xsl:apply-templates>
150 </ul>
151 </div>
152 </xsl:if>
153 </xsl:template>
154
155 <xsl:template mode="dita2html.links.topic.mode" match="*"/>
156 <xsl:template mode="dita2html.links.topic.mode" match="&map_topicref;">
157 <xsl:param name="source" select=".."/>
158 <li class="links">
159 <xsl:choose>
160 <xsl:when test="@href">
161 <a>
162 <xsl:attribute name="href">
163 <xsl:for-each select="str:split($source/@href, '/')">
164 <xsl:if test="position() != last()">
165 <xsl:text>../</xsl:text>
166 </xsl:if>
167 </xsl:for-each>
168 <xsl:call-template name="dita.ref.href.target"/>
169 </xsl:attribute>
170 <xsl:call-template name="dita.ref.topicref.navtitle"/>
171 </a>
172 <xsl:variable name="desc">
173 <xsl:call-template name="dita.ref.topicref.shortdesc"/>
174 </xsl:variable>
175 <xsl:if test="$desc != ''">
176 <span class="desc">
177 <xsl:text> &#x2014; </xsl:text>
178 <xsl:copy-of select="$desc"/>
179 </span>
180 </xsl:if>
181 </xsl:when>
182 <xsl:otherwise>
183 <xsl:call-template name="dita.ref.topicref.navtitle"/>
184 <xsl:if test="&map_topicref;">
185 <ul>
186 <xsl:apply-templates mode="dita2html.links.topic.mode" select="&map_topicref;">
187 <xsl:with-param name="source" select="$source"/>
188 </xsl:apply-templates>
189 </ul>
190 </xsl:if>
191 </xsl:otherwise>
192 </xsl:choose>
193 </li>
194 </xsl:template>
195
196
197 <!-- == dita2html.topic.about == -->
198 <xsl:template name="dita2html.topic.about">
199 <xsl:param name="node" select="."/>
200 <xsl:variable name="info" select="yelp:dita.ref.conref($node/&topic_prolog;) |
201 yelp:dita.ref.conref($node/&map_topicmeta;)"/>
202 <xsl:variable name="copyrights" select="$info/&topic_copyright;"/>
203 <xsl:variable name="authors" select="$info/&topic_author;[@type = 'creator']"/>
204 <xsl:variable name="translators" select="$info/&topic_author;[@type = 'translator']"/>
205 <xsl:variable name="publishers" select="$info/&topic_publisher;"/>
206 <xsl:variable name="others" select="$info/&topic_author;[not(@type = 'creator' or @type = 'translator')]"/>
207 <xsl:if test="$copyrights or $authors or $translators or $publishers or $others">
208 <div class="about ui-expander" role="contentinfo">
209 <div class="yelp-data yelp-data-ui-expander" data-yelp-expanded="false"/>
210 <div class="inner">
211 <div class="hgroup">
212 <h2>
213 <span class="title">
214 <xsl:call-template name="l10n.gettext">
215 <xsl:with-param name="msgid" select="'About'"/>
216 </xsl:call-template>
217 </span>
218 </h2>
219 </div>
220 <div class="region">
221 <div class="contents">
222 <xsl:if test="$copyrights">
223 <div class="copyrights">
224 <xsl:for-each select="$copyrights">
225 <div class="copyright">
226 <xsl:call-template name="l10n.gettext">
227 <xsl:with-param name="msgid" select="'copyright.format'"/>
228 <xsl:with-param name="node" select="."/>
229 <xsl:with-param name="format" select="true()"/>
230 </xsl:call-template>
231 </div>
232 </xsl:for-each>
233 </div>
234 </xsl:if>
235 <xsl:if test="$authors or $translators or $publishers or $others">
236 <div class="credits">
237 <xsl:call-template name="_dita2html.topic.about.credits">
238 <xsl:with-param name="class" select="'credits-authors'"/>
239 <xsl:with-param name="title" select="'Written By'"/>
240 <xsl:with-param name="credits" select="$authors"/>
241 </xsl:call-template>
242 <xsl:call-template name="_dita2html.topic.about.credits">
243 <xsl:with-param name="class" select="'credits-translators'"/>
244 <xsl:with-param name="title" select="'Translated By'"/>
245 <xsl:with-param name="credits" select="$translators"/>
246 </xsl:call-template>
247 <xsl:call-template name="_dita2html.topic.about.credits">
248 <xsl:with-param name="class" select="'credits-publishers'"/>
249 <xsl:with-param name="title" select="'Published By'"/>
250 <xsl:with-param name="credits" select="$publishers"/>
251 </xsl:call-template>
252 <xsl:call-template name="_dita2html.topic.about.credits">
253 <xsl:with-param name="class" select="'credits-others'"/>
254 <xsl:with-param name="title" select="'Other Credits'"/>
255 <xsl:with-param name="credits" select="$others"/>
256 </xsl:call-template>
257 </div>
258 </xsl:if>
259 </div>
260 </div>
261 </div>
262 </div>
263 </xsl:if>
264 </xsl:template>
265
266 <!--#* _dita2html.topic.about.credits -->
267 <xsl:template name="_dita2html.topic.about.credits">
268 <xsl:param name="class"/>
269 <xsl:param name="title"/>
270 <xsl:param name="credits"/>
271 <xsl:if test="$credits">
272 <div class="{$class}">
273 <div class="title">
274 <span class="title">
275 <xsl:call-template name="l10n.gettext">
276 <xsl:with-param name="msgid" select="$title"/>
277 </xsl:call-template>
278 </span>
279 </div>
280 <ul class="credits">
281 <xsl:for-each select="$credits">
282 <li>
283 <xsl:apply-templates mode="dita2html.topic.mode"/>
284 </li>
285 </xsl:for-each>
286 </ul>
287 </div>
288 </xsl:if>
289 </xsl:template>
290
291
292 <xsl:template mode="l10n.format.mode" match="msg:copyright.years">
293 <xsl:param name="node"/>
294 <xsl:value-of select="$node/&topic_copyryear;/@year"/>
295 </xsl:template>
296
297 <xsl:template mode="l10n.format.mode" match="msg:copyright.name">
298 <xsl:param name="node"/>
299 <xsl:apply-templates mode="dita2html.topic.mode"
300 select="$node/&topic_copyrholder;/node()"/>
301 </xsl:template>
302
303
304 <!--#% html.output.after.mode -->
305 <xsl:template mode="html.output.after.mode" match="/&map_map; | &map_topicref;">
306 <xsl:for-each select="&map_topicref;">
307 <xsl:choose>
308 <xsl:when test="@href">
309 <xsl:call-template name="html.output">
310 <xsl:with-param name="href">
311 <xsl:call-template name="dita.ref.href.target"/>
312 </xsl:with-param>
313 </xsl:call-template>
314 </xsl:when>
315 <xsl:otherwise>
316 <xsl:apply-templates mode="html.output.after.mode" select="."/>
317 </xsl:otherwise>
318 </xsl:choose>
319 </xsl:for-each>
320 </xsl:template>
321
322
323 <!-- == map & html.*.mode == -->
324
325 <!--
326 FIXME
327 html.sidebar.contents.mode
328 html.sidebar.sections.mode
329 -->
330
331 <!-- = map % html.title.mode = -->
332 <xsl:template mode="html.title.mode" match="&map_map;">
333 <xsl:choose>
334 <xsl:when test="&topic_booktitle;/&topic_mainbooktitle;">
335 <xsl:value-of select="&topic_booktitle;/&topic_mainbooktitle;"/>
336 </xsl:when>
337 <xsl:otherwise>
338 <xsl:value-of select="&topic_title_all;"/>
339 </xsl:otherwise>
340 </xsl:choose>
341 </xsl:template>
342
343 <!-- = map % html.header.mode = -->
344 <xsl:template mode="html.header.mode" match="&map_map;">
345 <xsl:call-template name="html.linktrails.empty">
346 <xsl:with-param name="node" select="."/>
347 </xsl:call-template>
348 </xsl:template>
349
350 <!-- = map % html.footer.mode = -->
351 <xsl:template mode="html.footer.mode" match="&map_map;">
352 <xsl:call-template name="dita2html.topic.about"/>
353 </xsl:template>
354
355 <!-- = map % html.body.mode = -->
356 <xsl:template mode="html.body.mode" match="&map_map;">
357 <xsl:call-template name="dita2html.links.prevnext"/>
358 <div class="hgroup">
359 <h1 class="title">
360 <span class="title">
361 <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_title_all;/node()"/>
362 </span>
363 </h1>
364 </div>
365 <div class="region">
366 <xsl:call-template name="dita.id"/>
367 <xsl:call-template name="html.lang.attrs"/>
368 <div class="contents">
369 <xsl:call-template name="dita2html.links.topic">
370 <xsl:with-param name="source" select="."/>
371 </xsl:call-template>
372 </div>
373 </div>
374 <xsl:call-template name="dita2html.links.prevnext"/>
375 <div class="clear"/>
376 </xsl:template>
377
378
379 <!-- == topicref % html.*.mode == -->
380
381 <!-- = topicref % html.title.mode = -->
382 <xsl:template mode="html.title.mode" match="&map_topicref;">
383 <xsl:value-of select="document(@href, $dita.map.base)/&topic_topic_all;/&topic_title_all;"/>
384 </xsl:template>
385
386 <!-- = topicref % html.header.mode = -->
387 <xsl:template mode="html.header.mode" match="&map_topicref;">
388 <xsl:variable name="node" select="."/>
389 <xsl:variable name="direction">
390 <xsl:call-template name="l10n.direction">
391 <xsl:with-param name="node" select="$node"/>
392 </xsl:call-template>
393 </xsl:variable>
394 <xsl:variable name="sep">
395 <xsl:choose>
396 <xsl:when test="$direction = 'rtl'">
397 <xsl:text>&#x200F;&#x00A0;» &#x200F;</xsl:text>
398 </xsl:when>
399 <xsl:otherwise>
400 <xsl:text>&#x00A0;» </xsl:text>
401 </xsl:otherwise>
402 </xsl:choose>
403 </xsl:variable>
404 <div class="trails" role="navigation">
405 <div class="trail">
406 <xsl:call-template name="html.linktrails.prefix">
407 <xsl:with-param name="node" select="$node"/>
408 </xsl:call-template>
409 <a class="trail">
410 <xsl:attribute name="href">
411 <xsl:for-each select="str:split($node/@href, '/')">
412 <xsl:if test="position() != last()">
413 <xsl:text>../</xsl:text>
414 </xsl:if>
415 </xsl:for-each>
416 <xsl:call-template name="dita.ref.href.target">
417 <xsl:with-param name="href" select="'index'"/>
418 </xsl:call-template>
419 </xsl:attribute>
420 <xsl:call-template name="dita.ref.topicref.navtitle">
421 <xsl:with-param name="node" select="/&map_map;"/>
422 </xsl:call-template>
423 </a>
424 <xsl:value-of select="$sep"/>
425 <xsl:for-each select="(ancestor::&map_topicref;)">
426 <xsl:choose>
427 <xsl:when test="@href">
428 <a class="trail">
429 <xsl:attribute name="href">
430 <xsl:for-each select="str:split($node/@href, '/')">
431 <xsl:if test="position() != last()">
432 <xsl:text>../</xsl:text>
433 </xsl:if>
434 </xsl:for-each>
435 <xsl:call-template name="dita.ref.href.target"/>
436 </xsl:attribute>
437 <xsl:call-template name="dita.ref.topicref.navtitle"/>
438 </a>
439 </xsl:when>
440 <xsl:otherwise>
441 <xsl:call-template name="dita.ref.topicref.navtitle"/>
442 </xsl:otherwise>
443 </xsl:choose>
444 <xsl:value-of select="$sep"/>
445 </xsl:for-each>
446 </div>
447 </div>
448 </xsl:template>
449
450 <!-- = topicref % html.footer.mode = -->
451 <xsl:template mode="html.footer.mode" match="&map_topicref;">
452 <xsl:call-template name="dita2html.topic.about">
453 <xsl:with-param name="node" select="document(@href, $dita.map.base)/*"/>
454 </xsl:call-template>
455 </xsl:template>
456
457 <!-- = topicref % html.body.mode = -->
458 <xsl:template mode="html.body.mode" match="&map_topicref;">
459 <xsl:variable name="node" select="."/>
460 <xsl:call-template name="dita2html.links.prevnext"/>
461 <xsl:apply-templates mode="dita2html.topic.mode" select="document(@href, $dita.map.base)/*">
462 <xsl:with-param name="topicref" select="$node"/>
463 </xsl:apply-templates>
464 <xsl:call-template name="dita2html.links.prevnext"/>
465 <div class="clear"/>
466 </xsl:template>
467
468
469 <!-- == topic % html.*.mode == -->
470 <!-- These only get called when using a topic as a top-level, instead
471 of a map. You shouldn't generally use these stylesheets that way, but
472 it's occasionally useful for testing simple topics. -->
473
474 <!-- = topic % html.title.mode = -->
475 <xsl:template mode="html.title.mode" match="&topic_topic;">
476 <xsl:value-of select="&topic_title_all;"/>
477 </xsl:template>
478
479 <!-- = topic % html.header.mode = -->
480 <xsl:template mode="html.header.mode" match="&topic_topic;">
481 </xsl:template>
482
483 <!-- = topic % html.footer.mode = -->
484 <xsl:template mode="html.footer.mode" match="&topic_topic;">
485 <xsl:call-template name="dita2html.topic.about"/>
486 </xsl:template>
487
488 <!-- = topic % html.body.mode = -->
489 <xsl:template mode="html.body.mode" match="&topic_topic;">
490 <xsl:apply-templates mode="dita2html.topic.mode" select="."/>
491 </xsl:template>
492
493
494 <!-- == CSS == -->
495
496 <xsl:template mode="html.css.mode" match="*">
497 <!-- FIXME: open document for @lang -->
498 <xsl:param name="direction">
499 <xsl:call-template name="l10n.direction"/>
500 </xsl:param>
501 <xsl:param name="left">
502 <xsl:call-template name="l10n.align.start">
503 <xsl:with-param name="direction" select="$direction"/>
504 </xsl:call-template>
505 </xsl:param>
506 <xsl:param name="right">
507 <xsl:call-template name="l10n.align.end">
508 <xsl:with-param name="direction" select="$direction"/>
509 </xsl:call-template>
510 </xsl:param>
511 <xsl:text>
512 span.b {
513 font-weight: bold;
514 color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
515 }
516 span.i { font-style: italic; }
517 span.u { text-decoration: underline; }
518 span.shortcut { text-decoration: underline; }
519 li.stepsection {
520 margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
521 list-style-type: none;
522 }
523 ul.list-sli { list-style-type: none; }
524 ul.compact-sli li { margin-top: 0; line-height: 1.44em; }
525 dt.dthd, dd.ddhd {
526 font-weight: bold;
527 color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
528 }
529 th, td { border: solid 1px; }
530 div.dita-object > div.desc {
531 margin: 0 0 0.2em 0;
532 font-weight: bold;
533 color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
534 }
535
536 </xsl:text>
537 </xsl:template>
538
539
540 <!-- == Matched Templates == -->
541
542 <!-- = topic = -->
543 <xsl:template mode="dita2html.topic.mode" match="&topic_topic_all;">
544 <xsl:param name="topicref" select="/false"/>
545 <xsl:choose>
546 <xsl:when test="parent::&topic_topic_all;">
547 <section>
548 <xsl:call-template name="dita.id"/>
549 <xsl:call-template name="html.lang.attrs"/>
550 <xsl:call-template name="html.class.attr">
551 <xsl:with-param name="class" select="local-name(.)"/>
552 </xsl:call-template>
553 <div class="inner">
554 <xsl:call-template name="_dita2html.topic.inner"/>
555 </div>
556 </section>
557 </xsl:when>
558 <xsl:otherwise>
559 <xsl:call-template name="_dita2html.topic.inner">
560 <xsl:with-param name="topicref" select="$topicref"/>
561 </xsl:call-template>
562 </xsl:otherwise>
563 </xsl:choose>
564 </xsl:template>
565
566 <!--#* _dita2html.topic.inner -->
567 <xsl:template name="_dita2html.topic.inner">
568 <xsl:param name="topicref" select="/false"/>
569 <xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
570 <xsl:variable name="depth" select="count(ancestor::*) + 1"/>
571 <xsl:variable name="depth_">
572 <xsl:choose>
573 <xsl:when test="$depth &lt; 6">
574 <xsl:value-of select="$depth"/>
575 </xsl:when>
576 <xsl:otherwise>
577 <xsl:value-of select="6"/>
578 </xsl:otherwise>
579 </xsl:choose>
580 </xsl:variable>
581 <div class="hgroup pagewide">
582 <xsl:element name="{concat('h', $depth_)}" namespace="{$html.namespace}">
583 <xsl:attribute name="class">
584 <xsl:text>title</xsl:text>
585 </xsl:attribute>
586 <span class="title">
587 <xsl:apply-templates mode="dita2html.topic.mode" select="$conref/&topic_title_all;/node()"/>
588 </span>
589 </xsl:element>
590 </div>
591 <div class="region">
592 <xsl:apply-templates mode="dita2html.topic.mode" select="$conref/&topic_body;">
593 <xsl:with-param name="topicref" select="$topicref"/>
594 </xsl:apply-templates>
595 <xsl:apply-templates mode="dita2html.topic.mode" select="$conref/&topic_topic_all;"/>
596 <xsl:apply-templates mode="dita2html.topic.mode" select="$conref/&topic_related-links;"/>
597 </div>
598 </xsl:template>
599
600 <xsl:template mode="dita2html.topic.mode" match="&topic_body;">
601 <xsl:param name="topicref" select="/false"/>
602 <xsl:variable name="node" select="."/>
603 <xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
604 <div>
605 <xsl:call-template name="dita.id"/>
606 <xsl:call-template name="html.lang.attrs"/>
607 <xsl:call-template name="html.class.attr">
608 <xsl:with-param name="class" select="'contents pagewide'"/>
609 </xsl:call-template>
610 <xsl:call-template name="html.content.pre">
611 <xsl:with-param name="page" select="not(../parent::&topic_topic_all;)"/>
612 </xsl:call-template>
613 <xsl:apply-templates mode="dita2html.topic.mode" select="../&topic_shortdesc;"/>
614 <xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
615 <xsl:call-template name="dita2html.links.topic">
616 <xsl:with-param name="source" select="$topicref"/>
617 </xsl:call-template>
618 <xsl:call-template name="html.content.post">
619 <xsl:with-param name="page" select="not(../parent::&topic_topic_all;)"/>
620 </xsl:call-template>
621 </div>
622 </xsl:template>
623
624 <xsl:template mode="dita2html.topic.mode" match="&topic_related-links;">
625 <section role="navigation">
626 <xsl:call-template name="html.lang.attrs"/>
627 <xsl:call-template name="html.class.attr">
628 <xsl:with-param name="class" select="'links'"/>
629 </xsl:call-template>
630 <div class="inner">
631 <div class="hgroup pagewide"/>
632 <div class="contents pagewide">
633 <div class="links">
634 <xsl:call-template name="dita.id"/>
635 <xsl:call-template name="html.lang.attrs"/>
636 <div class="inner">
637 <div class="region">
638 <ul>
639 <xsl:apply-templates mode="dita2html.topic.mode"/>
640 </ul>
641 </div>
642 </div>
643 </div>
644 </div>
645 </div>
646 </section>
647 </xsl:template>
648
649 <xsl:template mode="dita2html.topic.mode" match="&topic_link;">
650 <!-- FIXME -->
651 <li>
652 <xsl:call-template name="dita.id"/>
653 <xsl:call-template name="html.lang.attrs"/>
654 <xsl:call-template name="html.class.attr">
655 <xsl:with-param name="class" select="'links'"/>
656 </xsl:call-template>
657 <a>
658 <xsl:attribute name="href">
659 <!-- FIXME -->
660 <xsl:value-of select="@href"/>
661 </xsl:attribute>
662 <xsl:variable name="linktext" select="&topic_linktext;"/>
663 <xsl:choose>
664 <xsl:when test="$linktext">
665 <xsl:for-each select="$linktext[1]">
666 <span class="linktext">
667 <xsl:call-template name="html.lang.attrs"/>
668 <xsl:apply-templates mode="dita2html.topic.mode"/>
669 </span>
670 </xsl:for-each>
671 </xsl:when>
672 <xsl:otherwise>
673 <!-- FIXME -->
674 <xsl:value-of select="@href"/>
675 </xsl:otherwise>
676 </xsl:choose>
677 </a>
678 <xsl:variable name="desc" select="&topic_desc;"/>
679 <xsl:for-each select="$desc[1]">
680 <span class="desc">
681 <xsl:call-template name="html.lang.attrs"/>
682 <xsl:text> &#x2014; </xsl:text>
683 <xsl:apply-templates mode="dita2html.topic.mode"/>
684 </span>
685 </xsl:for-each>
686 </li>
687 </xsl:template>
688
689 <xsl:template mode="dita2html.topic.mode" match="&topic_linkinfo;">
690 <li>
691 <xsl:call-template name="dita.id"/>
692 <xsl:call-template name="html.lang.attrs"/>
693 <xsl:call-template name="html.class.attr">
694 <xsl:with-param name="class" select="'links links-linkinfo'"/>
695 </xsl:call-template>
696 <xsl:apply-templates modes="dita2html.topic.mode"/>
697 </li>
698 </xsl:template>
699
700 <xsl:template mode="dita2html.topic.mode" match="&topic_linklist;">
701 <xsl:choose>
702 <xsl:when test="&topic_title_all; or &topic_desc; or &topic_linkinfo;">
703 <li class="links">
704 <div>
705 <xsl:call-template name="dita.id"/>
706 <xsl:call-template name="html.lang.attrs"/>
707 <xsl:call-template name="html.class.attr">
708 <xsl:with-param name="class" select="'links'"/>
709 </xsl:call-template>
710 <div class="inner">
711 <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_title_all;"/>
712 <div class="region">
713 <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_desc;"/>
714 <ul>
715 <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_link; | &topic_linklist;"/>
716 <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_linkinfo;"/>
717 </ul>
718 </div>
719 </div>
720 </div>
721 </li>
722 </xsl:when>
723 <xsl:otherwise>
724 <xsl:apply-templates mode="dita2html.topic.mode"
725 select="&topic_link; | &topic_linklist;"/>
726 </xsl:otherwise>
727 </xsl:choose>
728 </xsl:template>
729
730 <xsl:template mode="dita2html.topic.mode" match="&topic_linkpool;">
731 <xsl:apply-templates mode="dita2html.topic.mode"/>
732 </xsl:template>
733
734 <!-- FIXME -->
735
736 <xsl:template mode="dita2html.topic.mode" match="&topic_prolog;"/>
737
738 <xsl:template mode="dita2html.topic.mode" match="*">
739 <xsl:message>
740 <xsl:text>Unmatched element: </xsl:text>
741 <xsl:value-of select="local-name(.)"/>
742 </xsl:message>
743 <xsl:apply-templates mode="dita2html.topic.mode"/>
744 </xsl:template>
745
746 </xsl:stylesheet>