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" />
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::illustration"></xsl:when>
630 <xsl:when test="self::illref"></xsl:when>
632 <xsl:text>[error: paragraphed list template]</xsl:text>
633 <xsl:message><xsl:text>error: paragraphed list template</xsl:text></xsl:message>
638 <xsl:template match="ol">
639 <ol><xsl:value-of select="$newline" />
640 <xsl:apply-templates />
641 </ol><xsl:value-of select="$newline" />
644 <xsl:template match="ul">
646 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
647 <xsl:value-of select="$newline" />
648 <xsl:apply-templates />
649 </ul><xsl:value-of select="$newline" />
652 <xsl:template match="dl">
653 <dl><xsl:value-of select="$newline" />
654 <xsl:apply-templates />
655 </dl><xsl:value-of select="$newline" />
658 <xsl:template match="dt">
659 <dt><xsl:apply-templates /></dt>
660 <xsl:value-of select="$newline" />
663 <xsl:template match="dd">
664 <dd><xsl:apply-templates /></dd>
665 <xsl:value-of select="$newline" />
668 <xsl:template match="li">
669 <li><xsl:apply-templates /></li>
670 <xsl:value-of select="$newline" />
673 <xsl:template match="table">
674 <table border="1" cellspacing="0" cellpadding="2">
675 <xsl:if test="@summary"><xsl:attribute name="summary"><xsl:value-of select="@summary" /></xsl:attribute></xsl:if>
676 <xsl:apply-templates />
678 <xsl:value-of select="$newline" />
681 <xsl:template match="caption">
683 <xsl:apply-templates />
687 <xsl:template match="colgroup[@scope]">
689 <xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute>
693 <xsl:template match="thead">
695 <xsl:apply-templates />
699 <xsl:template match="tfoot">
701 <xsl:apply-templates />
705 <xsl:template match="tbody">
707 <xsl:apply-templates />
711 <xsl:template match="tr">
713 <xsl:apply-templates />
717 <xsl:template match="th">
719 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
720 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
721 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
722 <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of select="@rowspan" /></xsl:attribute></xsl:if>
723 <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if>
724 <xsl:if test="@axis"><xsl:attribute name="axis"><xsl:value-of select="@axis" /></xsl:attribute></xsl:if>
725 <xsl:if test="@scope"><xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute></xsl:if>
726 <xsl:apply-templates />
730 <xsl:template match="td">
732 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
733 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
734 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
735 <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of select="@rowspan" /></xsl:attribute></xsl:if>
736 <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if>
737 <xsl:if test="@axis"><xsl:attribute name="axis"><xsl:value-of select="@axis" /></xsl:attribute></xsl:if>
738 <xsl:if test="@scope"><xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute></xsl:if>
739 <xsl:apply-templates />
743 <xsl:template match="combat">
745 <xsl:apply-templates select="enemy" />
746 <xsl:text>: </xsl:text>
748 <xsl:when test="enemy-attribute[@class='combatskill']">
751 <xsl:when test="$language='es'">
752 <xsl:text>DESTREZA EN EL COMBATE</xsl:text>
755 <xsl:text>COMBAT SKILL</xsl:text>
759 <xsl:text> </xsl:text>
760 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
762 <xsl:when test="enemy-attribute[@class='closecombatskill']">
765 <xsl:when test="$language='es'">
766 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
769 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
773 <xsl:text> </xsl:text>
774 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
777 <xsl:text> </xsl:text>
780 <xsl:when test="$language='es'">
781 <xsl:text>RESISTENCIA</xsl:text>
784 <xsl:text>ENDURANCE</xsl:text>
789 <xsl:when test="enemy-attribute[@class='target']">
791 <xsl:when test="$language='es'">
792 <xsl:text> (o </xsl:text><small>BLANCOS</small><xsl:text>)</xsl:text>
795 <xsl:text> (</xsl:text><small>TARGET</small><xsl:text> points)</xsl:text>
798 <xsl:text> </xsl:text>
799 <xsl:value-of select="enemy-attribute[@class='target']" />
801 <xsl:when test="enemy-attribute[@class='resistance']">
803 <xsl:when test="$language='es'"></xsl:when>
805 <xsl:text> (</xsl:text><small>RESISTANCE</small><xsl:text> points)</xsl:text>
808 <xsl:text> </xsl:text>
809 <xsl:value-of select="enemy-attribute[@class='resistance']" />
812 <xsl:text> </xsl:text>
813 <xsl:value-of select="enemy-attribute[@class='endurance']" />
817 <xsl:value-of select="$newline" />
820 <xsl:template match="choice">
821 <xsl:variable name="link">
822 <xsl:value-of select="@idref" />
826 <xsl:for-each select="* | text()">
828 <xsl:when test="self::link-text">
830 <xsl:apply-templates />
834 <xsl:apply-templates select="." />
839 <xsl:value-of select="$newline" />
842 <xsl:template match="signpost">
843 <div class="signpost">
844 <xsl:apply-templates />
846 <xsl:value-of select="$newline" />
849 <xsl:template match="blockquote">
850 <blockquote><xsl:value-of select="$newline" />
851 <xsl:apply-templates /><xsl:value-of select="$newline" />
852 </blockquote><xsl:value-of select="$newline" />
855 <xsl:template match="illref">
856 <!-- 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 -->
857 <xsl:if test="@class='html'">
858 <xsl:for-each select="id( @idref )">
859 <!-- 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... -->
860 <!-- When backwards compatibility can be dropped, most of (all?) the <illustration> processing can happen here -->
861 <xsl:apply-templates select="." />
866 <xsl:template match="illustrations">
867 <ul class="unbulleted">
868 <xsl:for-each select="illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) )] | illgroup">
870 <xsl:when test="self::illustration and @class='float'">
871 <!-- List item with illustration name as link -->
874 <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>
876 <xsl:when test="$language='es'">
877 <xsl:text>Ilustración </xsl:text>
880 <xsl:text>Illustration </xsl:text>
883 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
885 <!-- List the sections that the illustration appears in -->
886 <xsl:text> (</xsl:text>
887 <xsl:for-each select="//illref[@class='html' and @idref=current()/@id]">
888 <xsl:call-template name="section-title-link" />
889 <xsl:if test="position()!=last()">
890 <xsl:text>, </xsl:text>
893 <xsl:text>)</xsl:text><xsl:value-of select="$newline" />
895 <!-- Call the backwards compatible template for generating the illustration page -->
899 </ul><xsl:value-of select="$newline" />
902 <xsl:template match="illustration">
904 <xsl:when test="instance[@class='text'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
905 <xsl:apply-templates select="instance[@class='text']/*"/>
907 <xsl:when test="instance[@class='html'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
909 <xsl:when test="@class='float'">
910 <div class="illustration">
911 <xsl:text>[[Illustration </xsl:text>
912 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
913 <xsl:text>]]</xsl:text>
914 </div><xsl:value-of select="$newline" />
916 <xsl:otherwise></xsl:otherwise>
919 <xsl:otherwise></xsl:otherwise>
923 <xsl:template match="instance" />
925 <xsl:template match="footnotes" />
927 <xsl:template match="footnote" />
929 <xsl:template match="hr">
931 <xsl:value-of select="$newline" />
934 <!-- ==================== inline elements ======================= -->
936 <xsl:template match="a">
938 <xsl:when test="@href">
940 <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
941 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
942 <xsl:apply-templates />
947 <xsl:if test="@idref">
948 <xsl:attribute name="href">
949 <xsl:text>#</xsl:text><xsl:value-of select="@idref" />
952 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
953 <xsl:apply-templates />
959 <!-- This template is obsolete, the "footref" element should be used instead -->
960 <xsl:template match="a[@class='footnote']">
961 <!-- <xsl:message><xsl:text>WARNING: Obsolete <a idref='...' class='footnote' /> usage</xsl:text></xsl:message> -->
962 <xsl:apply-templates />
965 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
966 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
967 <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
972 <!-- TODO: can this be made more uniform with illrefs? -->
973 <xsl:template match="a[@class='accent-illustration']"></xsl:template>
975 <xsl:template match="bookref">
977 <xsl:attribute name="href">
978 <xsl:variable name="my-section">
980 <xsl:when test="@section">
981 <xsl:value-of select="@section" />
984 <xsl:text>title</xsl:text>
988 <xsl:variable name="my-series">
989 <!-- If series is specified, go one directory back and then to series. Otherwise, add nothing. -->
991 <xsl:when test="@series">
992 <xsl:text>/../</xsl:text><xsl:value-of select="@series" />
995 <xsl:text></xsl:text>
999 <xsl:text>..</xsl:text><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" />
1001 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
1002 <xsl:apply-templates />
1006 <xsl:template match="footref">
1007 <xsl:apply-templates />
1010 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
1011 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
1012 <xsl:number count="footref" from="/" level="any" format="1" />
1017 <xsl:template match="em">
1018 <em><xsl:apply-templates /></em>
1021 <xsl:template match="strong">
1022 <strong><xsl:apply-templates /></strong>
1025 <xsl:template match="thought">
1026 <i><xsl:apply-templates /></i>
1029 <xsl:template match="onomatopoeia">
1030 <i><xsl:apply-templates /></i>
1033 <xsl:template match="spell">
1034 <i><xsl:apply-templates /></i>
1037 <xsl:template match="item">
1038 <xsl:apply-templates />
1041 <xsl:template match="foreign">
1042 <i><xsl:apply-templates /></i>
1045 <xsl:template match="quote">
1046 <xsl:text>‘</xsl:text>
1047 <xsl:apply-templates />
1048 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>’</xsl:text></xsl:if>
1051 <xsl:template match="quote//quote">
1052 <xsl:text>“</xsl:text>
1053 <xsl:apply-templates />
1054 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>”</xsl:text></xsl:if>
1057 <xsl:template match="cite">
1058 <cite><xsl:apply-templates /></cite>
1061 <xsl:template match="code">
1062 <tt><xsl:apply-templates /></tt>
1065 <xsl:template match="line">
1066 <xsl:apply-templates />
1067 <xsl:if test="position( ) != last( )"><br /></xsl:if>
1070 <xsl:template match="br">
1074 <xsl:template match="typ[@class='attribute']">
1075 <small><xsl:apply-templates /></small>
1078 <!-- ==================== character elements ==================== -->
1081 These templates define the mapping between the character elements used in
1082 the Project Aon instances of Gamebook XML and the ISO-8859-1
1085 Portions Copyright International Organization for Standardization 1986
1086 Permission to copy in any form is granted for use with conforming SGML
1087 systems and applications as defined in ISO 8879, provided this notice
1088 is included in all copies.
1092 <xsl:template match="ch.apos"><xsl:text>'</xsl:text></xsl:template><!-- apostrophe = single quotation mark -->
1093 <xsl:template match="ch.nbsp"><xsl:text> </xsl:text></xsl:template><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
1094 <xsl:template match="ch.iexcl"><xsl:text>¡</xsl:text></xsl:template><!-- inverted exclamation mark, U+00A1 ISOnum -->
1095 <xsl:template match="ch.cent"><xsl:text>¢</xsl:text></xsl:template><!-- cent sign, U+00A2 ISOnum -->
1096 <xsl:template match="ch.pound"><xsl:text>£</xsl:text></xsl:template><!-- pound sign, U+00A3 ISOnum -->
1097 <xsl:template match="ch.curren"><xsl:text>¤</xsl:text></xsl:template><!-- currency sign, U+00A4 ISOnum -->
1098 <xsl:template match="ch.yen"><xsl:text>¥</xsl:text></xsl:template><!-- yen sign = yuan sign, U+00A5 ISOnum -->
1099 <xsl:template match="ch.brvbar"><xsl:text>¦</xsl:text></xsl:template><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
1100 <xsl:template match="ch.sect"><xsl:text>§</xsl:text></xsl:template><!-- section sign, U+00A7 ISOnum -->
1101 <xsl:template match="ch.uml"><xsl:text>¨</xsl:text></xsl:template><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
1102 <xsl:template match="ch.copy"><xsl:text>©</xsl:text></xsl:template><!-- copyright sign, U+00A9 ISOnum -->
1103 <xsl:template match="ch.ordf"><xsl:text>ª</xsl:text></xsl:template><!-- feminine ordinal indicator, U+00AA ISOnum -->
1104 <xsl:template match="ch.laquo"><xsl:text>«</xsl:text></xsl:template><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
1105 <xsl:template match="ch.not"><xsl:text>¬</xsl:text></xsl:template><!-- not sign, U+00AC ISOnum -->
1106 <xsl:template match="ch.shy"><xsl:text>­</xsl:text></xsl:template><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
1107 <xsl:template match="ch.reg"><xsl:text>®</xsl:text></xsl:template><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
1108 <xsl:template match="ch.macr"><xsl:text>¯</xsl:text></xsl:template><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
1109 <xsl:template match="ch.deg"><xsl:text>°</xsl:text></xsl:template><!-- degree sign, U+00B0 ISOnum -->
1110 <xsl:template match="ch.plusmn"><xsl:text>±</xsl:text></xsl:template><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
1111 <xsl:template match="ch.sup2"><xsl:text>²</xsl:text></xsl:template><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
1112 <xsl:template match="ch.sup3"><xsl:text>³</xsl:text></xsl:template><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
1113 <xsl:template match="ch.acute"><xsl:text>´</xsl:text></xsl:template><!-- acute accent = spacing acute, U+00B4 ISOdia -->
1114 <xsl:template match="ch.micro"><xsl:text>µ</xsl:text></xsl:template><!-- micro sign, U+00B5 ISOnum -->
1115 <xsl:template match="ch.para"><xsl:text>¶</xsl:text></xsl:template><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
1116 <xsl:template match="ch.middot"><xsl:text>·</xsl:text></xsl:template><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
1117 <xsl:template match="ch.cedil"><xsl:text>¸</xsl:text></xsl:template><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
1118 <xsl:template match="ch.sup1"><xsl:text>¹</xsl:text></xsl:template><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
1119 <xsl:template match="ch.ordm"><xsl:text>º</xsl:text></xsl:template><!-- masculine ordinal indicator, U+00BA ISOnum -->
1120 <xsl:template match="ch.raquo"><xsl:text>»</xsl:text></xsl:template><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
1121 <xsl:template match="ch.frac14"><xsl:text>¼</xsl:text></xsl:template><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
1122 <xsl:template match="ch.frac12"><xsl:text>½</xsl:text></xsl:template><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
1123 <xsl:template match="ch.frac34"><xsl:text>¾</xsl:text></xsl:template><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
1124 <xsl:template match="ch.iquest"><xsl:text>¿</xsl:text></xsl:template><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
1125 <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 -->
1126 <xsl:template match="ch.Aacute"><xsl:text>Á</xsl:text></xsl:template><!-- latin capital letter A with acute, U+00C1 ISOlat1 -->
1127 <xsl:template match="ch.Acirc"><xsl:text>Â</xsl:text></xsl:template><!-- latin capital letter A with circumflex, U+00C2 ISOlat1 -->
1128 <xsl:template match="ch.Atilde"><xsl:text>Ã</xsl:text></xsl:template><!-- latin capital letter A with tilde, U+00C3 ISOlat1 -->
1129 <xsl:template match="ch.Auml"><xsl:text>Ä</xsl:text></xsl:template><!-- latin capital letter A with diaeresis, U+00C4 ISOlat1 -->
1130 <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 -->
1131 <xsl:template match="ch.AElig"><xsl:text>Æ</xsl:text></xsl:template><!-- latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 -->
1132 <xsl:template match="ch.Ccedil"><xsl:text>Ç</xsl:text></xsl:template><!-- latin capital letter C with cedilla, U+00C7 ISOlat1 -->
1133 <xsl:template match="ch.Egrave"><xsl:text>È</xsl:text></xsl:template><!-- latin capital letter E with grave, U+00C8 ISOlat1 -->
1134 <xsl:template match="ch.Eacute"><xsl:text>É</xsl:text></xsl:template><!-- latin capital letter E with acute, U+00C9 ISOlat1 -->
1135 <xsl:template match="ch.Ecirc"><xsl:text>Ê</xsl:text></xsl:template><!-- latin capital letter E with circumflex, U+00CA ISOlat1 -->
1136 <xsl:template match="ch.Euml"><xsl:text>Ë</xsl:text></xsl:template><!-- latin capital letter E with diaeresis, U+00CB ISOlat1 -->
1137 <xsl:template match="ch.Igrave"><xsl:text>Ì</xsl:text></xsl:template><!-- latin capital letter I with grave, U+00CC ISOlat1 -->
1138 <xsl:template match="ch.Iacute"><xsl:text>Í</xsl:text></xsl:template><!-- latin capital letter I with acute, U+00CD ISOlat1 -->
1139 <xsl:template match="ch.Icirc"><xsl:text>Î</xsl:text></xsl:template><!-- latin capital letter I with circumflex, U+00CE ISOlat1 -->
1140 <xsl:template match="ch.Iuml"><xsl:text>Ï</xsl:text></xsl:template><!-- latin capital letter I with diaeresis, U+00CF ISOlat1 -->
1141 <xsl:template match="ch.ETH"><xsl:text>Ð</xsl:text></xsl:template><!-- latin capital letter ETH, U+00D0 ISOlat1 -->
1142 <xsl:template match="ch.Ntilde"><xsl:text>Ñ</xsl:text></xsl:template><!-- latin capital letter N with tilde, U+00D1 ISOlat1 -->
1143 <xsl:template match="ch.Ograve"><xsl:text>Ò</xsl:text></xsl:template><!-- latin capital letter O with grave, U+00D2 ISOlat1 -->
1144 <xsl:template match="ch.Oacute"><xsl:text>Ó</xsl:text></xsl:template><!-- latin capital letter O with acute, U+00D3 ISOlat1 -->
1145 <xsl:template match="ch.Ocirc"><xsl:text>Ô</xsl:text></xsl:template><!-- latin capital letter O with circumflex, U+00D4 ISOlat1 -->
1146 <xsl:template match="ch.Otilde"><xsl:text>Õ</xsl:text></xsl:template><!-- latin capital letter O with tilde, U+00D5 ISOlat1 -->
1147 <xsl:template match="ch.Ouml"><xsl:text>Ö</xsl:text></xsl:template><!-- latin capital letter O with diaeresis, U+00D6 ISOlat1 -->
1148 <xsl:template match="ch.times"><xsl:text>×</xsl:text></xsl:template><!-- multiplication sign, U+00D7 ISOnum -->
1149 <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 -->
1150 <xsl:template match="ch.Ugrave"><xsl:text>Ù</xsl:text></xsl:template><!-- latin capital letter U with grave, U+00D9 ISOlat1 -->
1151 <xsl:template match="ch.Uacute"><xsl:text>Ú</xsl:text></xsl:template><!-- latin capital letter U with acute, U+00DA ISOlat1 -->
1152 <xsl:template match="ch.Ucirc"><xsl:text>Û</xsl:text></xsl:template><!-- latin capital letter U with circumflex, U+00DB ISOlat1 -->
1153 <xsl:template match="ch.Uuml"><xsl:text>Ü</xsl:text></xsl:template><!-- latin capital letter U with diaeresis, U+00DC ISOlat1 -->
1154 <xsl:template match="ch.Yacute"><xsl:text>Ý</xsl:text></xsl:template><!-- latin capital letter Y with acute, U+00DD ISOlat1 -->
1155 <xsl:template match="ch.THORN"><xsl:text>Þ</xsl:text></xsl:template><!-- latin capital letter THORN, U+00DE ISOlat1 -->
1156 <xsl:template match="ch.szlig"><xsl:text>ß</xsl:text></xsl:template><!-- latin small letter sharp s = ess-zed, U+00DF ISOlat1 -->
1157 <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 -->
1158 <xsl:template match="ch.aacute"><xsl:text>á</xsl:text></xsl:template><!-- latin small letter a with acute, U+00E1 ISOlat1 -->
1159 <xsl:template match="ch.acirc"><xsl:text>â</xsl:text></xsl:template><!-- latin small letter a with circumflex, U+00E2 ISOlat1 -->
1160 <xsl:template match="ch.atilde"><xsl:text>ã</xsl:text></xsl:template><!-- latin small letter a with tilde, U+00E3 ISOlat1 -->
1161 <xsl:template match="ch.auml"><xsl:text>ä</xsl:text></xsl:template><!-- latin small letter a with diaeresis, U+00E4 ISOlat1 -->
1162 <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 -->
1163 <xsl:template match="ch.aelig"><xsl:text>æ</xsl:text></xsl:template><!-- latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 -->
1164 <xsl:template match="ch.ccedil"><xsl:text>ç</xsl:text></xsl:template><!-- latin small letter c with cedilla, U+00E7 ISOlat1 -->
1165 <xsl:template match="ch.egrave"><xsl:text>è</xsl:text></xsl:template><!-- latin small letter e with grave, U+00E8 ISOlat1 -->
1166 <xsl:template match="ch.eacute"><xsl:text>é</xsl:text></xsl:template><!-- latin small letter e with acute, U+00E9 ISOlat1 -->
1167 <xsl:template match="ch.ecirc"><xsl:text>ê</xsl:text></xsl:template><!-- latin small letter e with circumflex, U+00EA ISOlat1 -->
1168 <xsl:template match="ch.euml"><xsl:text>ë</xsl:text></xsl:template><!-- latin small letter e with diaeresis, U+00EB ISOlat1 -->
1169 <xsl:template match="ch.igrave"><xsl:text>ì</xsl:text></xsl:template><!-- latin small letter i with grave, U+00EC ISOlat1 -->
1170 <xsl:template match="ch.iacute"><xsl:text>í</xsl:text></xsl:template><!-- latin small letter i with acute, U+00ED ISOlat1 -->
1171 <xsl:template match="ch.icirc"><xsl:text>î</xsl:text></xsl:template><!-- latin small letter i with circumflex, U+00EE ISOlat1 -->
1172 <xsl:template match="ch.iuml"><xsl:text>ï</xsl:text></xsl:template><!-- latin small letter i with diaeresis, U+00EF ISOlat1 -->
1173 <xsl:template match="ch.eth"><xsl:text>ð</xsl:text></xsl:template><!-- latin small letter eth, U+00F0 ISOlat1 -->
1174 <xsl:template match="ch.ntilde"><xsl:text>ñ</xsl:text></xsl:template><!-- latin small letter n with tilde, U+00F1 ISOlat1 -->
1175 <xsl:template match="ch.ograve"><xsl:text>ò</xsl:text></xsl:template><!-- latin small letter o with grave, U+00F2 ISOlat1 -->
1176 <xsl:template match="ch.oacute"><xsl:text>ó</xsl:text></xsl:template><!-- latin small letter o with acute, U+00F3 ISOlat1 -->
1177 <xsl:template match="ch.ocirc"><xsl:text>ô</xsl:text></xsl:template><!-- latin small letter o with circumflex, U+00F4 ISOlat1 -->
1178 <xsl:template match="ch.otilde"><xsl:text>õ</xsl:text></xsl:template><!-- latin small letter o with tilde, U+00F5 ISOlat1 -->
1179 <xsl:template match="ch.ouml"><xsl:text>ö</xsl:text></xsl:template><!-- latin small letter o with diaeresis, U+00F6 ISOlat1 -->
1180 <xsl:template match="ch.divide"><xsl:text>÷</xsl:text></xsl:template><!-- division sign, U+00F7 ISOnum -->
1181 <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 -->
1182 <xsl:template match="ch.ugrave"><xsl:text>ù</xsl:text></xsl:template><!-- latin small letter u with grave, U+00F9 ISOlat1 -->
1183 <xsl:template match="ch.uacute"><xsl:text>ú</xsl:text></xsl:template><!-- latin small letter u with acute, U+00FA ISOlat1 -->
1184 <xsl:template match="ch.ucirc"><xsl:text>û</xsl:text></xsl:template><!-- latin small letter u with circumflex, U+00FB ISOlat1 -->
1185 <xsl:template match="ch.uuml"><xsl:text>ü</xsl:text></xsl:template><!-- latin small letter u with diaeresis, U+00FC ISOlat1 -->
1186 <xsl:template match="ch.yacute"><xsl:text>ý</xsl:text></xsl:template><!-- latin small letter y with acute, U+00FD ISOlat1 -->
1187 <xsl:template match="ch.thorn"><xsl:text>þ</xsl:text></xsl:template><!-- latin small letter thorn, U+00FE ISOlat1 -->
1188 <xsl:template match="ch.yuml"><xsl:text>ÿ</xsl:text></xsl:template><!-- latin small letter y with diaeresis, U+00FF ISOlat1 -->
1190 <!-- ~~~~~~~~~~~~~~~~~~~~~ Special Characters ~~~~~~~~~~~~~~~~~~~~ -->
1192 <xsl:template match="ch.ampersand">&</xsl:template><!-- ampersand -->
1193 <xsl:template match="ch.lsquot">‘</xsl:template><!-- opening left quotation mark -->
1194 <xsl:template match="ch.rsquot">’</xsl:template><!-- closing right quotation mark -->
1195 <xsl:template match="ch.ldquot">“</xsl:template><!-- opening left double quotation mark -->
1196 <xsl:template match="ch.rdquot">”</xsl:template><!-- closing right double quotation mark -->
1197 <xsl:template match="ch.minus">−</xsl:template><!-- mathematical minus -->
1198 <xsl:template match="ch.endash">–</xsl:template><!-- endash -->
1199 <xsl:template match="ch.emdash">—</xsl:template><!-- emdash -->
1200 <xsl:template match="ch.ellips">…</xsl:template><!-- ellipsis -->
1201 <xsl:template match="ch.lellips">…</xsl:template><!-- left ellipsis, used at the beginning of edited material -->
1202 <xsl:template match="ch.blankline">_______</xsl:template><!-- blank line to be filled in -->
1203 <xsl:template match="ch.percent"><xsl:text>%</xsl:text></xsl:template><!-- percent sign -->
1204 <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 -->
1205 <xsl:template match="ch.frac116"><xsl:text>1/16</xsl:text></xsl:template><!-- vulgar fraction one sixteenth = fraction on sixteenth -->
1206 <xsl:template match="ch.plus"><xsl:text>+</xsl:text></xsl:template><!-- mathematical plus -->
1208 <!-- ==================== named templates ======================= -->
1211 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.
1213 <xsl:template name="section-title-link">
1214 <!-- will the list always contain the closest ancestor first? -->
1215 <xsl:variable name="section-title">
1216 <!-- numbered or not? -->
1217 <xsl:if test="ancestor::section[position()=1]/@class='numbered'">
1219 <xsl:when test="$language='es'">
1220 <xsl:text>Sección </xsl:text>
1223 <xsl:text>Section </xsl:text>
1227 <xsl:apply-templates select="ancestor::section[position()=1]/meta/title[1]" />
1231 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="ancestor::section[position()=1]/@id" /></xsl:attribute>
1232 <xsl:value-of select="$section-title" />