2 <!DOCTYPE xsl:transform [
3 <!ENTITY % xhtml.characters SYSTEM "../../en/xml/htmlchar.mod">
11 * Add blank whitespace handling to the paragraphed list template
15 <xsl:transform version="1.0"
16 xmlns="http://www.w3.org/1999/xhtml"
17 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18 xmlns:redirect="org.apache.xalan.lib.Redirect"
19 extension-element-prefixes="redirect">
21 <xsl:output method="xml"
23 omit-xml-declaration="yes"
24 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
25 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
27 <xsl:strip-space elements="section data ol ul dl li dd footnotes footnote" />
28 <xsl:preserve-space elements="p choice puzzle deadend" />
30 <!-- ====================== parameters ========================== -->
32 <xsl:param name="use-illustrators" />
33 <xsl:param name="language"><xsl:text>en</xsl:text></xsl:param>
35 <!-- ======================= variables ========================== -->
37 <xsl:variable name="newline">
42 <!-- ======================== Templates ========================= -->
44 <!-- ================= hierarchical sections ==================== -->
46 <xsl:template match="meta" />
47 <xsl:template match="section" />
49 <xsl:template match="/gamebook">
50 <html xml:lang="en-UK" lang="en-UK">
52 <xsl:value-of select="$newline" />
53 <xsl:value-of select="$newline" />
55 <head><xsl:value-of select="$newline" />
57 <xsl:apply-templates select="/gamebook/meta/title[1]" />
58 </title><xsl:value-of select="$newline" />
59 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /><xsl:value-of select="$newline" />
60 <meta name="robots" content="noindex,nofollow" /><xsl:value-of select="$newline" />
63 <xsl:value-of select="$newline" />
64 <xsl:value-of select="$newline" />
68 <xsl:text> </xsl:text>
69 <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
71 <xsl:when test="$language='es'">
72 <xsl:text> Publicado por </xsl:text>
75 <xsl:text> Published by </xsl:text>
78 <xsl:apply-templates select="/gamebook/meta/publisher[1]" />
79 <xsl:text>. </xsl:text>
82 <xsl:value-of select="$newline" />
83 <xsl:value-of select="$newline" />
87 <xsl:apply-templates select="/gamebook/meta/title[1]" />
89 </h1><xsl:value-of select="$newline" />
91 <xsl:apply-templates/>
97 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
99 <xsl:template match="/gamebook/section[@id='title']">
100 <div class="frontmatter"><xsl:value-of select="$newline" />
102 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
103 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
107 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
111 <xsl:when test="$language='es'">
112 <xsl:text>Fecha de Publicación: </xsl:text>
115 <xsl:text>Publication Date: </xsl:text>
118 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
119 <xsl:text> </xsl:text>
121 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
123 <xsl:when test="$language='es'"><xsl:text>de enero de</xsl:text></xsl:when>
124 <xsl:otherwise><xsl:text>January</xsl:text></xsl:otherwise>
127 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
129 <xsl:when test="$language='es'"><xsl:text>de febrero de</xsl:text></xsl:when>
130 <xsl:otherwise><xsl:text>February</xsl:text></xsl:otherwise>
133 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
135 <xsl:when test="$language='es'"><xsl:text>de marzo de</xsl:text></xsl:when>
136 <xsl:otherwise><xsl:text>March</xsl:text></xsl:otherwise>
139 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
141 <xsl:when test="$language='es'"><xsl:text>de abril de</xsl:text></xsl:when>
142 <xsl:otherwise><xsl:text>April</xsl:text></xsl:otherwise>
145 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
147 <xsl:when test="$language='es'"><xsl:text>de mayo de</xsl:text></xsl:when>
148 <xsl:otherwise><xsl:text>May</xsl:text></xsl:otherwise>
151 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
153 <xsl:when test="$language='es'"><xsl:text>de junio de</xsl:text></xsl:when>
154 <xsl:otherwise><xsl:text>June</xsl:text></xsl:otherwise>
157 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
159 <xsl:when test="$language='es'"><xsl:text>de julio de</xsl:text></xsl:when>
160 <xsl:otherwise><xsl:text>July</xsl:text></xsl:otherwise>
163 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
165 <xsl:when test="$language='es'"><xsl:text>de agosto de</xsl:text></xsl:when>
166 <xsl:otherwise><xsl:text>August</xsl:text></xsl:otherwise>
169 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
171 <xsl:when test="$language='es'"><xsl:text>de septiembre de</xsl:text></xsl:when>
172 <xsl:otherwise><xsl:text>September</xsl:text></xsl:otherwise>
175 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
177 <xsl:when test="$language='es'"><xsl:text>de octubre de</xsl:text></xsl:when>
178 <xsl:otherwise><xsl:text>October</xsl:text></xsl:otherwise>
181 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
183 <xsl:when test="$language='es'"><xsl:text>de noviembre de</xsl:text></xsl:when>
184 <xsl:otherwise><xsl:text>November</xsl:text></xsl:otherwise>
187 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
189 <xsl:when test="$language='es'"><xsl:text>de diciembre de</xsl:text></xsl:when>
190 <xsl:otherwise><xsl:text>December</xsl:text></xsl:otherwise>
194 <xsl:text>Invalid Month</xsl:text>
197 <xsl:text> </xsl:text>
198 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
201 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
203 <xsl:value-of select="$newline" />
205 <xsl:value-of select="$newline" />
206 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
208 <xsl:apply-templates />
211 <xsl:template match="/gamebook/section[@id='toc']">
212 <div class="frontmatter"><xsl:value-of select="$newline" />
215 <xsl:when test="$language='es'">
216 <xsl:text>Índice de Contenidos</xsl:text>
219 <xsl:text>Table of Contents</xsl:text>
222 </h2><xsl:value-of select="$newline" />
224 <xsl:value-of select="$newline" />
225 <xsl:value-of select="$newline" />
227 <ul><xsl:value-of select="$newline" />
228 <xsl:variable name="title-page">
230 <xsl:when test="$language='es'">
231 <xsl:text>Página Principal</xsl:text>
234 <xsl:text>Title Page</xsl:text>
239 <xsl:for-each select="/gamebook/section/data/section">
241 <a><xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id" /></xsl:attribute>
242 <xsl:apply-templates select="meta/title[1]" />
244 <xsl:if test="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
245 <xsl:value-of select="$newline" />
246 <ul><xsl:value-of select="$newline" />
247 <xsl:for-each select="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
249 <a><xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id" /></xsl:attribute>
250 <xsl:value-of select ="meta/title[1]" />
252 </li><xsl:value-of select="$newline" />
254 </ul><xsl:value-of select="$newline" />
256 </li><xsl:value-of select="$newline" />
258 </ul><xsl:value-of select="$newline" />
260 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
263 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
265 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
266 <div class="frontmatter"><xsl:value-of select="$newline" />
267 <h2><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h2>
269 <xsl:value-of select="$newline" />
270 <xsl:value-of select="$newline" />
272 <xsl:apply-templates />
276 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
278 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
279 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
281 <xsl:value-of select="$newline" />
282 <xsl:value-of select="$newline" />
284 <xsl:apply-templates />
287 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
288 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
290 <xsl:value-of select="$newline" />
291 <xsl:value-of select="$newline" />
293 <xsl:apply-templates />
296 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
298 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
299 <h4><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h4>
301 <xsl:value-of select="$newline" />
302 <xsl:value-of select="$newline" />
304 <xsl:apply-templates />
307 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
309 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
310 <h5><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h5>
312 <xsl:value-of select="$newline" />
313 <xsl:value-of select="$newline" />
315 <xsl:apply-templates />
318 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
320 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
321 <div class="mainmatter"><xsl:value-of select="$newline" />
322 <h2><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h2>
324 <xsl:value-of select="$newline" />
325 <xsl:value-of select="$newline" />
327 <xsl:apply-templates />
331 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
333 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
334 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
336 <xsl:value-of select="$newline" />
337 <xsl:value-of select="$newline" />
339 <xsl:apply-templates />
342 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter-separate']">
343 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
345 <xsl:value-of select="$newline" />
346 <xsl:value-of select="$newline" />
348 <xsl:apply-templates />
351 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
353 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
354 <h4><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h4>
356 <xsl:value-of select="$newline" />
357 <xsl:value-of select="$newline" />
359 <xsl:apply-templates />
362 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
364 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
365 <h5><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h5>
367 <xsl:value-of select="$newline" />
368 <xsl:value-of select="$newline" />
370 <xsl:apply-templates />
373 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
375 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
376 <div class="numbered"><xsl:value-of select="$newline" />
377 <h2><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h2><xsl:value-of select="$newline" />
378 <xsl:value-of select="$newline" />
380 <xsl:apply-templates/>
382 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
385 <xsl:template match="/gamebook/section/data/section/data/section[@class='numbered']">
386 <h3 align="center"><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3><xsl:value-of select="$newline" />
387 <xsl:value-of select="$newline" />
389 <xsl:apply-templates />
391 <xsl:value-of select="$newline" />
394 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
396 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
397 <div class="frontmatter"><xsl:value-of select="$newline" />
398 <h2><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h2><xsl:value-of select="$newline" />
400 <xsl:value-of select="$newline" />
401 <xsl:value-of select="$newline" />
403 <xsl:apply-templates />
405 <xsl:value-of select="$newline" />
407 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
410 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
412 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
413 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
415 <xsl:value-of select="$newline" />
416 <xsl:value-of select="$newline" />
418 <xsl:apply-templates />
421 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
423 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
424 <h4><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h4>
426 <xsl:value-of select="$newline" />
427 <xsl:value-of select="$newline" />
429 <xsl:apply-templates />
432 <!-- ::::::::::::::::::::: footnotes template ::::::::::::::::::::::::: -->
434 <xsl:template match="id( 'footnotz' )">
435 <div class="backmatter">
436 <xsl:value-of select="$newline" />
437 <!-- No particular reason to code title here -->
438 <h2><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h2><xsl:value-of select="$newline" />
439 <xsl:value-of select="$newline" />
440 <xsl:value-of select="$newline" />
442 <!-- Generate list of footnotes -->
443 <div class="footnote">
444 <xsl:for-each select="//footnotes/footnote">
445 <!-- will the list always contain the closest ancestor first? -->
446 <xsl:variable name="footnote-section"><xsl:value-of select="ancestor::section[position()=1]/@id" /></xsl:variable>
447 <xsl:variable name="footnote-marker"><xsl:number count="footnotes/footnote" from="/" level="any" format="1" /></xsl:variable>
448 <xsl:variable name="footnote-id"><xsl:value-of select="@id" /></xsl:variable>
449 <xsl:variable name="footnote-idref"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:variable>
451 <xsl:for-each select="*[1]">
453 <xsl:text>[</xsl:text>
455 <xsl:attribute name="name"><xsl:value-of select="$footnote-id" /></xsl:attribute>
456 <xsl:attribute name="href"><xsl:value-of select="$footnote-idref" /></xsl:attribute>
457 <xsl:value-of select="$footnote-marker" />
459 <xsl:text>] </xsl:text>
461 <xsl:text> (</xsl:text>
462 <xsl:call-template name="section-title-link" />
463 <xsl:text>) </xsl:text>
465 <xsl:apply-templates select="child::* | child::text()" />
469 <xsl:for-each select="*[position() != 1]">
470 <xsl:apply-templates select="." />
476 <!-- Backwards compatibility... needed? Probably not. -->
477 <xsl:apply-templates />
479 <xsl:value-of select="$newline" />
481 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
484 <!-- ==================== block elements ======================== -->
486 <xsl:template match="p">
487 <p><xsl:apply-templates /></p>
488 <xsl:value-of select="$newline" />
491 <xsl:template match="p[@class='dedication']">
492 <p class="dedication"><xsl:apply-templates /></p>
493 <xsl:value-of select="$newline" />
496 <xsl:template match="dl[@class='paragraphed']/dd/node() | ol[@class='paragraphed']/li/node() | ul[@class='paragraphed']/li/node()">
498 <xsl:when test="self::p">
499 <xsl:apply-templates /><br /><br /><xsl:value-of select="$newline" />
501 <xsl:when test="self::dl">
502 <dl><xsl:value-of select="$newline" />
503 <xsl:apply-templates />
504 </dl><br /><br /><xsl:value-of select="$newline" />
506 <xsl:when test="self::ol">
507 <ol><xsl:value-of select="$newline" />
508 <xsl:apply-templates />
509 </ol><br /><br /><xsl:value-of select="$newline" />
511 <xsl:when test="self::ul">
513 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
514 <xsl:value-of select="$newline" />
515 <xsl:apply-templates />
516 </ul><br /><br /><xsl:value-of select="$newline" />
518 <xsl:when test="self::blockquote">
519 <blockquote><xsl:value-of select="$newline" />
520 <xsl:apply-templates />
521 </blockquote><xsl:value-of select="$newline" />
523 <xsl:when test="self::poetry">
524 <blockquote class="poetry"><xsl:value-of select="$newline" />
525 <xsl:apply-templates />
526 </blockquote><xsl:value-of select="$newline" />
528 <xsl:when test="self::illustration">
529 <!-- Backwards compatibility code -->
530 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
531 <xsl:call-template name="illustration-no-frame" />
534 <xsl:when test="self::illref">
535 <xsl:if test="@class='html'">
536 <xsl:for-each select="id( @idref )">
537 <xsl:apply-templates select="." />
542 <xsl:text>[error: paragraphed list template]</xsl:text>
543 <xsl:message><xsl:text>error: paragraphed list template</xsl:text></xsl:message>
548 <xsl:template match="ol">
549 <ol><xsl:value-of select="$newline" />
550 <xsl:apply-templates />
551 </ol><xsl:value-of select="$newline" />
554 <xsl:template match="ul">
556 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
557 <xsl:value-of select="$newline" />
558 <xsl:apply-templates />
559 </ul><xsl:value-of select="$newline" />
562 <xsl:template match="dl">
563 <dl><xsl:value-of select="$newline" />
564 <xsl:apply-templates />
565 </dl><xsl:value-of select="$newline" />
568 <xsl:template match="dt">
569 <dt><xsl:apply-templates /></dt>
570 <xsl:value-of select="$newline" />
573 <xsl:template match="dd">
574 <dd><xsl:apply-templates /></dd>
575 <xsl:value-of select="$newline" />
578 <xsl:template match="li">
579 <li><xsl:apply-templates /></li>
580 <xsl:value-of select="$newline" />
583 <xsl:template match="table">
584 <table border="1" cellspacing="0" cellpadding="2">
585 <xsl:if test="@summary"><xsl:attribute name="summary"><xsl:value-of select="@summary" /></xsl:attribute></xsl:if>
586 <xsl:apply-templates />
588 <xsl:value-of select="$newline" />
591 <xsl:template match="caption">
593 <xsl:apply-templates />
597 <xsl:template match="colgroup[@scope]">
599 <xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute>
603 <xsl:template match="thead">
605 <xsl:apply-templates />
609 <xsl:template match="tfoot">
611 <xsl:apply-templates />
615 <xsl:template match="tbody">
617 <xsl:apply-templates />
621 <xsl:template match="tr">
623 <xsl:apply-templates />
627 <xsl:template match="th">
629 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
630 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
631 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
632 <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of select="@rowspan" /></xsl:attribute></xsl:if>
633 <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if>
634 <xsl:if test="@axis"><xsl:attribute name="axis"><xsl:value-of select="@axis" /></xsl:attribute></xsl:if>
635 <xsl:if test="@scope"><xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute></xsl:if>
636 <xsl:apply-templates />
640 <xsl:template match="td">
642 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
643 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
644 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
645 <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of select="@rowspan" /></xsl:attribute></xsl:if>
646 <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if>
647 <xsl:if test="@axis"><xsl:attribute name="axis"><xsl:value-of select="@axis" /></xsl:attribute></xsl:if>
648 <xsl:if test="@scope"><xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute></xsl:if>
649 <xsl:apply-templates />
653 <xsl:template match="combat">
655 <xsl:apply-templates select="enemy" />
656 <xsl:text>: </xsl:text>
658 <xsl:when test="enemy-attribute[@class='combatskill']">
661 <xsl:when test="$language='es'">
662 <xsl:text>DESTREZA EN EL COMBATE</xsl:text>
665 <xsl:text>COMBAT SKILL</xsl:text>
669 <xsl:text> </xsl:text>
670 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
672 <xsl:when test="enemy-attribute[@class='closecombatskill']">
675 <xsl:when test="$language='es'">
676 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
679 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
683 <xsl:text> </xsl:text>
684 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
687 <xsl:text> </xsl:text>
690 <xsl:when test="$language='es'">
691 <xsl:text>RESISTENCIA</xsl:text>
694 <xsl:text>ENDURANCE</xsl:text>
699 <xsl:when test="enemy-attribute[@class='target']">
701 <xsl:when test="$language='es'">
702 <xsl:text> (o </xsl:text><small>BLANCOS</small><xsl:text>)</xsl:text>
705 <xsl:text> (</xsl:text><small>TARGET</small><xsl:text> points)</xsl:text>
708 <xsl:text> </xsl:text>
709 <xsl:value-of select="enemy-attribute[@class='target']" />
711 <xsl:when test="enemy-attribute[@class='resistance']">
713 <xsl:when test="$language='es'"></xsl:when>
715 <xsl:text> (</xsl:text><small>RESISTANCE</small><xsl:text> points)</xsl:text>
718 <xsl:text> </xsl:text>
719 <xsl:value-of select="enemy-attribute[@class='resistance']" />
722 <xsl:text> </xsl:text>
723 <xsl:value-of select="enemy-attribute[@class='endurance']" />
727 <xsl:value-of select="$newline" />
730 <xsl:template match="choice">
731 <xsl:variable name="link">
732 <xsl:value-of select="@idref" />
736 <xsl:for-each select="* | text()">
738 <xsl:when test="self::link-text">
740 <xsl:apply-templates />
744 <xsl:apply-templates select="." />
749 <xsl:value-of select="$newline" />
752 <xsl:template match="puzzle">
754 <xsl:apply-templates />
756 <xsl:value-of select="$newline" />
759 <xsl:template match="deadend">
761 <xsl:apply-templates />
763 <xsl:value-of select="$newline" />
766 <xsl:template match="data/signpost">
767 <div class="signpost">
768 <xsl:apply-templates />
770 <xsl:value-of select="$newline" />
773 <xsl:template match="signpost">
774 <span class="signpost"><xsl:apply-templates /></span>
777 <xsl:template match="blockquote">
778 <blockquote><xsl:value-of select="$newline" />
779 <xsl:apply-templates /><xsl:value-of select="$newline" />
780 </blockquote><xsl:value-of select="$newline" />
783 <xsl:template match="poetry">
784 <blockquote class="poetry"><p><xsl:value-of select="$newline" />
785 <xsl:apply-templates /><xsl:value-of select="$newline" />
786 </p></blockquote><xsl:value-of select="$newline" />
789 <xsl:template match="illref">
790 <!-- It is important that the class is not checked right in the template - that would make this template match with higher priority, which will turn a few things upside down -->
791 <xsl:if test="@class='html'">
792 <xsl:for-each select="id( @idref )">
793 <!-- This creates unneccessary regeneration of float illustration pages, but it is easiest to keep things this way as long as we have to be backwards compatible... -->
794 <!-- When backwards compatibility can be dropped, most of (all?) the <illustration> processing can happen here -->
795 <xsl:apply-templates select="." />
800 <xsl:template match="illustrations">
801 <ul class="unbulleted">
802 <xsl:for-each select="illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) )] | illgroup">
804 <xsl:when test="self::illustration and @class='float'">
805 <!-- List item with illustration name as link -->
808 <xsl:when test="$language='es'">
809 <xsl:text>Ilustración </xsl:text>
812 <xsl:text>Illustration </xsl:text>
815 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
816 <!-- List the sections that the illustration appears in -->
817 <xsl:text> (</xsl:text>
818 <xsl:for-each select="//illref[@class='html' and @idref=current()/@id]">
819 <xsl:call-template name="section-title-link" />
820 <xsl:if test="position()!=last()">
821 <xsl:text>, </xsl:text>
824 <xsl:text>)</xsl:text><xsl:value-of select="$newline" />
828 <xsl:when test="self::illustration"> <!-- inline and map -->
829 <!-- List the sections that the illustration appears in -->
831 <!-- TODO: fix this so that sections that do not represent separate XHTML files are not linked to? -->
832 <xsl:for-each select="//illref[@class='html' and @idref=current()/@id]">
833 <xsl:call-template name="section-title-link" />
834 <xsl:if test="position()!=last()">
835 <xsl:text>, </xsl:text>
841 <xsl:when test="self::illgroup and @class!='hidden'">
842 <!-- Check if the group contains any illustrations being used, before creating the list item -->
843 <xsl:if test="count( illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) )] ) != 0">
846 <xsl:attribute name="href"><xsl:value-of select="@idref" /><xsl:text>.htm</xsl:text></xsl:attribute>
847 <xsl:value-of select="id(@idref)/meta/title[1]" />
854 </ul><xsl:value-of select="$newline" />
857 <xsl:template match="illustration">
858 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
860 <xsl:when test="@class='accent'" />
863 <xsl:call-template name="illustration-no-frame" />
869 <xsl:template match="instance" />
871 <xsl:template match="footnotes" />
873 <xsl:template match="footnote" />
875 <xsl:template match="hr">
877 <xsl:value-of select="$newline" />
880 <xsl:template match="choose">
882 <xsl:when test="@test='has-numbered-section-list'">
884 <xsl:when test="when[@value='false']">
885 <xsl:apply-templates select="when[@value='false'][1]/node()" />
887 <xsl:when test="otherwise">
888 <!-- this should only be applied when there is no option for "false" -->
889 <xsl:apply-templates select="otherwise/node()" />
895 <xsl:text>choose: unrecognized test "</xsl:text>
896 <xsl:value-of select="@test" />
897 <xsl:text>" - element ignored.</xsl:text>
903 <!-- ==================== inline elements ======================= -->
905 <xsl:template match="a">
907 <xsl:when test="@href">
909 <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
910 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
911 <xsl:apply-templates />
916 <xsl:if test="@idref">
917 <xsl:attribute name="href">
918 <xsl:text>#</xsl:text><xsl:value-of select="@idref" />
921 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
922 <xsl:apply-templates />
928 <!-- This template is obsolete, the "footref" element should be used instead -->
929 <xsl:template match="a[@class='footnote']">
930 <!-- <xsl:message><xsl:text>WARNING: Obsolete <a idref='...' class='footnote' /> usage</xsl:text></xsl:message> -->
931 <xsl:apply-templates />
934 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
935 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
936 <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
941 <!-- TODO: can this be made more uniform with illrefs? -->
942 <xsl:template match="a[@class='accent-illustration']">
943 <xsl:for-each select="id( @idref )">
944 <xsl:variable name="illustration-src" select="instance[@class='html']/@src" />
945 <xsl:variable name="illustration-width" select="instance[@class='html']/@width" />
946 <xsl:variable name="illustration-height" select="instance[@class='html']/@height" />
947 <xsl:if test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
948 <img src="{$illustration-src}" class="accent" width="{$illustration-width}" height="{$illustration-height}" alt="" border="" align="left" />
953 <xsl:template match="bookref">
955 <xsl:attribute name="href">
956 <xsl:variable name="my-section">
958 <xsl:when test="@section">
959 <xsl:value-of select="@section" />