2 <!DOCTYPE xsl:transform [
3 <!ENTITY % xhtml.characters SYSTEM "../../en/xml/htmlchar.mod">
12 Revision 1.5 2007/02/02 20:04:28 jonathan.blake
13 Correction to handling line elements
15 Revision 1.4 2006/12/20 00:15:04 jonathan.blake
16 Updated to handle the new capabilities in version 0.12.1 of the Gamebook DTD.
18 Revision 1.3 2006/12/07 01:42:28 jonathan.blake
19 Text illustrations need inclusion
21 Revision 1.2 2006/11/25 18:57:16 jonathan.blake
22 Fixed links to footnotes
24 Revision 1.1 2006/11/25 04:48:52 jonathan.blake
25 Modified to generate a single unstyled, UTF-8, HTML file which lacks any illustrations
28 ///// xhtml.xsl used as source for xhtml-mongoose.xsl
30 Revision 1.12 2006/06/05 23:46:46 jonathan.blake
31 Fixing the handling of titles when <ch.*/> elements are used.
33 Revision 1.11 2006/04/04 18:48:52 angantyr
34 Fixed paragraphed list and illref template bug.
36 Revision 1.10 2006/04/02 19:14:37 angantyr
37 Introduced automatic footnotes list generation and changed the illustrations
38 list generation so that links to numbered sections are titled "Section ...".
39 Backwards compatible with old XML files.
41 Revision 1.9 2006/03/14 21:04:03 angantyr
42 Changed the illustration handling with the introduction of 'illref's.
45 Revision 1.8 2006/03/13 18:38:49 jonathan.blake
46 Fixed minor Spanish translation issue
48 Revision 1.7 2006/03/09 18:56:33 jonathan.blake
49 Added a language parameter and coding to switch between languages when the output is hard-coded into the transformation.
51 Revision 1.5 2006/03/02 00:33:32 jonathan.blake
52 Removed the 'book-path' parameter to work with new gbtoxhtml.pl
54 Revision 1.4 2005/12/27 01:51:29 angantyr
55 Added templates for the "bookref" and "footref" elements.
57 Revision 1.3 2005/12/05 21:29:04 jonathan.blake
58 Added the facilities to properly handle character elements.
60 Revision 1.2 2005/04/09 19:51:50 angantyr
61 Added handling of open-ended quotes.
63 Revision 1.1 2005/01/30 01:32:52 jonathan.blake
64 Initial freepository revision of XML support documents.
66 Revision 1.12 2003/10/07 06:05:14 Jon
67 Added capability for "accent" illustrations.
69 Revision 1.11 2002/12/06 22:12:04 jblake
70 Added default namespace declaration to transformation element
71 and removed all the extraneous declarations in the template
74 Revision 1.10 2002/11/17 22:37:25 jblake
75 Removed the "medium" creator entry from the templates.
76 Will they be of any use?
78 Revision 1.9 2002/11/17 05:06:56 jblake
79 Rearranged the title page.
81 Revision 1.8 2002/11/15 19:35:25 jblake
82 Fixed "Content-type" of XHTML output.
84 Revision 1.7 2002/11/15 00:15:39 jblake
85 Fixed a problem with the client-side image map and fixed
86 the numbered section list generation so that it will work
87 for Shadow on the Sand.
89 Revision 1.6 2002/10/30 05:59:45 jblake
90 Added a value for the alt attribute of the ToC image on the navigation bar.
92 Revision 1.5 2002/10/24 15:53:41 jblake
93 Fixed a conflict with whitespace and paragraphed lists.
95 Revision 1.4 2002/10/24 15:06:51 jblake
96 Added xmlns attributes to all elements that are top level in
97 their templates. This was an adjustment required by Xalan-J 2.4.
99 Also reinstated the comment in each document since the new
100 version of Xalan redirects it properly.
102 Revision 1.3 2002/10/23 05:18:29 jblake
103 Added the capability to filter which illustrators' work is used.
104 This is accomplished by the "use-illustrators" parameter.
106 Revision 1.2 2002/10/20 06:25:35 jblake
107 Added support for CLOSE COMBAT SKILL for Freeway Warrior books.
109 Revision 1.1 2002/10/15 23:29:51 jblake
113 20020327 - repurposed to be used with Xalan Java 2
117 * Add blank whitespace handling to the paragraphed list template
121 <xsl:transform version="1.0"
122 xmlns="http://www.w3.org/1999/xhtml"
123 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
124 xmlns:redirect="org.apache.xalan.lib.Redirect"
125 extension-element-prefixes="redirect">
127 <xsl:output method="xml"
129 omit-xml-declaration="yes"
130 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
131 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
133 <xsl:strip-space elements="section data ol ul dl li dd footnotes footnote" />
134 <xsl:preserve-space elements="p choice puzzle deadend" />
136 <!-- ====================== parameters ========================== -->
138 <xsl:param name="use-illustrators" />
139 <xsl:param name="language"><xsl:text>en</xsl:text></xsl:param>
141 <!-- ======================= variables ========================== -->
143 <xsl:variable name="newline">
148 <!-- ======================== Templates ========================= -->
150 <!-- ================= hierarchical sections ==================== -->
152 <xsl:template match="meta" />
153 <xsl:template match="section" />
155 <xsl:template match="/gamebook">
156 <html xml:lang="en-UK" lang="en-UK">
158 <xsl:value-of select="$newline" />
159 <xsl:value-of select="$newline" />
161 <head><xsl:value-of select="$newline" />
163 <xsl:apply-templates select="/gamebook/meta/title[1]" />
164 </title><xsl:value-of select="$newline" />
165 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /><xsl:value-of select="$newline" />
166 <meta name="robots" content="noindex,nofollow" /><xsl:value-of select="$newline" />
169 <xsl:value-of select="$newline" />
170 <xsl:value-of select="$newline" />
174 <xsl:text> </xsl:text>
175 <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
177 <xsl:when test="$language='es'">
178 <xsl:text> Publicado por </xsl:text>
181 <xsl:text> Published by </xsl:text>
184 <xsl:apply-templates select="/gamebook/meta/publisher[1]" />
185 <xsl:text>. </xsl:text>
188 <xsl:value-of select="$newline" />
189 <xsl:value-of select="$newline" />
193 <xsl:apply-templates select="/gamebook/meta/title[1]" />
195 </h1><xsl:value-of select="$newline" />
197 <xsl:apply-templates/>
203 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
205 <xsl:template match="/gamebook/section[@id='title']">
206 <div class="frontmatter"><xsl:value-of select="$newline" />
208 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
209 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
213 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
217 <xsl:when test="$language='es'">
218 <xsl:text>Fecha de Publicación: </xsl:text>
221 <xsl:text>Publication Date: </xsl:text>
224 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
225 <xsl:text> </xsl:text>
227 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
229 <xsl:when test="$language='es'"><xsl:text>de enero de</xsl:text></xsl:when>
230 <xsl:otherwise><xsl:text>January</xsl:text></xsl:otherwise>
233 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
235 <xsl:when test="$language='es'"><xsl:text>de febrero de</xsl:text></xsl:when>
236 <xsl:otherwise><xsl:text>February</xsl:text></xsl:otherwise>
239 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
241 <xsl:when test="$language='es'"><xsl:text>de marzo de</xsl:text></xsl:when>
242 <xsl:otherwise><xsl:text>March</xsl:text></xsl:otherwise>
245 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
247 <xsl:when test="$language='es'"><xsl:text>de abril de</xsl:text></xsl:when>
248 <xsl:otherwise><xsl:text>April</xsl:text></xsl:otherwise>
251 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
253 <xsl:when test="$language='es'"><xsl:text>de mayo de</xsl:text></xsl:when>
254 <xsl:otherwise><xsl:text>May</xsl:text></xsl:otherwise>
257 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
259 <xsl:when test="$language='es'"><xsl:text>de junio de</xsl:text></xsl:when>
260 <xsl:otherwise><xsl:text>June</xsl:text></xsl:otherwise>
263 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
265 <xsl:when test="$language='es'"><xsl:text>de julio de</xsl:text></xsl:when>
266 <xsl:otherwise><xsl:text>July</xsl:text></xsl:otherwise>
269 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
271 <xsl:when test="$language='es'"><xsl:text>de agosto de</xsl:text></xsl:when>
272 <xsl:otherwise><xsl:text>August</xsl:text></xsl:otherwise>
275 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
277 <xsl:when test="$language='es'"><xsl:text>de septiembre de</xsl:text></xsl:when>
278 <xsl:otherwise><xsl:text>September</xsl:text></xsl:otherwise>
281 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
283 <xsl:when test="$language='es'"><xsl:text>de octubre de</xsl:text></xsl:when>
284 <xsl:otherwise><xsl:text>October</xsl:text></xsl:otherwise>
287 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
289 <xsl:when test="$language='es'"><xsl:text>de noviembre de</xsl:text></xsl:when>
290 <xsl:otherwise><xsl:text>November</xsl:text></xsl:otherwise>
293 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
295 <xsl:when test="$language='es'"><xsl:text>de diciembre de</xsl:text></xsl:when>
296 <xsl:otherwise><xsl:text>December</xsl:text></xsl:otherwise>
300 <xsl:text>Invalid Month</xsl:text>
303 <xsl:text> </xsl:text>
304 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
307 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
309 <xsl:value-of select="$newline" />
311 <xsl:value-of select="$newline" />
312 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
314 <xsl:apply-templates />
317 <xsl:template match="/gamebook/section[@id='toc']">
318 <div class="frontmatter"><xsl:value-of select="$newline" />
321 <xsl:when test="$language='es'">
322 <xsl:text>Índice de Contenidos</xsl:text>
325 <xsl:text>Table of Contents</xsl:text>
328 </h2><xsl:value-of select="$newline" />
330 <xsl:value-of select="$newline" />
331 <xsl:value-of select="$newline" />
333 <ul><xsl:value-of select="$newline" />
334 <xsl:variable name="title-page">
336 <xsl:when test="$language='es'">
337 <xsl:text>Página Principal</xsl:text>
340 <xsl:text>Title Page</xsl:text>
345 <xsl:for-each select="/gamebook/section/data/section">
347 <a><xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id" /></xsl:attribute>
348 <xsl:apply-templates select="meta/title[1]" />
350 <xsl:if test="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
351 <xsl:value-of select="$newline" />
352 <ul><xsl:value-of select="$newline" />
353 <xsl:for-each select="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
355 <a><xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id" /></xsl:attribute>
356 <xsl:value-of select ="meta/title[1]" />
358 </li><xsl:value-of select="$newline" />
360 </ul><xsl:value-of select="$newline" />
362 </li><xsl:value-of select="$newline" />
364 </ul><xsl:value-of select="$newline" />
366 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
369 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
371 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
372 <div class="frontmatter"><xsl:value-of select="$newline" />
373 <h2><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h2>
375 <xsl:value-of select="$newline" />
376 <xsl:value-of select="$newline" />
378 <xsl:apply-templates />
382 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
384 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
385 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
387 <xsl:value-of select="$newline" />
388 <xsl:value-of select="$newline" />
390 <xsl:apply-templates />
393 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
394 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
396 <xsl:value-of select="$newline" />
397 <xsl:value-of select="$newline" />
399 <xsl:apply-templates />
402 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
404 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
405 <h4><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h4>
407 <xsl:value-of select="$newline" />
408 <xsl:value-of select="$newline" />
410 <xsl:apply-templates />
413 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
415 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
416 <h5><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h5>
418 <xsl:value-of select="$newline" />
419 <xsl:value-of select="$newline" />
421 <xsl:apply-templates />
424 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
426 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
427 <div class="mainmatter"><xsl:value-of select="$newline" />
428 <h2><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h2>
430 <xsl:value-of select="$newline" />
431 <xsl:value-of select="$newline" />
433 <xsl:apply-templates />
437 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
439 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
440 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
442 <xsl:value-of select="$newline" />
443 <xsl:value-of select="$newline" />
445 <xsl:apply-templates />
448 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter-separate']">
449 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
451 <xsl:value-of select="$newline" />
452 <xsl:value-of select="$newline" />
454 <xsl:apply-templates />
457 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
459 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
460 <h4><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h4>
462 <xsl:value-of select="$newline" />
463 <xsl:value-of select="$newline" />
465 <xsl:apply-templates />
468 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
470 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
471 <h5><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h5>
473 <xsl:value-of select="$newline" />
474 <xsl:value-of select="$newline" />
476 <xsl:apply-templates />
479 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
481 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
482 <div class="numbered"><xsl:value-of select="$newline" />
483 <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" />
484 <xsl:value-of select="$newline" />
486 <xsl:apply-templates/>
488 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
491 <xsl:template match="/gamebook/section/data/section/data/section[@class='numbered']">
492 <h3><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" />
493 <xsl:value-of select="$newline" />
495 <xsl:apply-templates />
497 <xsl:value-of select="$newline" />
500 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
502 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
503 <div class="frontmatter"><xsl:value-of select="$newline" />
504 <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" />
506 <xsl:value-of select="$newline" />
507 <xsl:value-of select="$newline" />
509 <xsl:apply-templates />
511 <xsl:value-of select="$newline" />
513 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
516 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
518 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
519 <h3><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h3>
521 <xsl:value-of select="$newline" />
522 <xsl:value-of select="$newline" />
524 <xsl:apply-templates />
527 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
529 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
530 <h4><a><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute><xsl:apply-templates select="meta/title[1]" /></a></h4>
532 <xsl:value-of select="$newline" />
533 <xsl:value-of select="$newline" />
535 <xsl:apply-templates />
538 <!-- ::::::::::::::::::::: footnotes template ::::::::::::::::::::::::: -->
540 <xsl:template match="id( 'footnotz' )">
541 <div class="backmatter">
542 <xsl:value-of select="$newline" />
543 <!-- No particular reason to code title here -->
544 <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" />
545 <xsl:value-of select="$newline" />
546 <xsl:value-of select="$newline" />
548 <!-- Generate list of footnotes -->
549 <div class="footnote">
550 <xsl:for-each select="//footnotes/footnote">
551 <!-- will the list always contain the closest ancestor first? -->
552 <xsl:variable name="footnote-section"><xsl:value-of select="ancestor::section[position()=1]/@id" /></xsl:variable>
553 <xsl:variable name="footnote-marker"><xsl:number count="footnotes/footnote" from="/" level="any" format="1" /></xsl:variable>
554 <xsl:variable name="footnote-id"><xsl:value-of select="@id" /></xsl:variable>
555 <xsl:variable name="footnote-idref"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:variable>
557 <xsl:for-each select="*[1]">
559 <xsl:text>[</xsl:text>
561 <xsl:attribute name="name"><xsl:value-of select="$footnote-id" /></xsl:attribute>
562 <xsl:attribute name="href"><xsl:value-of select="$footnote-idref" /></xsl:attribute>
563 <xsl:value-of select="$footnote-marker" />
565 <xsl:text>] </xsl:text>
567 <xsl:text> (</xsl:text>
568 <xsl:call-template name="section-title-link" />
569 <xsl:text>) </xsl:text>
571 <xsl:apply-templates select="child::* | child::text()" />
575 <xsl:for-each select="*[position() != 1]">
576 <xsl:apply-templates select="." />
582 <!-- Backwards compatibility... needed? Probably not. -->
583 <xsl:apply-templates />
585 <xsl:value-of select="$newline" />
587 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
590 <!-- ==================== block elements ======================== -->
592 <xsl:template match="p">
593 <p><xsl:apply-templates /></p>
594 <xsl:value-of select="$newline" />
597 <xsl:template match="p[@class='dedication']">
598 <p class="dedication"><xsl:apply-templates /></p>
599 <xsl:value-of select="$newline" />
602 <xsl:template match="dl[@class='paragraphed']/dd/node() | ol[@class='paragraphed']/li/node() | ul[@class='paragraphed']/li/node()">
604 <xsl:when test="self::p">
605 <xsl:apply-templates /><br /><br /><xsl:value-of select="$newline" />
607 <xsl:when test="self::dl">
608 <dl><xsl:value-of select="$newline" />
609 <xsl:apply-templates />
610 </dl><br /><br /><xsl:value-of select="$newline" />
612 <xsl:when test="self::ol">
613 <ol><xsl:value-of select="$newline" />
614 <xsl:apply-templates />
615 </ol><br /><br /><xsl:value-of select="$newline" />
617 <xsl:when test="self::ul">
619 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
620 <xsl:value-of select="$newline" />
621 <xsl:apply-templates />
622 </ul><br /><br /><xsl:value-of select="$newline" />
624 <xsl:when test="self::blockquote">
625 <blockquote><xsl:value-of select="$newline" />
626 <xsl:apply-templates />
627 </blockquote><xsl:value-of select="$newline" />
629 <xsl:when test="self::poetry">
630 <blockquote class="poetry"><xsl:value-of select="$newline" />
631 <xsl:apply-templates />
632 </blockquote><xsl:value-of select="$newline" />
634 <xsl:when test="self::illustration"></xsl:when>
635 <xsl:when test="self::illref"></xsl:when>
637 <xsl:text>[error: paragraphed list template]</xsl:text>
638 <xsl:message><xsl:text>error: paragraphed list template</xsl:text></xsl:message>
643 <xsl:template match="ol">
644 <ol><xsl:value-of select="$newline" />
645 <xsl:apply-templates />
646 </ol><xsl:value-of select="$newline" />
649 <xsl:template match="ul">
651 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
652 <xsl:value-of select="$newline" />
653 <xsl:apply-templates />
654 </ul><xsl:value-of select="$newline" />
657 <xsl:template match="dl">
658 <dl><xsl:value-of select="$newline" />
659 <xsl:apply-templates />
660 </dl><xsl:value-of select="$newline" />
663 <xsl:template match="dt">
664 <dt><xsl:apply-templates /></dt>
665 <xsl:value-of select="$newline" />
668 <xsl:template match="dd">
669 <dd><xsl:apply-templates /></dd>
670 <xsl:value-of select="$newline" />
673 <xsl:template match="li">
674 <li><xsl:apply-templates /></li>
675 <xsl:value-of select="$newline" />
678 <xsl:template match="table">
679 <table border="1" cellspacing="0" cellpadding="2">
680 <xsl:if test="@summary"><xsl:attribute name="summary"><xsl:value-of select="@summary" /></xsl:attribute></xsl:if>
681 <xsl:apply-templates />
683 <xsl:value-of select="$newline" />
686 <xsl:template match="caption">
688 <xsl:apply-templates />
692 <xsl:template match="colgroup[@scope]">
694 <xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute>
698 <xsl:template match="thead">
700 <xsl:apply-templates />
704 <xsl:template match="tfoot">
706 <xsl:apply-templates />
710 <xsl:template match="tbody">
712 <xsl:apply-templates />
716 <xsl:template match="tr">
718 <xsl:apply-templates />
722 <xsl:template match="th">
724 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
725 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
726 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
727 <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of select="@rowspan" /></xsl:attribute></xsl:if>
728 <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if>
729 <xsl:if test="@axis"><xsl:attribute name="axis"><xsl:value-of select="@axis" /></xsl:attribute></xsl:if>
730 <xsl:if test="@scope"><xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute></xsl:if>
731 <xsl:apply-templates />
735 <xsl:template match="td">
737 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
738 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
739 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
740 <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of select="@rowspan" /></xsl:attribute></xsl:if>
741 <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if>
742 <xsl:if test="@axis"><xsl:attribute name="axis"><xsl:value-of select="@axis" /></xsl:attribute></xsl:if>
743 <xsl:if test="@scope"><xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute></xsl:if>
744 <xsl:apply-templates />
748 <xsl:template match="combat">
750 <xsl:apply-templates select="enemy" />
751 <xsl:text>: </xsl:text>
753 <xsl:when test="enemy-attribute[@class='combatskill']">
756 <xsl:when test="$language='es'">
757 <xsl:text>DESTREZA EN EL COMBATE</xsl:text>
760 <xsl:text>COMBAT SKILL</xsl:text>
764 <xsl:text> </xsl:text>
765 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
767 <xsl:when test="enemy-attribute[@class='closecombatskill']">
770 <xsl:when test="$language='es'">
771 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
774 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
778 <xsl:text> </xsl:text>
779 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
782 <xsl:text> </xsl:text>
785 <xsl:when test="$language='es'">
786 <xsl:text>RESISTENCIA</xsl:text>
789 <xsl:text>ENDURANCE</xsl:text>
794 <xsl:when test="enemy-attribute[@class='target']">
796 <xsl:when test="$language='es'">
797 <xsl:text> (o </xsl:text><small>BLANCOS</small><xsl:text>)</xsl:text>
800 <xsl:text> (</xsl:text><small>TARGET</small><xsl:text> points)</xsl:text>
803 <xsl:text> </xsl:text>
804 <xsl:value-of select="enemy-attribute[@class='target']" />
806 <xsl:when test="enemy-attribute[@class='resistance']">
808 <xsl:when test="$language='es'"></xsl:when>
810 <xsl:text> (</xsl:text><small>RESISTANCE</small><xsl:text> points)</xsl:text>
813 <xsl:text> </xsl:text>
814 <xsl:value-of select="enemy-attribute[@class='resistance']" />
817 <xsl:text> </xsl:text>
818 <xsl:value-of select="enemy-attribute[@class='endurance']" />
822 <xsl:value-of select="$newline" />
825 <xsl:template match="choice">
826 <xsl:variable name="link">
827 <xsl:value-of select="@idref" />
831 <xsl:for-each select="* | text()">
833 <xsl:when test="self::link-text">
835 <xsl:apply-templates />
839 <xsl:apply-templates select="." />
844 <xsl:value-of select="$newline" />
847 <xsl:template match="puzzle">
849 <xsl:apply-templates />
851 <xsl:value-of select="$newline" />
854 <xsl:template match="deadend">
856 <xsl:apply-templates />
858 <xsl:value-of select="$newline" />
861 <xsl:template match="data/signpost">
862 <div class="signpost">
863 <xsl:apply-templates />
865 <xsl:value-of select="$newline" />
868 <xsl:template match="signpost">
869 <span class="signpost"><xsl:apply-templates /></span>
872 <xsl:template match="blockquote">
873 <blockquote><xsl:value-of select="$newline" />
874 <xsl:apply-templates /><xsl:value-of select="$newline" />
875 </blockquote><xsl:value-of select="$newline" />
878 <xsl:template match="poetry">
879 <blockquote class="poetry"><p><xsl:value-of select="$newline" />
880 <xsl:apply-templates /><xsl:value-of select="$newline" />
881 </p></blockquote><xsl:value-of select="$newline" />
884 <xsl:template match="illref">
885 <!-- 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 -->
886 <xsl:if test="@class='html'">
887 <xsl:for-each select="id( @idref )">
888 <!-- 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... -->
889 <!-- When backwards compatibility can be dropped, most of (all?) the <illustration> processing can happen here -->
890 <xsl:apply-templates select="." />
895 <xsl:template match="illustrations">
896 <ul class="unbulleted">
897 <xsl:for-each select="illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) )] | illgroup">
899 <xsl:when test="self::illustration and @class='float'">
900 <!-- List item with illustration name as link -->
903 <xsl:attribute name="href"><xsl:text>ill</xsl:text><xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="1" /><xsl:text>.htm</xsl:text></xsl:attribute>
905 <xsl:when test="$language='es'">
906 <xsl:text>Ilustración </xsl:text>
909 <xsl:text>Illustration </xsl:text>
912 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
914 <!-- List the sections that the illustration appears in -->
915 <xsl:text> (</xsl:text>
916 <xsl:for-each select="//illref[@class='html' and @idref=current()/@id]">
917 <xsl:call-template name="section-title-link" />
918 <xsl:if test="position()!=last()">
919 <xsl:text>, </xsl:text>
922 <xsl:text>)</xsl:text><xsl:value-of select="$newline" />
924 <!-- Call the backwards compatible template for generating the illustration page -->
928 </ul><xsl:value-of select="$newline" />
931 <xsl:template match="illustration">
933 <xsl:when test="instance[@class='text'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
934 <xsl:apply-templates select="instance[@class='text']/*"/>
936 <xsl:when test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
938 <xsl:when test="@class='float'">
939 <div class="illustration">
940 <xsl:text>[Illustration </xsl:text>
941 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
942 <xsl:text>]</xsl:text>
943 </div><xsl:value-of select="$newline" />
945 <xsl:otherwise></xsl:otherwise>
948 <xsl:otherwise></xsl:otherwise>
952 <xsl:template match="instance" />
954 <xsl:template match="footnotes" />
956 <xsl:template match="footnote" />
958 <xsl:template match="hr">
960 <xsl:value-of select="$newline" />
963 <xsl:template match="choose">
965 <xsl:when test="@test='has-numbered-section-list'">
967 <xsl:when test="when[@value='false']">
968 <xsl:apply-templates select="when[@value='false'][1]/node()" />
970 <xsl:when test="otherwise">
971 <!-- this should only be applied when there is no option for "false" -->
972 <xsl:apply-templates select="otherwise/node()" />
978 <xsl:text>choose: unrecognized test "</xsl:text>
979 <xsl:value-of select="@test" />
980 <xsl:text>" - element ignored.</xsl:text>
986 <!-- ==================== inline elements ======================= -->
988 <xsl:template match="a">
990 <xsl:when test="@href">
992 <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
993 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
994 <xsl:apply-templates />
999 <xsl:if test="@idref">
1000 <xsl:attribute name="href">
1001 <xsl:text>#</xsl:text><xsl:value-of select="@idref" />
1004 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
1005 <xsl:apply-templates />
1011 <!-- This template is obsolete, the "footref" element should be used instead -->
1012 <xsl:template match="a[@class='footnote']">
1013 <!-- <xsl:message><xsl:text>WARNING: Obsolete <a idref='...' class='footnote' /> usage</xsl:text></xsl:message> -->
1014 <xsl:apply-templates />
1017 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
1018 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
1019 <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
1024 <!-- TODO: can this be made more uniform with illrefs? -->
1025 <xsl:template match="a[@class='accent-illustration']"></xsl:template>
1027 <xsl:template match="bookref">
1029 <xsl:attribute name="href">
1030 <xsl:variable name="my-section">
1032 <xsl:when test="@section">
1033 <xsl:value-of select="@section" />
1036 <xsl:text>title</xsl:text>
1040 <xsl:variable name="my-series">
1041 <!-- If series is specified, go one directory back and then to series. Otherwise, add nothing. -->
1043 <xsl:when test="@series">
1044 <xsl:text>../</xsl:text><xsl:value-of select="@series" />
1047 <xsl:text></xsl:text>
1051 <xsl:value-of select="$my-series" /><xsl:text>/</xsl:text><xsl:value-of select="@book" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-section" />
1053 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
1054 <xsl:apply-templates />
1058 <xsl:template match="footref">
1059 <xsl:apply-templates />
1062 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
1063 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
1064 <xsl:number count="footref" from="/" level="any" format="1" />
1069 <xsl:template match="em">
1070 <em><xsl:apply-templates /></em>
1073 <xsl:template match="strong">
1074 <strong><xsl:apply-templates /></strong>
1077 <xsl:template match="thought">
1078 <i><xsl:apply-templates /></i>
1081 <xsl:template match="onomatopoeia">
1082 <i><xsl:apply-templates /></i>
1085 <xsl:template match="spell">
1086 <i><xsl:apply-templates /></i>
1089 <xsl:template match="item">
1090 <strong><xsl:apply-templates /></strong>
1093 <xsl:template match="foreign">
1095 <xsl:attribute name="xml:lang">
1096 <xsl:value-of select="@xml:lang"/>
1098 <xsl:apply-templates />
1102 <xsl:template match="quote">
1103 <xsl:text>‘</xsl:text>
1104 <xsl:apply-templates />
1105 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>’</xsl:text></xsl:if>
1108 <xsl:template match="quote//quote">
1109 <xsl:text>“</xsl:text>
1110 <xsl:apply-templates />
1111 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>”</xsl:text></xsl:if>
1114 <xsl:template match="cite">
1115 <cite><xsl:apply-templates /></cite>
1118 <xsl:template match="code">
1119 <tt><xsl:apply-templates /></tt>
1122 <xsl:template match="line">
1123 <xsl:apply-templates />
1124 <xsl:if test="position( ) != last( )"><br /></xsl:if>
1127 <xsl:template match="br">
1131 <xsl:template match="typ[@class='attribute']">
1132 <small><xsl:apply-templates /></small>
1135 <!-- ==================== character elements ==================== -->
1138 These templates define the mapping between the character elements used in
1139 the Project Aon instances of Gamebook XML and the ISO-8859-1
1142 Portions Copyright International Organization for Standardization 1986
1143 Permission to copy in any form is granted for use with conforming SGML
1144 systems and applications as defined in ISO 8879, provided this notice
1145 is included in all copies.
1149 <xsl:template match="ch.apos"><xsl:text>’</xsl:text></xsl:template><!-- apostrophe = single quotation mark -->
1150 <xsl:template match="ch.nbsp"><xsl:text> </xsl:text></xsl:template><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
1151 <xsl:template match="ch.iexcl"><xsl:text>¡</xsl:text></xsl:template><!-- inverted exclamation mark, U+00A1 ISOnum -->
1152 <xsl:template match="ch.cent"><xsl:text>¢</xsl:text></xsl:template><!-- cent sign, U+00A2 ISOnum -->
1153 <xsl:template match="ch.pound"><xsl:text>£</xsl:text></xsl:template><!-- pound sign, U+00A3 ISOnum -->
1154 <xsl:template match="ch.curren"><xsl:text>¤</xsl:text></xsl:template><!-- currency sign, U+00A4 ISOnum -->
1155 <xsl:template match="ch.yen"><xsl:text>¥</xsl:text></xsl:template><!-- yen sign = yuan sign, U+00A5 ISOnum -->
1156 <xsl:template match="ch.brvbar"><xsl:text>¦</xsl:text></xsl:template><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
1157 <xsl:template match="ch.sect"><xsl:text>§</xsl:text></xsl:template><!-- section sign, U+00A7 ISOnum -->
1158 <xsl:template match="ch.uml"><xsl:text>¨</xsl:text></xsl:template><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
1159 <xsl:template match="ch.copy"><xsl:text>©</xsl:text></xsl:template><!-- copyright sign, U+00A9 ISOnum -->
1160 <xsl:template match="ch.ordf"><xsl:text>ª</xsl:text></xsl:template><!-- feminine ordinal indicator, U+00AA ISOnum -->
1161 <xsl:template match="ch.laquo"><xsl:text>«</xsl:text></xsl:template><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
1162 <xsl:template match="ch.not"><xsl:text>¬</xsl:text></xsl:template><!-- not sign, U+00AC ISOnum -->
1163 <xsl:template match="ch.shy"><xsl:text>­</xsl:text></xsl:template><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
1164 <xsl:template match="ch.reg"><xsl:text>®</xsl:text></xsl:template><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
1165 <xsl:template match="ch.macr"><xsl:text>¯</xsl:text></xsl:template><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
1166 <xsl:template match="ch.deg"><xsl:text>°</xsl:text></xsl:template><!-- degree sign, U+00B0 ISOnum -->
1167 <xsl:template match="ch.plusmn"><xsl:text>±</xsl:text></xsl:template><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
1168 <xsl:template match="ch.sup2"><xsl:text>²</xsl:text></xsl:template><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
1169 <xsl:template match="ch.sup3"><xsl:text>³</xsl:text></xsl:template><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
1170 <xsl:template match="ch.acute"><xsl:text>´</xsl:text></xsl:template><!-- acute accent = spacing acute, U+00B4 ISOdia -->
1171 <xsl:template match="ch.micro"><xsl:text>µ</xsl:text></xsl:template><!-- micro sign, U+00B5 ISOnum -->
1172 <xsl:template match="ch.para"><xsl:text>¶</xsl:text></xsl:template><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
1173 <xsl:template match="ch.middot"><xsl:text>·</xsl:text></xsl:template><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
1174 <xsl:template match="ch.cedil"><xsl:text>¸</xsl:text></xsl:template><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
1175 <xsl:template match="ch.sup1"><xsl:text>¹</xsl:text></xsl:template><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
1176 <xsl:template match="ch.ordm"><xsl:text>º</xsl:text></xsl:template><!-- masculine ordinal indicator, U+00BA ISOnum -->
1177 <xsl:template match="ch.raquo"><xsl:text>»</xsl:text></xsl:template><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
1178 <xsl:template match="ch.frac14"><xsl:text>¼</xsl:text></xsl:template><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
1179 <xsl:template match="ch.frac12"><xsl:text>½</xsl:text></xsl:template><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
1180 <xsl:template match="ch.frac34"><xsl:text>¾</xsl:text></xsl:template><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
1181 <xsl:template match="ch.frac13"><xsl:text>⅓</xsl:text></xsl:template><!-- vulgar fraction 1/3, U+2153 ISOnum -->
1182 <xsl:template match="ch.frac23"><xsl:text>⅔</xsl:text></xsl:template><!-- vulgar fraction 2/3, U+2154 ISOnum -->
1183 <xsl:template match="ch.frac15"><xsl:text>⅕</xsl:text></xsl:template><!-- vulgar fraction 1/5, U+2155 ISOnum -->
1184 <xsl:template match="ch.frac25"><xsl:text>⅖</xsl:text></xsl:template><!-- vulgar fraction 2/5, U+2156 ISOnum -->
1185 <xsl:template match="ch.frac35"><xsl:text>⅗</xsl:text></xsl:template><!-- vulgar fraction 3/5, U+2157 ISOnum -->
1186 <xsl:template match="ch.frac45"><xsl:text>⅘</xsl:text></xsl:template><!-- vulgar fraction 4/5, U+2158 ISOnum -->
1187 <xsl:template match="ch.frac16"><xsl:text>⅙</xsl:text></xsl:template><!-- vulgar fraction 1/6, U+2159 ISOnum -->
1188 <xsl:template match="ch.frac56"><xsl:text>⅚</xsl:text></xsl:template><!-- vulgar fraction 5/6, U+215A ISOnum -->
1189 <xsl:template match="ch.frac17"><xsl:text>⅐</xsl:text></xsl:template><!-- vulgar fraction 1/7, U+2150 ISOnum -->
1190 <xsl:template match="ch.frac18"><xsl:text>⅛</xsl:text></xsl:template><!-- vulgar fraction 1/8, U+215B ISOnum -->
1191 <xsl:template match="ch.frac38"><xsl:text>⅜</xsl:text></xsl:template><!-- vulgar fraction 3/8, U+215C ISOnum -->
1192 <xsl:template match="ch.frac58"><xsl:text>⅝</xsl:text></xsl:template><!-- vulgar fraction 5/8, U+215D ISOnum -->
1193 <xsl:template match="ch.frac78"><xsl:text>⅞</xsl:text></xsl:template><!-- vulgar fraction 7/8, U+215E ISOnum -->
1194 <xsl:template match="ch.frac19"><xsl:text>⅑</xsl:text></xsl:template><!-- vulgar fraction 1/9, U+2151 ISOnum -->
1195 <xsl:template match="ch.frac110"><xsl:text>⅒</xsl:text></xsl:template><!-- vulgar fraction 1/10, U+2152 ISO num -->
1196 <xsl:template match="ch.iquest"><xsl:text>¿</xsl:text></xsl:template><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
1197 <xsl:template match="ch.Agrave"><xsl:text>À</xsl:text></xsl:template><!-- latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1 -->
1198 <xsl:template match="ch.Aacute"><xsl:text>Á</xsl:text></xsl:template><!-- latin capital letter A with acute, U+00C1 ISOlat1 -->
1199 <xsl:template match="ch.Acirc"><xsl:text>Â</xsl:text></xsl:template><!-- latin capital letter A with circumflex, U+00C2 ISOlat1 -->
1200 <xsl:template match="ch.Atilde"><xsl:text>Ã</xsl:text></xsl:template><!-- latin capital letter A with tilde, U+00C3 ISOlat1 -->
1201 <xsl:template match="ch.Auml"><xsl:text>Ä</xsl:text></xsl:template><!-- latin capital letter A with diaeresis, U+00C4 ISOlat1 -->
1202 <xsl:template match="ch.Aring"><xsl:text>Å</xsl:text></xsl:template><!-- latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1 -->
1203 <xsl:template match="ch.AElig"><xsl:text>Æ</xsl:text></xsl:template><!-- latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 -->
1204 <xsl:template match="ch.Ccedil"><xsl:text>Ç</xsl:text></xsl:template><!-- latin capital letter C with cedilla, U+00C7 ISOlat1 -->
1205 <xsl:template match="ch.Egrave"><xsl:text>È</xsl:text></xsl:template><!-- latin capital letter E with grave, U+00C8 ISOlat1 -->
1206 <xsl:template match="ch.Eacute"><xsl:text>É</xsl:text></xsl:template><!-- latin capital letter E with acute, U+00C9 ISOlat1 -->
1207 <xsl:template match="ch.Ecirc"><xsl:text>Ê</xsl:text></xsl:template><!-- latin capital letter E with circumflex, U+00CA ISOlat1 -->
1208 <xsl:template match="ch.Euml"><xsl:text>Ë</xsl:text></xsl:template><!-- latin capital letter E with diaeresis, U+00CB ISOlat1 -->
1209 <xsl:template match="ch.Igrave"><xsl:text>Ì</xsl:text></xsl:template><!-- latin capital letter I with grave, U+00CC ISOlat1 -->
1210 <xsl:template match="ch.Iacute"><xsl:text>Í</xsl:text></xsl:template><!-- latin capital letter I with acute, U+00CD ISOlat1 -->
1211 <xsl:template match="ch.Icirc"><xsl:text>Î</xsl:text></xsl:template><!-- latin capital letter I with circumflex, U+00CE ISOlat1 -->
1212 <xsl:template match="ch.Iuml"><xsl:text>Ï</xsl:text></xsl:template><!-- latin capital letter I with diaeresis, U+00CF ISOlat1 -->
1213 <xsl:template match="ch.ETH"><xsl:text>Ð</xsl:text></xsl:template><!-- latin capital letter ETH, U+00D0 ISOlat1 -->
1214 <xsl:template match="ch.Ntilde"><xsl:text>Ñ</xsl:text></xsl:template><!-- latin capital letter N with tilde, U+00D1 ISOlat1 -->
1215 <xsl:template match="ch.Ograve"><xsl:text>Ò</xsl:text></xsl:template><!-- latin capital letter O with grave, U+00D2 ISOlat1 -->
1216 <xsl:template match="ch.Oacute"><xsl:text>Ó</xsl:text></xsl:template><!-- latin capital letter O with acute, U+00D3 ISOlat1 -->
1217 <xsl:template match="ch.Ocirc"><xsl:text>Ô</xsl:text></xsl:template><!-- latin capital letter O with circumflex, U+00D4 ISOlat1 -->
1218 <xsl:template match="ch.Otilde"><xsl:text>Õ</xsl:text></xsl:template><!-- latin capital letter O with tilde, U+00D5 ISOlat1 -->
1219 <xsl:template match="ch.Ouml"><xsl:text>Ö</xsl:text></xsl:template><!-- latin capital letter O with diaeresis, U+00D6 ISOlat1 -->
1220 <xsl:template match="ch.times"><xsl:text>×</xsl:text></xsl:template><!-- multiplication sign, U+00D7 ISOnum -->
1221 <xsl:template match="ch.Oslash"><xsl:text>Ø</xsl:text></xsl:template><!-- latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1 -->
1222 <xsl:template match="ch.Ugrave"><xsl:text>Ù</xsl:text></xsl:template><!-- latin capital letter U with grave, U+00D9 ISOlat1 -->
1223 <xsl:template match="ch.Uacute"><xsl:text>Ú</xsl:text></xsl:template><!-- latin capital letter U with acute, U+00DA ISOlat1 -->
1224 <xsl:template match="ch.Ucirc"><xsl:text>Û</xsl:text></xsl:template><!-- latin capital letter U with circumflex, U+00DB ISOlat1 -->
1225 <xsl:template match="ch.Uuml"><xsl:text>Ü</xsl:text></xsl:template><!-- latin capital letter U with diaeresis, U+00DC ISOlat1 -->
1226 <xsl:template match="ch.Yacute"><xsl:text>Ý</xsl:text></xsl:template><!-- latin capital letter Y with acute, U+00DD ISOlat1 -->
1227 <xsl:template match="ch.THORN"><xsl:text>Þ</xsl:text></xsl:template><!-- latin capital letter THORN, U+00DE ISOlat1 -->
1228 <xsl:template match="ch.szlig"><xsl:text>ß</xsl:text></xsl:template><!-- latin small letter sharp s = ess-zed, U+00DF ISOlat1 -->
1229 <xsl:template match="ch.agrave"><xsl:text>à</xsl:text></xsl:template><!-- latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1 -->
1230 <xsl:template match="ch.aacute"><xsl:text>á</xsl:text></xsl:template><!-- latin small letter a with acute, U+00E1 ISOlat1 -->
1231 <xsl:template match="ch.acirc"><xsl:text>â</xsl:text></xsl:template><!-- latin small letter a with circumflex, U+00E2 ISOlat1 -->
1232 <xsl:template match="ch.atilde"><xsl:text>ã</xsl:text></xsl:template><!-- latin small letter a with tilde, U+00E3 ISOlat1 -->
1233 <xsl:template match="ch.auml"><xsl:text>ä</xsl:text></xsl:template><!-- latin small letter a with diaeresis, U+00E4 ISOlat1 -->
1234 <xsl:template match="ch.aring"><xsl:text>å</xsl:text></xsl:template><!-- latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1 -->
1235 <xsl:template match="ch.aelig"><xsl:text>æ</xsl:text></xsl:template><!-- latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 -->
1236 <xsl:template match="ch.ccedil"><xsl:text>ç</xsl:text></xsl:template><!-- latin small letter c with cedilla, U+00E7 ISOlat1 -->
1237 <xsl:template match="ch.egrave"><xsl:text>è</xsl:text></xsl:template><!-- latin small letter e with grave, U+00E8 ISOlat1 -->
1238 <xsl:template match="ch.eacute"><xsl:text>é</xsl:text></xsl:template><!-- latin small letter e with acute, U+00E9 ISOlat1 -->
1239 <xsl:template match="ch.ecirc"><xsl:text>ê</xsl:text></xsl:template><!-- latin small letter e with circumflex, U+00EA ISOlat1 -->
1240 <xsl:template match="ch.euml"><xsl:text>ë</xsl:text></xsl:template><!-- latin small letter e with diaeresis, U+00EB ISOlat1 -->
1241 <xsl:template match="ch.igrave"><xsl:text>ì</xsl:text></xsl:template><!-- latin small letter i with grave, U+00EC ISOlat1 -->
1242 <xsl:template match="ch.iacute"><xsl:text>í</xsl:text></xsl:template><!-- latin small letter i with acute, U+00ED ISOlat1 -->
1243 <xsl:template match="ch.icirc"><xsl:text>î</xsl:text></xsl:template><!-- latin small letter i with circumflex, U+00EE ISOlat1 -->
1244 <xsl:template match="ch.iuml"><xsl:text>ï</xsl:text></xsl:template><!-- latin small letter i with diaeresis, U+00EF ISOlat1 -->
1245 <xsl:template match="ch.eth"><xsl:text>ð</xsl:text></xsl:template><!-- latin small letter eth, U+00F0 ISOlat1 -->
1246 <xsl:template match="ch.ntilde"><xsl:text>ñ</xsl:text></xsl:template><!-- latin small letter n with tilde, U+00F1 ISOlat1 -->
1247 <xsl:template match="ch.ograve"><xsl:text>ò</xsl:text></xsl:template><!-- latin small letter o with grave, U+00F2 ISOlat1 -->
1248 <xsl:template match="ch.oacute"><xsl:text>ó</xsl:text></xsl:template><!-- latin small letter o with acute, U+00F3 ISOlat1 -->
1249 <xsl:template match="ch.ocirc"><xsl:text>ô</xsl:text></xsl:template><!-- latin small letter o with circumflex, U+00F4 ISOlat1 -->
1250 <xsl:template match="ch.otilde"><xsl:text>õ</xsl:text></xsl:template><!-- latin small letter o with tilde, U+00F5 ISOlat1 -->
1251 <xsl:template match="ch.ouml"><xsl:text>ö</xsl:text></xsl:template><!-- latin small letter o with diaeresis, U+00F6 ISOlat1 -->
1252 <xsl:template match="ch.divide"><xsl:text>÷</xsl:text></xsl:template><!-- division sign, U+00F7 ISOnum -->
1253 <xsl:template match="ch.oslash"><xsl:text>ø</xsl:text></xsl:template><!-- latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1 -->
1254 <xsl:template match="ch.ugrave"><xsl:text>ù</xsl:text></xsl:template><!-- latin small letter u with grave, U+00F9 ISOlat1 -->
1255 <xsl:template match="ch.uacute"><xsl:text>ú</xsl:text></xsl:template><!-- latin small letter u with acute, U+00FA ISOlat1 -->
1256 <xsl:template match="ch.ucirc"><xsl:text>û</xsl:text></xsl:template><!-- latin small letter u with circumflex, U+00FB ISOlat1 -->
1257 <xsl:template match="ch.uuml"><xsl:text>ü</xsl:text></xsl:template><!-- latin small letter u with diaeresis, U+00FC ISOlat1 -->
1258 <xsl:template match="ch.yacute"><xsl:text>ý</xsl:text></xsl:template><!-- latin small letter y with acute, U+00FD ISOlat1 -->
1259 <xsl:template match="ch.thorn"><xsl:text>þ</xsl:text></xsl:template><!-- latin small letter thorn, U+00FE ISOlat1 -->
1260 <xsl:template match="ch.yuml"><xsl:text>ÿ</xsl:text></xsl:template><!-- latin small letter y with diaeresis, U+00FF ISOlat1 -->
1262 <!-- ~~~~~~~~~~~~~~~~~~~~~ Special Characters ~~~~~~~~~~~~~~~~~~~~ -->
1264 <xsl:template match="ch.ampersand">&</xsl:template><!-- ampersand -->
1265 <xsl:template match="ch.lsquot">‘</xsl:template><!-- opening left quotation mark -->
1266 <xsl:template match="ch.rsquot">’</xsl:template><!-- closing right quotation mark -->
1267 <xsl:template match="ch.ldquot">“</xsl:template><!-- opening left double quotation mark -->
1268 <xsl:template match="ch.rdquot">”</xsl:template><!-- closing right double quotation mark -->
1269 <xsl:template match="ch.minus">−</xsl:template><!-- mathematical minus -->
1270 <xsl:template match="ch.endash">–</xsl:template><!-- endash -->
1271 <xsl:template match="ch.emdash">—</xsl:template><!-- emdash -->
1272 <xsl:template match="ch.ellips">…</xsl:template><!-- ellipsis -->
1273 <xsl:template match="ch.lellips">…</xsl:template><!-- left ellipsis, used at the beginning of edited material -->
1274 <xsl:template match="ch.blankline">_______</xsl:template><!-- blank line to be filled in -->
1275 <xsl:template match="ch.percent"><xsl:text>%</xsl:text></xsl:template><!-- percent sign -->
1276 <xsl:template match="ch.thinspace"><xsl:text> </xsl:text></xsl:template><!-- small horizontal space for use between adjacent quotation marks - added mainly for LaTeX's sake -->
1277 <xsl:template match="ch.frac116"><xsl:text>1/16</xsl:text></xsl:template><!-- vulgar fraction one sixteenth = fraction on sixteenth -->
1278 <xsl:template match="ch.plus"><xsl:text>+</xsl:text></xsl:template><!-- mathematical plus -->
1280 <!-- ==================== named templates ======================= -->
1283 A "subroutine" to generate a link to the current section, with the section title (expanded with "Section " in case of a numbered section) as link text.
1285 <xsl:template name="section-title-link">
1286 <!-- will the list always contain the closest ancestor first? -->
1287 <xsl:variable name="section-title">
1288 <!-- numbered or not? -->
1289 <xsl:if test="ancestor::section[position()=1]/@class='numbered'">
1291 <xsl:when test="$language='es'">
1292 <xsl:text>Sección </xsl:text>
1295 <xsl:text>Section </xsl:text>
1299 <xsl:apply-templates select="ancestor::section[position()=1]/meta/title[1]" />
1303 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="ancestor::section[position()=1]/@id" /></xsl:attribute>
1304 <xsl:value-of select="$section-title" />