2 <!DOCTYPE xsl:transform [
3 <!ENTITY % xhtml.characters SYSTEM "../../en/xml/htmlchar.mod">
11 * Add blank whitespace handling to the paragraphed list template
15 <xsl:transform version="1.0"
16 xmlns="http://www.w3.org/1999/xhtml"
17 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18 xmlns:redirect="org.apache.xalan.lib.Redirect"
19 extension-element-prefixes="redirect">
21 <xsl:output method="xml"
23 omit-xml-declaration="yes"
24 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
25 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
27 <xsl:strip-space elements="section data ol ul dl li dd footnotes footnote" />
28 <xsl:preserve-space elements="p choice" />
30 <!-- ====================== parameters ========================== -->
32 <xsl:param name="use-illustrators" />
33 <xsl:param name="language"><xsl:text>en</xsl:text></xsl:param>
35 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ colors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
37 <xsl:param name="link-color"><xsl:text>#ff0000</xsl:text></xsl:param>
38 <xsl:param name="alink-color"><xsl:value-of select="$link-color" /></xsl:param>
39 <xsl:param name="vlink-color"><xsl:value-of select="$link-color" /></xsl:param>
41 <xsl:param name="text-color"><xsl:text>#000000</xsl:text></xsl:param>
42 <xsl:param name="background-color"><xsl:text>#ffffe4</xsl:text></xsl:param>
44 <!-- ======================= variables ========================== -->
46 <xsl:variable name="newline">
51 <!-- ======================== Templates ========================= -->
53 <!-- ================= hierarchical sections ==================== -->
55 <xsl:template match="meta" />
56 <xsl:template match="section" />
58 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
60 <xsl:template match="/gamebook/section[@id='title']">
61 <xsl:call-template name="xhtml-wrapper">
62 <xsl:with-param name="document-type">top-level</xsl:with-param>
63 <xsl:with-param name="filename">title</xsl:with-param>
66 <xsl:apply-templates />
69 <xsl:template match="/gamebook/section[@id='toc']">
70 <xsl:call-template name="xhtml-wrapper">
71 <xsl:with-param name="document-type">toc</xsl:with-param>
72 <xsl:with-param name="filename">toc</xsl:with-param>
75 <xsl:apply-templates />
78 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
80 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
81 <xsl:call-template name="xhtml-wrapper">
82 <xsl:with-param name="document-type">second-level-frontmatter</xsl:with-param>
83 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
87 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
89 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
90 <h3><xsl:apply-templates select="meta/title[1]" /></h3>
92 <xsl:value-of select="$newline" />
93 <xsl:value-of select="$newline" />
95 <xsl:apply-templates />
98 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
99 <xsl:call-template name="xhtml-wrapper">
100 <xsl:with-param name="document-type">third-level-frontmatter-separate</xsl:with-param>
101 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
105 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
107 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
108 <h4><xsl:apply-templates select="meta/title[1]" /></h4>
110 <xsl:value-of select="$newline" />
111 <xsl:value-of select="$newline" />
113 <xsl:apply-templates />
116 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
118 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
119 <h5><xsl:apply-templates select="meta/title[1]" /></h5>
121 <xsl:value-of select="$newline" />
122 <xsl:value-of select="$newline" />
124 <xsl:apply-templates />
127 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
129 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
130 <xsl:call-template name="xhtml-wrapper">
131 <xsl:with-param name="document-type">second-level-mainmatter</xsl:with-param>
132 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
136 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
138 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
139 <h3><xsl:apply-templates select="meta/title[1]" /></h3>
141 <xsl:value-of select="$newline" />
142 <xsl:value-of select="$newline" />
144 <xsl:apply-templates />
147 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter-separate']">
148 <xsl:call-template name="xhtml-wrapper">
149 <xsl:with-param name="document-type">third-level-mainmatter-separate</xsl:with-param>
150 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
154 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
156 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
157 <h4><xsl:apply-templates select="meta/title[1]" /></h4>
159 <xsl:value-of select="$newline" />
160 <xsl:value-of select="$newline" />
162 <xsl:apply-templates />
165 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
167 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
168 <h5><xsl:apply-templates select="meta/title[1]" /></h5>
170 <xsl:value-of select="$newline" />
171 <xsl:value-of select="$newline" />
173 <xsl:apply-templates />
176 <!-- :::::::::::: second-level glossary sections ::::::::::::: -->
178 <xsl:template match="/gamebook/section/data/section[@class='glossary']">
179 <xsl:call-template name="xhtml-wrapper">
180 <xsl:with-param name="document-type">second-level-glossary</xsl:with-param>
181 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
182 <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
186 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
187 <!-- glossary sections should be enclosed in a second level glossary section -->
189 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary']">
190 <h3><xsl:apply-templates select="meta/title[1]" /></h3>
192 <xsl:value-of select="$newline" />
193 <xsl:value-of select="$newline" />
195 <xsl:apply-templates />
198 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary-separate']">
199 <xsl:call-template name="xhtml-wrapper">
200 <xsl:with-param name="document-type">third-level-glossary-separate</xsl:with-param>
201 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
202 <xsl:with-param name="glossary-id-prefix">topics</xsl:with-param>
206 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
208 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
209 <xsl:call-template name="xhtml-wrapper">
210 <xsl:with-param name="document-type">second-level-numbered</xsl:with-param>
211 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
214 <xsl:apply-templates />
217 <xsl:template match="/gamebook/section/data/section/data/section[@class='numbered']">
218 <xsl:call-template name="xhtml-wrapper">
219 <xsl:with-param name="document-type">third-level-numbered</xsl:with-param>
220 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
224 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
226 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
227 <xsl:call-template name="xhtml-wrapper">
228 <xsl:with-param name="document-type">second-level-backmatter</xsl:with-param>
229 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
233 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
235 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
236 <h3><xsl:apply-templates select="meta/title[1]" /></h3>
238 <xsl:value-of select="$newline" />
239 <xsl:value-of select="$newline" />
241 <xsl:apply-templates />
244 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
246 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
247 <h4><xsl:apply-templates select="meta/title[1]" /></h4>
249 <xsl:value-of select="$newline" />
250 <xsl:value-of select="$newline" />
252 <xsl:apply-templates />
255 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
257 <xsl:template match="id( 'map' )">
258 <xsl:call-template name="xhtml-wrapper">
259 <xsl:with-param name="document-type">map-adjusted</xsl:with-param>
260 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
263 <xsl:call-template name="xhtml-wrapper">
264 <xsl:with-param name="document-type">map</xsl:with-param>
265 <xsl:with-param name="filename"><xsl:value-of select="@id" /><xsl:text>large</xsl:text></xsl:with-param>
269 <!-- ::::::::::::::::::::: footnotes template ::::::::::::::::::::::::: -->
271 <xsl:template match="id( 'footnotz' )">
273 <!-- Backwards compatibility measure - if there is data content, use that, otherwise generate footnotes list -->
274 <xsl:when test="count( data/p ) = 0">
275 <xsl:call-template name="xhtml-wrapper">
276 <xsl:with-param name="document-type">footnotz</xsl:with-param>
277 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
281 <xsl:call-template name="xhtml-wrapper">
282 <xsl:with-param name="document-type">second-level-backmatter</xsl:with-param>
283 <xsl:with-param name="filename"><xsl:value-of select="@id" /></xsl:with-param>
287 <xsl:apply-templates />
290 <!-- ==================== block elements ======================== -->
292 <xsl:template match="p">
293 <p><xsl:apply-templates /></p>
294 <xsl:value-of select="$newline" />
297 <xsl:template match="p[@class='dedication']">
298 <p class="dedication"><xsl:apply-templates /></p>
299 <xsl:value-of select="$newline" />
302 <xsl:template match="dl[@class='paragraphed']/dd/node() | ol[@class='paragraphed']/li/node() | ul[@class='paragraphed']/li/node()">
304 <xsl:when test="self::p">
305 <xsl:apply-templates /><br /><br /><xsl:value-of select="$newline" />
307 <xsl:when test="self::dl">
308 <dl><xsl:value-of select="$newline" />
309 <xsl:apply-templates />
310 </dl><br /><br /><xsl:value-of select="$newline" />
312 <xsl:when test="self::ol">
313 <ol><xsl:value-of select="$newline" />
314 <xsl:apply-templates />
315 </ol><br /><br /><xsl:value-of select="$newline" />
317 <xsl:when test="self::ul">
319 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
320 <xsl:value-of select="$newline" />
321 <xsl:apply-templates />
322 </ul><br /><br /><xsl:value-of select="$newline" />
324 <xsl:when test="self::blockquote">
325 <blockquote><xsl:value-of select="$newline" />
326 <xsl:apply-templates />
327 </blockquote><xsl:value-of select="$newline" />
329 <xsl:when test="self::illustration">
330 <!-- Backwards compatibility code -->
331 <xsl:variable name="illustration-width" select="instance[@class='html-compatible']/@width" />
332 <xsl:variable name="illustration-height" select="instance[@class='html-compatible']/@height" />
333 <xsl:variable name="illustration-src" select="instance[@class='html-compatible']/@src" />
335 <xsl:if test="instance[@class='html-compatible'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
336 <div class="illustration">
337 <div align="center"><xsl:value-of select="$newline" />
338 <xsl:call-template name="illustration-framed">
339 <xsl:with-param name="illustration-width"><xsl:value-of select="$illustration-width" /></xsl:with-param>
340 <xsl:with-param name="illustration-height"><xsl:value-of select="$illustration-height" /></xsl:with-param>
341 <xsl:with-param name="illustration-src"><xsl:value-of select="$illustration-src" /></xsl:with-param>
343 <br /><xsl:value-of select="$newline" />
344 </div></div><xsl:value-of select="$newline" />
347 <xsl:when test="self::illref">
348 <xsl:if test="@class='html-compatible'">
349 <xsl:for-each select="id( @idref )">
350 <xsl:apply-templates select="." />
355 <xsl:text>[error: paragraphed list template]</xsl:text>
356 <xsl:message><xsl:text>error: paragraphed list template</xsl:text></xsl:message>
361 <xsl:template match="ol">
362 <ol><xsl:value-of select="$newline" />
363 <xsl:apply-templates />
364 </ol><xsl:value-of select="$newline" />
367 <xsl:template match="ul">
369 <xsl:if test="self::*[@class='unbulleted']"><xsl:attribute name="class"><xsl:text>unbulleted</xsl:text></xsl:attribute></xsl:if>
370 <xsl:value-of select="$newline" />
371 <xsl:apply-templates />
372 </ul><xsl:value-of select="$newline" />
375 <xsl:template match="dl">
376 <dl><xsl:value-of select="$newline" />
377 <xsl:apply-templates />
378 </dl><xsl:value-of select="$newline" />
381 <xsl:template match="dt">
382 <dt><xsl:apply-templates /></dt>
383 <xsl:value-of select="$newline" />
386 <xsl:template match="dd">
387 <dd><xsl:apply-templates /></dd>
388 <xsl:value-of select="$newline" />
391 <xsl:template match="li">
392 <li><xsl:apply-templates /></li>
393 <xsl:value-of select="$newline" />
396 <xsl:template match="table">
397 <table border="1" cellspacing="0" cellpadding="2">
398 <xsl:if test="@summary"><xsl:attribute name="summary"><xsl:value-of select="@summary" /></xsl:attribute></xsl:if>
399 <xsl:apply-templates />
401 <xsl:value-of select="$newline" />
404 <xsl:template match="caption">
406 <xsl:apply-templates />
410 <xsl:template match="colgroup[@scope]">
412 <xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute>
416 <xsl:template match="thead">
418 <xsl:apply-templates />
422 <xsl:template match="tfoot">
424 <xsl:apply-templates />
428 <xsl:template match="tbody">
430 <xsl:apply-templates />
434 <xsl:template match="tr">
436 <xsl:apply-templates />
440 <xsl:template match="th">
442 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
443 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
444 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
445 <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of select="@rowspan" /></xsl:attribute></xsl:if>
446 <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if>
447 <xsl:if test="@axis"><xsl:attribute name="axis"><xsl:value-of select="@axis" /></xsl:attribute></xsl:if>
448 <xsl:if test="@scope"><xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute></xsl:if>
449 <xsl:apply-templates />
453 <xsl:template match="td">
455 <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute></xsl:if>
456 <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign" /></xsl:attribute></xsl:if>
457 <xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char" /></xsl:attribute></xsl:if>
458 <xsl:if test="@rowspan"><xsl:attribute name="rowspan"><xsl:value-of select="@rowspan" /></xsl:attribute></xsl:if>
459 <xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if>
460 <xsl:if test="@axis"><xsl:attribute name="axis"><xsl:value-of select="@axis" /></xsl:attribute></xsl:if>
461 <xsl:if test="@scope"><xsl:attribute name="scope"><xsl:value-of select="@scope" /></xsl:attribute></xsl:if>
462 <xsl:apply-templates />
466 <xsl:template match="combat">
468 <xsl:apply-templates select="enemy" />
469 <xsl:text>: </xsl:text>
471 <xsl:when test="enemy-attribute[@class='combatskill']">
472 <span class="smallcaps">
474 <xsl:when test="$language='es'">
475 <xsl:text>DESTREZA EN EL COMBATE</xsl:text>
478 <xsl:text>COMBAT SKILL</xsl:text>
482 <xsl:text> </xsl:text>
483 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
485 <xsl:when test="enemy-attribute[@class='closecombatskill']">
486 <span class="smallcaps">
488 <xsl:when test="$language='es'">
489 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
492 <xsl:text>CLOSE COMBAT SKILL</xsl:text>
496 <xsl:text> </xsl:text>
497 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
500 <xsl:text> </xsl:text>
501 <span class="smallcaps">
503 <xsl:when test="$language='es'">
504 <xsl:text>RESISTENCIA</xsl:text>
507 <xsl:text>ENDURANCE</xsl:text>
512 <xsl:when test="enemy-attribute[@class='target']">
514 <xsl:when test="$language='es'">
515 <xsl:text> (o </xsl:text><span class="smallcaps">BLANCOS</span><xsl:text>)</xsl:text>
518 <xsl:text> (</xsl:text><span class="smallcaps">TARGET</span><xsl:text> points)</xsl:text>
521 <xsl:text> </xsl:text>
522 <xsl:value-of select="enemy-attribute[@class='target']" />
524 <xsl:when test="enemy-attribute[@class='resistance']">
526 <xsl:when test="$language='es'"></xsl:when>
528 <xsl:text> (</xsl:text><span class="smallcaps">RESISTANCE</span><xsl:text> points)</xsl:text>
531 <xsl:text> </xsl:text>
532 <xsl:value-of select="enemy-attribute[@class='resistance']" />
535 <xsl:text> </xsl:text>
536 <xsl:value-of select="enemy-attribute[@class='endurance']" />
540 <xsl:value-of select="$newline" />
543 <xsl:template match="choice">
544 <xsl:variable name="link">
545 <xsl:value-of select="@idref" />
549 <xsl:for-each select="* | text()">
551 <xsl:when test="self::link-text">
552 <a href="{$link}.htm">
553 <xsl:apply-templates />
557 <xsl:apply-templates select="." />
562 <xsl:value-of select="$newline" />
565 <xsl:template match="signpost">
566 <div class="signpost">
567 <xsl:apply-templates />
569 <xsl:value-of select="$newline" />
572 <xsl:template match="blockquote">
573 <blockquote><xsl:value-of select="$newline" />
574 <xsl:apply-templates /><xsl:value-of select="$newline" />
575 </blockquote><xsl:value-of select="$newline" />
578 <xsl:template match="illref">
579 <!-- 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 -->
580 <xsl:if test="@class='html-compatible'">
581 <xsl:for-each select="id( @idref )">
582 <!-- 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... -->
583 <!-- When backwards compatibility can be dropped, most of (all?) the <illustration> processing can happen here -->
584 <xsl:apply-templates select="." />
589 <xsl:template match="illustrations">
590 <ul class="unbulleted">
591 <xsl:for-each select="illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) )] | illgroup">
593 <xsl:when test="self::illustration and @class='float'">
594 <!-- List item with illustration name as link -->
597 <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>
599 <xsl:when test="$language='es'">
600 <xsl:text>Ilustración </xsl:text>
603 <xsl:text>Illustration </xsl:text>
606 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
608 <!-- List the sections that the illustration appears in -->
609 <xsl:text> (</xsl:text>
610 <xsl:for-each select="//illref[@class='html-compatible' and @idref=current()/@id]">
611 <xsl:call-template name="section-title-link" />
612 <xsl:if test="position()!=last()">
613 <xsl:text>, </xsl:text>
616 <xsl:text>)</xsl:text><xsl:value-of select="$newline" />
618 <!-- Call the backwards compatible template for generating the illustration page -->
619 <xsl:call-template name="xhtml-wrapper">
620 <xsl:with-param name="document-type">illustration</xsl:with-param>
621 <xsl:with-param name="filename"><xsl:text>ill</xsl:text><xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) ) ]" from="/" level="any" format="1" /></xsl:with-param>
625 <xsl:when test="self::illustration"> <!-- inline and map -->
626 <!-- List the sections that the illustration appears in -->
628 <!-- TODO: fix this so that sections that do not represent separate XHTML files are not linked to? -->
629 <xsl:for-each select="//illref[@class='html-compatible' and @idref=current()/@id]">
630 <xsl:call-template name="section-title-link" />
631 <xsl:if test="position()!=last()">
632 <xsl:text>, </xsl:text>
638 <xsl:when test="self::illgroup and @class!='hidden'">
639 <!-- Check if the group contains any illustrations being used, before creating the list item -->
640 <xsl:if test="count( illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) )] ) != 0">
643 <xsl:attribute name="href"><xsl:value-of select="@idref" /><xsl:text>.htm</xsl:text></xsl:attribute>
644 <xsl:value-of select="id(@idref)/meta/title[1]" />
651 </ul><xsl:value-of select="$newline" />
654 <xsl:template match="illustration">
655 <xsl:variable name="illustration-width" select="instance[@class='html-compatible']/@width" />
656 <xsl:variable name="illustration-height" select="instance[@class='html-compatible']/@height" />
657 <xsl:variable name="illustration-src" select="instance[@class='html-compatible']/@src" />
659 <xsl:variable name="illustration-width-adjusted"><xsl:number value="$illustration-width div 2" /></xsl:variable>
660 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height div 2" /></xsl:variable>
662 <xsl:if test="instance[@class='html-compatible'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
664 <xsl:when test="@class='float'">
665 <div class="illustration">
666 <div align="center"><xsl:value-of select="$newline" />
667 <xsl:call-template name="illustration-framed">
668 <xsl:with-param name="illustration-width"><xsl:value-of select="$illustration-width-adjusted" /></xsl:with-param>
669 <xsl:with-param name="illustration-height"><xsl:value-of select="$illustration-height-adjusted" /></xsl:with-param>
670 <xsl:with-param name="illustration-src"><xsl:value-of select="$illustration-src" /></xsl:with-param>
671 <xsl:with-param name="illustration-href">
672 <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>
675 <br /><xsl:value-of select="$newline" />
676 </div></div><xsl:value-of select="$newline" />
678 <xsl:call-template name="xhtml-wrapper">
679 <xsl:with-param name="document-type">illustration</xsl:with-param>
680 <xsl:with-param name="filename"><xsl:text>ill</xsl:text><xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) ) ]" from="/" level="any" format="1" /></xsl:with-param>
684 <xsl:when test="@class='accent'" />
687 <div class="illustration">
688 <div align="center"><xsl:value-of select="$newline" />
689 <xsl:call-template name="illustration-framed">
690 <xsl:with-param name="illustration-width"><xsl:value-of select="$illustration-width" /></xsl:with-param>
691 <xsl:with-param name="illustration-height"><xsl:value-of select="$illustration-height" /></xsl:with-param>
692 <xsl:with-param name="illustration-src"><xsl:value-of select="$illustration-src" /></xsl:with-param>
694 <br /><xsl:value-of select="$newline" />
695 </div></div><xsl:value-of select="$newline" />
701 <xsl:template match="instance" />
703 <xsl:template match="footnotes" />
705 <xsl:template match="footnote" />
707 <xsl:template match="hr">
709 <xsl:value-of select="$newline" />
712 <!-- ==================== inline elements ======================= -->
714 <xsl:template match="a">
716 <xsl:when test="@href">
718 <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
719 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
720 <xsl:apply-templates />
725 <xsl:if test="@idref">
726 <xsl:variable name="my-idref" select="@idref" />
727 <xsl:attribute name="href">
729 <!-- The order of these tests is deliberate. They are ordered roughly from most to least specific. -->
730 <xsl:when test="/gamebook/section[@id=$my-idref] | /gamebook/section/data/section[@id=$my-idref]">
731 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
733 <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and @id=$my-idref]">
734 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
736 <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and @id=$my-idref]">
737 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
739 <xsl:when test="/gamebook/section/data/section/data/section[@class='numbered' and @id=$my-idref]">
740 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
742 <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and @id=$my-idref]">
743 <xsl:value-of select="$my-idref" /><xsl:text>.htm</xsl:text>
745 <xsl:when test="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and descendant::*[@id=$my-idref]]">
746 <xsl:value-of select="/gamebook/section/data/section/data/section[@class='frontmatter-separate' and descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
748 <xsl:when test="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and descendant::*[@id=$my-idref]]">
749 <xsl:value-of select="/gamebook/section/data/section/data/section[@class='mainmatter-separate' and descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
751 <xsl:when test="/gamebook/section/data/section/data/section[@class='glossary-separate' and descendant::*[@id=$my-idref]]">
752 <xsl:value-of select="/gamebook/section/data/section/data/section[@class='glossary-separate' and descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
754 <xsl:when test="/gamebook/section/data/section[descendant::*[@id=$my-idref]]">
755 <xsl:value-of select="/gamebook/section/data/section[descendant::*[@id=$my-idref]]/@id" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$my-idref" />
758 <xsl:text>[error: a template]</xsl:text>
759 <xsl:message><xsl:text>error: a template</xsl:text></xsl:message>
764 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
765 <xsl:apply-templates />
771 <!-- This template is obsolete, the "footref" element should be used instead -->
772 <xsl:template match="a[@class='footnote']">
773 <!-- <xsl:message><xsl:text>WARNING: Obsolete <a idref='...' class='footnote' /> usage</xsl:text></xsl:message> -->
774 <xsl:apply-templates />
777 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
778 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
779 <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
784 <!-- TODO: can this be made more uniform with illrefs? -->
785 <xsl:template match="a[@class='accent-illustration']">
786 <xsl:for-each select="id( @idref )">
787 <xsl:variable name="illustration-src" select="instance[@class='html-compatible']/@src" />
788 <xsl:variable name="illustration-width" select="instance[@class='html-compatible']/@width" />
789 <xsl:variable name="illustration-height" select="instance[@class='html-compatible']/@height" />
790 <xsl:if test="instance[@class='html-compatible'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
791 <img src="{$illustration-src}" class="accent" width="{$illustration-width}" height="{$illustration-height}" alt="" border="" align="left" />
796 <xsl:template match="bookref">
798 <xsl:attribute name="href">
799 <xsl:variable name="my-section">
801 <xsl:when test="@section">
802 <xsl:value-of select="@section" />
805 <xsl:text>title</xsl:text>
809 <xsl:variable name="my-series">
810 <!-- If series is specified, go one directory back and then to series. Otherwise, add nothing. -->
812 <xsl:when test="@series">
813 <xsl:text>/../</xsl:text><xsl:value-of select="@series" />
816 <xsl:text></xsl:text>
820 <xsl:text>..</xsl:text><xsl:value-of select="$my-series" /><xsl:text>/</xsl:text><xsl:value-of select="@book" /><xsl:text>/</xsl:text><xsl:value-of select="$my-section" /><xsl:text>.htm</xsl:text>
822 <xsl:if test="@id"><xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute></xsl:if>
823 <xsl:apply-templates />
827 <xsl:template match="footref">
828 <xsl:apply-templates />
831 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@idref" /></xsl:attribute>
832 <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
833 <xsl:number count="footref" from="/" level="any" format="1" />
838 <xsl:template match="em">
839 <em><xsl:apply-templates /></em>
842 <xsl:template match="strong">
843 <strong><xsl:apply-templates /></strong>
846 <xsl:template match="thought">
847 <i><xsl:apply-templates /></i>
850 <xsl:template match="onomatopoeia">
851 <i><xsl:apply-templates /></i>
854 <xsl:template match="spell">
855 <i><xsl:apply-templates /></i>
858 <xsl:template match="item">
859 <strong><xsl:apply-templates /></strong>
862 <xsl:template match="foreign">
863 <i><xsl:apply-templates /></i>
866 <xsl:template match="quote">
867 <xsl:text>'</xsl:text>
868 <xsl:apply-templates />
869 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>'</xsl:text></xsl:if>
872 <xsl:template match="quote//quote">
873 <xsl:text>"</xsl:text>
874 <xsl:apply-templates />
875 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>"</xsl:text></xsl:if>
878 <xsl:template match="cite">
879 <cite><xsl:apply-templates /></cite>
882 <xsl:template match="code">
883 <tt><xsl:apply-templates /></tt>
886 <xsl:template match="line">
887 <xsl:apply-templates />
888 <xsl:if test="position( ) != last( )"><br /></xsl:if>
891 <xsl:template match="br">
895 <xsl:template match="typ[@class='attribute']">
896 <span class="smallcaps"><xsl:apply-templates /></span>
899 <!-- ==================== character elements ==================== -->
902 These templates define the mapping between the character elements used in
903 the Project Aon instances of Gamebook XML and the ISO-8859-1
906 Portions Copyright International Organization for Standardization 1986
907 Permission to copy in any form is granted for use with conforming SGML
908 systems and applications as defined in ISO 8879, provided this notice
909 is included in all copies.
913 <xsl:template match="ch.apos"><xsl:text>'</xsl:text></xsl:template><!-- apostrophe = single quotation mark -->
914 <xsl:template match="ch.nbsp"><xsl:text> </xsl:text></xsl:template><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
915 <xsl:template match="ch.iexcl"><xsl:text>¡</xsl:text></xsl:template><!-- inverted exclamation mark, U+00A1 ISOnum -->
916 <xsl:template match="ch.cent"><xsl:text>¢</xsl:text></xsl:template><!-- cent sign, U+00A2 ISOnum -->
917 <xsl:template match="ch.pound"><xsl:text>£</xsl:text></xsl:template><!-- pound sign, U+00A3 ISOnum -->
918 <xsl:template match="ch.curren"><xsl:text>¤</xsl:text></xsl:template><!-- currency sign, U+00A4 ISOnum -->
919 <xsl:template match="ch.yen"><xsl:text>¥</xsl:text></xsl:template><!-- yen sign = yuan sign, U+00A5 ISOnum -->
920 <xsl:template match="ch.brvbar"><xsl:text>¦</xsl:text></xsl:template><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
921 <xsl:template match="ch.sect"><xsl:text>§</xsl:text></xsl:template><!-- section sign, U+00A7 ISOnum -->
922 <xsl:template match="ch.uml"><xsl:text>¨</xsl:text></xsl:template><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
923 <xsl:template match="ch.copy"><xsl:text>©</xsl:text></xsl:template><!-- copyright sign, U+00A9 ISOnum -->
924 <xsl:template match="ch.ordf"><xsl:text>ª</xsl:text></xsl:template><!-- feminine ordinal indicator, U+00AA ISOnum -->
925 <xsl:template match="ch.laquo"><xsl:text>«</xsl:text></xsl:template><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
926 <xsl:template match="ch.not"><xsl:text>¬</xsl:text></xsl:template><!-- not sign, U+00AC ISOnum -->
927 <xsl:template match="ch.shy"><xsl:text>­</xsl:text></xsl:template><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
928 <xsl:template match="ch.reg"><xsl:text>®</xsl:text></xsl:template><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
929 <xsl:template match="ch.macr"><xsl:text>¯</xsl:text></xsl:template><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
930 <xsl:template match="ch.deg"><xsl:text>°</xsl:text></xsl:template><!-- degree sign, U+00B0 ISOnum -->
931 <xsl:template match="ch.plusmn"><xsl:text>±</xsl:text></xsl:template><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
932 <xsl:template match="ch.sup2"><xsl:text>²</xsl:text></xsl:template><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
933 <xsl:template match="ch.sup3"><xsl:text>³</xsl:text></xsl:template><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
934 <xsl:template match="ch.acute"><xsl:text>´</xsl:text></xsl:template><!-- acute accent = spacing acute, U+00B4 ISOdia -->
935 <xsl:template match="ch.micro"><xsl:text>µ</xsl:text></xsl:template><!-- micro sign, U+00B5 ISOnum -->
936 <xsl:template match="ch.para"><xsl:text>¶</xsl:text></xsl:template><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
937 <xsl:template match="ch.middot"><xsl:text>·</xsl:text></xsl:template><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
938 <xsl:template match="ch.cedil"><xsl:text>¸</xsl:text></xsl:template><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
939 <xsl:template match="ch.sup1"><xsl:text>¹</xsl:text></xsl:template><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
940 <xsl:template match="ch.ordm"><xsl:text>º</xsl:text></xsl:template><!-- masculine ordinal indicator, U+00BA ISOnum -->
941 <xsl:template match="ch.raquo"><xsl:text>»</xsl:text></xsl:template><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
942 <xsl:template match="ch.frac14"><xsl:text>¼</xsl:text></xsl:template><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
943 <xsl:template match="ch.frac12"><xsl:text>½</xsl:text></xsl:template><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
944 <xsl:template match="ch.frac34"><xsl:text>¾</xsl:text></xsl:template><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
945 <xsl:template match="ch.frac13"><xsl:text>⅓</xsl:text></xsl:template><!-- vulgar fraction 1/3, U+2153 ISOnum -->
946 <xsl:template match="ch.frac23"><xsl:text>⅔</xsl:text></xsl:template><!-- vulgar fraction 2/3, U+2154 ISOnum -->
947 <xsl:template match="ch.frac15"><xsl:text>⅕</xsl:text></xsl:template><!-- vulgar fraction 1/5, U+2155 ISOnum -->
948 <xsl:template match="ch.frac25"><xsl:text>⅖</xsl:text></xsl:template><!-- vulgar fraction 2/5, U+2156 ISOnum -->
949 <xsl:template match="ch.frac35"><xsl:text>⅗</xsl:text></xsl:template><!-- vulgar fraction 3/5, U+2157 ISOnum -->
950 <xsl:template match="ch.frac45"><xsl:text>⅘</xsl:text></xsl:template><!-- vulgar fraction 4/5, U+2158 ISOnum -->
951 <xsl:template match="ch.frac16"><xsl:text>⅙</xsl:text></xsl:template><!-- vulgar fraction 1/6, U+2159 ISOnum -->
952 <xsl:template match="ch.frac56"><xsl:text>⅚</xsl:text></xsl:template><!-- vulgar fraction 5/6, U+215A ISOnum -->
953 <xsl:template match="ch.frac17"><xsl:text>⅐</xsl:text></xsl:template><!-- vulgar fraction 1/7, U+2150 ISOnum -->
954 <xsl:template match="ch.frac18"><xsl:text>⅛</xsl:text></xsl:template><!-- vulgar fraction 1/8, U+215B ISOnum -->
955 <xsl:template match="ch.frac38"><xsl:text>⅜</xsl:text></xsl:template><!-- vulgar fraction 3/8, U+215C ISOnum -->
956 <xsl:template match="ch.frac58"><xsl:text>⅝</xsl:text></xsl:template><!-- vulgar fraction 5/8, U+215D ISOnum -->
957 <xsl:template match="ch.frac78"><xsl:text>⅞</xsl:text></xsl:template><!-- vulgar fraction 7/8, U+215E ISOnum -->
958 <xsl:template match="ch.frac19"><xsl:text>⅑</xsl:text></xsl:template><!-- vulgar fraction 1/9, U+2151 ISOnum -->
959 <xsl:template match="ch.frac110"><xsl:text>⅒</xsl:text></xsl:template><!-- vulgar fraction 1/10, U+2152 ISO num -->
960 <xsl:template match="ch.iquest"><xsl:text>¿</xsl:text></xsl:template><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
961 <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 -->
962 <xsl:template match="ch.Aacute"><xsl:text>Á</xsl:text></xsl:template><!-- latin capital letter A with acute, U+00C1 ISOlat1 -->
963 <xsl:template match="ch.Acirc"><xsl:text>Â</xsl:text></xsl:template><!-- latin capital letter A with circumflex, U+00C2 ISOlat1 -->
964 <xsl:template match="ch.Atilde"><xsl:text>Ã</xsl:text></xsl:template><!-- latin capital letter A with tilde, U+00C3 ISOlat1 -->
965 <xsl:template match="ch.Auml"><xsl:text>Ä</xsl:text></xsl:template><!-- latin capital letter A with diaeresis, U+00C4 ISOlat1 -->
966 <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 -->
967 <xsl:template match="ch.AElig"><xsl:text>Æ</xsl:text></xsl:template><!-- latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 -->
968 <xsl:template match="ch.Ccedil"><xsl:text>Ç</xsl:text></xsl:template><!-- latin capital letter C with cedilla, U+00C7 ISOlat1 -->
969 <xsl:template match="ch.Egrave"><xsl:text>È</xsl:text></xsl:template><!-- latin capital letter E with grave, U+00C8 ISOlat1 -->
970 <xsl:template match="ch.Eacute"><xsl:text>É</xsl:text></xsl:template><!-- latin capital letter E with acute, U+00C9 ISOlat1 -->
971 <xsl:template match="ch.Ecirc"><xsl:text>Ê</xsl:text></xsl:template><!-- latin capital letter E with circumflex, U+00CA ISOlat1 -->
972 <xsl:template match="ch.Euml"><xsl:text>Ë</xsl:text></xsl:template><!-- latin capital letter E with diaeresis, U+00CB ISOlat1 -->
973 <xsl:template match="ch.Igrave"><xsl:text>Ì</xsl:text></xsl:template><!-- latin capital letter I with grave, U+00CC ISOlat1 -->
974 <xsl:template match="ch.Iacute"><xsl:text>Í</xsl:text></xsl:template><!-- latin capital letter I with acute, U+00CD ISOlat1 -->
975 <xsl:template match="ch.Icirc"><xsl:text>Î</xsl:text></xsl:template><!-- latin capital letter I with circumflex, U+00CE ISOlat1 -->
976 <xsl:template match="ch.Iuml"><xsl:text>Ï</xsl:text></xsl:template><!-- latin capital letter I with diaeresis, U+00CF ISOlat1 -->
977 <xsl:template match="ch.ETH"><xsl:text>Ð</xsl:text></xsl:template><!-- latin capital letter ETH, U+00D0 ISOlat1 -->
978 <xsl:template match="ch.Ntilde"><xsl:text>Ñ</xsl:text></xsl:template><!-- latin capital letter N with tilde, U+00D1 ISOlat1 -->
979 <xsl:template match="ch.Ograve"><xsl:text>Ò</xsl:text></xsl:template><!-- latin capital letter O with grave, U+00D2 ISOlat1 -->
980 <xsl:template match="ch.Oacute"><xsl:text>Ó</xsl:text></xsl:template><!-- latin capital letter O with acute, U+00D3 ISOlat1 -->
981 <xsl:template match="ch.Ocirc"><xsl:text>Ô</xsl:text></xsl:template><!-- latin capital letter O with circumflex, U+00D4 ISOlat1 -->
982 <xsl:template match="ch.Otilde"><xsl:text>Õ</xsl:text></xsl:template><!-- latin capital letter O with tilde, U+00D5 ISOlat1 -->
983 <xsl:template match="ch.Ouml"><xsl:text>Ö</xsl:text></xsl:template><!-- latin capital letter O with diaeresis, U+00D6 ISOlat1 -->
984 <xsl:template match="ch.times"><xsl:text>×</xsl:text></xsl:template><!-- multiplication sign, U+00D7 ISOnum -->
985 <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 -->
986 <xsl:template match="ch.Ugrave"><xsl:text>Ù</xsl:text></xsl:template><!-- latin capital letter U with grave, U+00D9 ISOlat1 -->
987 <xsl:template match="ch.Uacute"><xsl:text>Ú</xsl:text></xsl:template><!-- latin capital letter U with acute, U+00DA ISOlat1 -->
988 <xsl:template match="ch.Ucirc"><xsl:text>Û</xsl:text></xsl:template><!-- latin capital letter U with circumflex, U+00DB ISOlat1 -->
989 <xsl:template match="ch.Uuml"><xsl:text>Ü</xsl:text></xsl:template><!-- latin capital letter U with diaeresis, U+00DC ISOlat1 -->
990 <xsl:template match="ch.Yacute"><xsl:text>Ý</xsl:text></xsl:template><!-- latin capital letter Y with acute, U+00DD ISOlat1 -->
991 <xsl:template match="ch.THORN"><xsl:text>Þ</xsl:text></xsl:template><!-- latin capital letter THORN, U+00DE ISOlat1 -->
992 <xsl:template match="ch.szlig"><xsl:text>ß</xsl:text></xsl:template><!-- latin small letter sharp s = ess-zed, U+00DF ISOlat1 -->
993 <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 -->
994 <xsl:template match="ch.aacute"><xsl:text>á</xsl:text></xsl:template><!-- latin small letter a with acute, U+00E1 ISOlat1 -->
995 <xsl:template match="ch.acirc"><xsl:text>â</xsl:text></xsl:template><!-- latin small letter a with circumflex, U+00E2 ISOlat1 -->
996 <xsl:template match="ch.atilde"><xsl:text>ã</xsl:text></xsl:template><!-- latin small letter a with tilde, U+00E3 ISOlat1 -->
997 <xsl:template match="ch.auml"><xsl:text>ä</xsl:text></xsl:template><!-- latin small letter a with diaeresis, U+00E4 ISOlat1 -->
998 <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 -->
999 <xsl:template match="ch.aelig"><xsl:text>æ</xsl:text></xsl:template><!-- latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 -->
1000 <xsl:template match="ch.ccedil"><xsl:text>ç</xsl:text></xsl:template><!-- latin small letter c with cedilla, U+00E7 ISOlat1 -->
1001 <xsl:template match="ch.egrave"><xsl:text>è</xsl:text></xsl:template><!-- latin small letter e with grave, U+00E8 ISOlat1 -->
1002 <xsl:template match="ch.eacute"><xsl:text>é</xsl:text></xsl:template><!-- latin small letter e with acute, U+00E9 ISOlat1 -->
1003 <xsl:template match="ch.ecirc"><xsl:text>ê</xsl:text></xsl:template><!-- latin small letter e with circumflex, U+00EA ISOlat1 -->
1004 <xsl:template match="ch.euml"><xsl:text>ë</xsl:text></xsl:template><!-- latin small letter e with diaeresis, U+00EB ISOlat1 -->
1005 <xsl:template match="ch.igrave"><xsl:text>ì</xsl:text></xsl:template><!-- latin small letter i with grave, U+00EC ISOlat1 -->
1006 <xsl:template match="ch.iacute"><xsl:text>í</xsl:text></xsl:template><!-- latin small letter i with acute, U+00ED ISOlat1 -->
1007 <xsl:template match="ch.icirc"><xsl:text>î</xsl:text></xsl:template><!-- latin small letter i with circumflex, U+00EE ISOlat1 -->
1008 <xsl:template match="ch.iuml"><xsl:text>ï</xsl:text></xsl:template><!-- latin small letter i with diaeresis, U+00EF ISOlat1 -->
1009 <xsl:template match="ch.eth"><xsl:text>ð</xsl:text></xsl:template><!-- latin small letter eth, U+00F0 ISOlat1 -->
1010 <xsl:template match="ch.ntilde"><xsl:text>ñ</xsl:text></xsl:template><!-- latin small letter n with tilde, U+00F1 ISOlat1 -->
1011 <xsl:template match="ch.ograve"><xsl:text>ò</xsl:text></xsl:template><!-- latin small letter o with grave, U+00F2 ISOlat1 -->
1012 <xsl:template match="ch.oacute"><xsl:text>ó</xsl:text></xsl:template><!-- latin small letter o with acute, U+00F3 ISOlat1 -->
1013 <xsl:template match="ch.ocirc"><xsl:text>ô</xsl:text></xsl:template><!-- latin small letter o with circumflex, U+00F4 ISOlat1 -->
1014 <xsl:template match="ch.otilde"><xsl:text>õ</xsl:text></xsl:template><!-- latin small letter o with tilde, U+00F5 ISOlat1 -->
1015 <xsl:template match="ch.ouml"><xsl:text>ö</xsl:text></xsl:template><!-- latin small letter o with diaeresis, U+00F6 ISOlat1 -->
1016 <xsl:template match="ch.divide"><xsl:text>÷</xsl:text></xsl:template><!-- division sign, U+00F7 ISOnum -->
1017 <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 -->
1018 <xsl:template match="ch.ugrave"><xsl:text>ù</xsl:text></xsl:template><!-- latin small letter u with grave, U+00F9 ISOlat1 -->
1019 <xsl:template match="ch.uacute"><xsl:text>ú</xsl:text></xsl:template><!-- latin small letter u with acute, U+00FA ISOlat1 -->
1020 <xsl:template match="ch.ucirc"><xsl:text>û</xsl:text></xsl:template><!-- latin small letter u with circumflex, U+00FB ISOlat1 -->
1021 <xsl:template match="ch.uuml"><xsl:text>ü</xsl:text></xsl:template><!-- latin small letter u with diaeresis, U+00FC ISOlat1 -->
1022 <xsl:template match="ch.yacute"><xsl:text>ý</xsl:text></xsl:template><!-- latin small letter y with acute, U+00FD ISOlat1 -->
1023 <xsl:template match="ch.thorn"><xsl:text>þ</xsl:text></xsl:template><!-- latin small letter thorn, U+00FE ISOlat1 -->
1024 <xsl:template match="ch.yuml"><xsl:text>ÿ</xsl:text></xsl:template><!-- latin small letter y with diaeresis, U+00FF ISOlat1 -->
1026 <!-- ~~~~~~~~~~~~~~~~~~~~~ Special Characters ~~~~~~~~~~~~~~~~~~~~ -->
1028 <xsl:template match="ch.ampersand">&</xsl:template><!-- ampersand -->
1029 <xsl:template match="ch.lsquot">'</xsl:template><!-- opening left quotation mark -->
1030 <xsl:template match="ch.rsquot">'</xsl:template><!-- closing right quotation mark -->
1031 <xsl:template match="ch.ldquot">"</xsl:template><!-- opening left double quotation mark -->
1032 <xsl:template match="ch.rdquot">"</xsl:template><!-- closing right double quotation mark -->
1033 <xsl:template match="ch.minus">-</xsl:template><!-- mathematical minus -->
1034 <xsl:template match="ch.endash">-</xsl:template><!-- endash -->
1035 <xsl:template match="ch.emdash">--</xsl:template><!-- emdash -->
1036 <xsl:template match="ch.ellips"> . . .</xsl:template><!-- ellipsis -->
1037 <xsl:template match="ch.lellips">. . . </xsl:template><!-- left ellipsis, used at the beginning of edited material -->
1038 <xsl:template match="ch.blankline">_______</xsl:template><!-- blank line to be filled in -->
1039 <xsl:template match="ch.percent"><xsl:text>%</xsl:text></xsl:template><!-- percent sign -->
1040 <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 -->
1041 <xsl:template match="ch.frac116"><xsl:text>1/16</xsl:text></xsl:template><!-- vulgar fraction one sixteenth = fraction on sixteenth -->
1042 <xsl:template match="ch.plus"><xsl:text>+</xsl:text></xsl:template><!-- mathematical plus -->
1044 <!-- ==================== named templates ======================= -->
1046 <xsl:template name="xhtml-wrapper">
1047 <xsl:param name="document-type">undefined</xsl:param>
1048 <xsl:param name="filename">undefined</xsl:param>
1049 <xsl:param name="glossary-id-prefix"></xsl:param>
1051 <!-- <redirect:write file="{$filename}.htm">-->
1052 <redirect:write file="{$filename}.htm">
1054 <xsl:text>xhtml-wrapper: Cannot write to filename: "</xsl:text>
1055 <xsl:value-of select="$filename" /><xsl:text>.htm"</xsl:text>
1058 <html xml:lang="en-UK" lang="en-UK">
1060 <xsl:value-of select="$newline" />
1061 <xsl:value-of select="$newline" />
1063 <head><xsl:value-of select="$newline" />
1065 <xsl:apply-templates select="/gamebook/meta/title[1]" />
1066 <xsl:text>: </xsl:text>
1068 <xsl:when test="$document-type='illustration'">
1070 <xsl:when test="$language='es'">
1071 <xsl:text>Ilustración </xsl:text>
1074 <xsl:text>Illustration </xsl:text>
1077 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
1079 <xsl:otherwise><xsl:apply-templates select="meta/title[1]" /></xsl:otherwise>
1081 </title><xsl:value-of select="$newline" />
1082 <meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" /><xsl:value-of select="$newline" />
1083 <meta name="robots" content="noindex,nofollow" /><xsl:value-of select="$newline" />
1084 <link rel="stylesheet" href="main.css" type="text/css" /><xsl:value-of select="$newline" />
1087 <xsl:value-of select="$newline" />
1088 <xsl:value-of select="$newline" />
1091 <xsl:text> </xsl:text>
1092 <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
1094 <xsl:when test="$language='es'">
1095 <xsl:text> Publicado por </xsl:text>
1098 <xsl:text> Published by </xsl:text>
1101 <xsl:apply-templates select="/gamebook/meta/publisher[1]" />
1102 <xsl:text>. </xsl:text>
1105 <xsl:value-of select="$newline" />
1106 <xsl:value-of select="$newline" />
1109 <xsl:attribute name="text"><xsl:value-of select="$text-color" /></xsl:attribute>
1110 <xsl:attribute name="bgcolor"><xsl:value-of select="$background-color" /></xsl:attribute>
1111 <xsl:attribute name="background"><xsl:text>bckgrnd.gif</xsl:text></xsl:attribute>
1112 <xsl:attribute name="link"><xsl:value-of select="$link-color" /></xsl:attribute>
1113 <xsl:attribute name="alink"><xsl:value-of select="$alink-color" /></xsl:attribute>
1114 <xsl:attribute name="vlink"><xsl:value-of select="$vlink-color" /></xsl:attribute>
1116 <xsl:value-of select="$newline" />
1117 <div id="title"><img src="title.gif" width="550" height="100" border="0" align="middle" usemap="#imagemap"><xsl:attribute name="alt"><xsl:apply-templates select="/gamebook/meta/title[1]" /></xsl:attribute></img></div><xsl:value-of select="$newline" />
1118 <div id="body"><xsl:value-of select="$newline" />
1122 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ top-level ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1124 <xsl:when test="$document-type='top-level'">
1125 <div class="frontmatter"><xsl:value-of select="$newline" />
1127 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
1128 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
1132 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
1136 <xsl:when test="$language='es'">
1137 <xsl:text>Fecha de Publicación: </xsl:text>
1140 <xsl:text>Publication Date: </xsl:text>
1143 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
1144 <xsl:text> </xsl:text>
1146 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
1148 <xsl:when test="$language='es'"><xsl:text>de enero de</xsl:text></xsl:when>
1149 <xsl:otherwise><xsl:text>January</xsl:text></xsl:otherwise>
1152 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
1154 <xsl:when test="$language='es'"><xsl:text>de febrero de</xsl:text></xsl:when>
1155 <xsl:otherwise><xsl:text>February</xsl:text></xsl:otherwise>
1158 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
1160 <xsl:when test="$language='es'"><xsl:text>de marzo de</xsl:text></xsl:when>
1161 <xsl:otherwise><xsl:text>March</xsl:text></xsl:otherwise>
1164 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
1166 <xsl:when test="$language='es'"><xsl:text>de abril de</xsl:text></xsl:when>
1167 <xsl:otherwise><xsl:text>April</xsl:text></xsl:otherwise>
1170 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
1172 <xsl:when test="$language='es'"><xsl:text>de mayo de</xsl:text></xsl:when>
1173 <xsl:otherwise><xsl:text>May</xsl:text></xsl:otherwise>
1176 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
1178 <xsl:when test="$language='es'"><xsl:text>de junio de</xsl:text></xsl:when>
1179 <xsl:otherwise><xsl:text>June</xsl:text></xsl:otherwise>
1182 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
1184 <xsl:when test="$language='es'"><xsl:text>de julio de</xsl:text></xsl:when>
1185 <xsl:otherwise><xsl:text>July</xsl:text></xsl:otherwise>
1188 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
1190 <xsl:when test="$language='es'"><xsl:text>de agosto de</xsl:text></xsl:when>
1191 <xsl:otherwise><xsl:text>August</xsl:text></xsl:otherwise>
1194 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
1196 <xsl:when test="$language='es'"><xsl:text>de septiembre de</xsl:text></xsl:when>
1197 <xsl:otherwise><xsl:text>September</xsl:text></xsl:otherwise>
1200 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
1202 <xsl:when test="$language='es'"><xsl:text>de octubre de</xsl:text></xsl:when>
1203 <xsl:otherwise><xsl:text>October</xsl:text></xsl:otherwise>
1206 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
1208 <xsl:when test="$language='es'"><xsl:text>de noviembre de</xsl:text></xsl:when>
1209 <xsl:otherwise><xsl:text>November</xsl:text></xsl:otherwise>
1212 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
1214 <xsl:when test="$language='es'"><xsl:text>de diciembre de</xsl:text></xsl:when>
1215 <xsl:otherwise><xsl:text>December</xsl:text></xsl:otherwise>
1219 <xsl:text>Invalid Month</xsl:text>
1222 <xsl:text> </xsl:text>
1223 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
1226 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
1228 <xsl:value-of select="$newline" />
1230 <xsl:call-template name="navigation-bar" />
1232 <xsl:value-of select="$newline" />
1233 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1237 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ toc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1239 <xsl:when test="$document-type='toc'">
1240 <div class="frontmatter"><xsl:value-of select="$newline" />
1243 <xsl:when test="$language='es'">
1244 <xsl:text>Índice de Contenidos</xsl:text>
1247 <xsl:text>Table of Contents</xsl:text>
1250 </h2><xsl:value-of select="$newline" />
1252 <xsl:value-of select="$newline" />
1253 <xsl:value-of select="$newline" />
1255 <ul><xsl:value-of select="$newline" />
1256 <xsl:variable name="title-page">
1258 <xsl:when test="$language='es'">
1259 <xsl:text>Página Principal</xsl:text>
1262 <xsl:text>Title Page</xsl:text>
1267 <li><a href="title.htm"><xsl:value-of select="$title-page"/></a></li><xsl:value-of select="$newline" />
1268 <xsl:for-each select="/gamebook/section/data/section">
1270 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1271 <xsl:apply-templates select="meta/title[1]" />
1273 <xsl:if test="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
1274 <xsl:value-of select="$newline" />
1275 <ul><xsl:value-of select="$newline" />
1276 <xsl:for-each select="data/section[@class='frontmatter-separate' or @class='mainmatter-separate']">
1278 <a><xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1279 <xsl:value-of select ="meta/title[1]" />
1281 </li><xsl:value-of select="$newline" />
1283 </ul><xsl:value-of select="$newline" />
1285 </li><xsl:value-of select="$newline" />
1287 </ul><xsl:value-of select="$newline" />
1289 <xsl:value-of select="$newline" />
1290 <xsl:value-of select="$newline" />
1291 <xsl:call-template name="navigation-bar" />
1292 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1295 <!-- ~~~~~~~~~~~~~~~~ second-level-frontmatter ~~~~~~~~~~~~~~~~~~~ -->
1297 <xsl:when test="$document-type='second-level-frontmatter'">
1298 <div class="frontmatter"><xsl:value-of select="$newline" />
1299 <h2><xsl:apply-templates select="meta/title" /></h2><xsl:value-of select="$newline" />
1301 <xsl:value-of select="$newline" />
1303 <xsl:apply-templates />
1305 <xsl:value-of select="$newline" />
1307 <xsl:call-template name="navigation-bar" />
1309 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1312 <!-- ~~~~~~~~~~~~~ third-level-frontmatter-separate ~~~~~~~~~~~~~~ -->
1314 <xsl:when test="$document-type='third-level-frontmatter-separate'">
1315 <div class="frontmatter"><xsl:value-of select="$newline" />
1316 <h3><xsl:apply-templates select="meta/title" /></h3><xsl:value-of select="$newline" />
1317 <xsl:value-of select="$newline" />
1319 <xsl:apply-templates />
1321 <xsl:value-of select="$newline" />
1323 <xsl:call-template name="navigation-bar" />
1325 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1328 <!-- ~~~~~~~~~~~~~~~~ second-level-mainmatter ~~~~~~~~~~~~~~~~~~~ -->
1330 <xsl:when test="$document-type='second-level-mainmatter'">
1331 <div class="mainmatter"><xsl:value-of select="$newline" />
1332 <h2><xsl:apply-templates select="meta/title" /></h2><xsl:value-of select="$newline" />
1333 <xsl:value-of select="$newline" />
1335 <xsl:apply-templates />
1337 <xsl:value-of select="$newline" />
1339 <xsl:call-template name="navigation-bar" />
1341 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1344 <!-- ~~~~~~~~~~~~~ third-level-mainmatter-separate ~~~~~~~~~~~~~~ -->
1346 <xsl:when test="$document-type='third-level-mainmatter-separate'">
1347 <div class="mainmatter"><xsl:value-of select="$newline" />
1348 <h3><xsl:apply-templates select="meta/title" /></h3><xsl:value-of select="$newline" />
1349 <xsl:value-of select="$newline" />
1351 <xsl:apply-templates />
1353 <xsl:value-of select="$newline" />
1355 <xsl:call-template name="navigation-bar" />
1357 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1360 <!-- ~~~~~~~~~~~~~~~~ second-level-glossary ~~~~~~~~~~~~~~~~~~~ -->
1362 <xsl:when test="$document-type='second-level-glossary'">
1363 <div class="mainmatter"><xsl:value-of select="$newline" />
1364 <h2><xsl:apply-templates select="meta/title" /></h2><xsl:value-of select="$newline" />
1365 <xsl:value-of select="$newline" />
1367 <xsl:apply-templates />
1369 <xsl:value-of select="$newline" />
1371 <xsl:call-template name="alpha-bar">
1372 <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
1373 </xsl:call-template>
1375 <xsl:call-template name="navigation-bar" />
1377 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1380 <!-- ~~~~~~~~~~~~~ third-level-glossary-separate ~~~~~~~~~~~~~~ -->
1382 <xsl:when test="$document-type='third-level-glossary-separate'">
1383 <div class="glossary"><xsl:value-of select="$newline" />
1384 <h3><xsl:apply-templates select="meta/title" /></h3><xsl:value-of select="$newline" />
1385 <xsl:call-template name="alpha-bar">
1386 <xsl:with-param name="alpha-bar-id-prefix"><xsl:value-of select="$glossary-id-prefix" /></xsl:with-param>
1387 </xsl:call-template>
1389 <xsl:value-of select="$newline" />
1391 <xsl:apply-templates />
1393 <xsl:value-of select="$newline" />
1395 <xsl:call-template name="navigation-bar" />
1396 <xsl:value-of select="$newline" />
1397 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1400 <!-- ~~~~~~~~~~~~~~~~~~ second-level-numbered ~~~~~~~~~~~~~~~~~~~~ -->
1403 The following automatically generated section list requires that the
1404 title of each section be a simple number.
1407 <xsl:when test="$document-type='second-level-numbered'">
1408 <div class="numbered"><xsl:value-of select="$newline" />
1409 <h2><xsl:apply-templates select="meta/title" /></h2><xsl:value-of select="$newline" />
1410 <xsl:value-of select="$newline" />
1412 <xsl:variable name="base-section-number" select="number( data/section[1]/meta/title ) - 1" />
1414 <xsl:for-each select="data/section">
1415 <xsl:if test="position( ) mod 10 = 1">
1416 <b><a><xsl:attribute name="name"><xsl:value-of select="position( ) + $base-section-number" /></xsl:attribute>
1417 <xsl:value-of select="position( ) + $base-section-number" />
1418 <xsl:if test="not( position( ) = last( ) )">
1419 <xsl:text>-</xsl:text>
1421 <xsl:when test="position( ) + 9 <= last( )">
1422 <xsl:value-of select="position( ) + 9 + $base-section-number" />
1425 <xsl:value-of select="last( ) + $base-section-number" />
1429 </a><xsl:text>: </xsl:text></b>
1432 <xsl:attribute name="href"><xsl:value-of select="@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1433 <xsl:apply-templates select="meta/title" />
1436 <xsl:when test="position( ) mod 10 = 0">
1437 <br /><xsl:value-of select="$newline" />
1440 <xsl:text> </xsl:text>
1446 <xsl:value-of select="$newline" />
1447 <xsl:value-of select="$newline" />
1449 <xsl:call-template name="navigation-bar" />
1450 <xsl:value-of select="$newline" />
1451 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1454 <!-- ~~~~~~~~~~~~~~~~~~ third-level-numbered ~~~~~~~~~~~~~~~~~~~~~ -->
1456 <xsl:when test="$document-type='third-level-numbered'">
1457 <div class="numbered"><xsl:value-of select="$newline" />
1458 <h3><xsl:apply-templates select="meta/title" /></h3><xsl:value-of select="$newline" />
1459 <xsl:value-of select="$newline" />
1461 <xsl:apply-templates />
1463 <xsl:value-of select="$newline" />
1464 <xsl:call-template name="navigation-bar" />
1465 <xsl:value-of select="$newline" />
1469 <!-- ~~~~~~~~~~~~~~~~~ footnotes ~~~~~~~~~~~~~~~~~~~ -->
1471 <xsl:when test="$document-type='footnotz'">
1472 <div class="backmatter">
1473 <xsl:value-of select="$newline" />
1474 <!-- No particular reason to code title here -->
1475 <h2><xsl:apply-templates select="meta/title" /></h2><xsl:value-of select="$newline" />
1476 <xsl:value-of select="$newline" />
1477 <xsl:value-of select="$newline" />
1479 <!-- Generate list of footnotes -->
1480 <xsl:for-each select="//footnotes/footnote">
1481 <div class="footnote">
1482 <!-- will the list always contain the closest ancestor first? -->
1483 <xsl:variable name="footnote-section"><xsl:value-of select="ancestor::section[position()=1]/@id" /></xsl:variable>
1484 <xsl:variable name="footnote-marker"><xsl:number count="footnotes/footnote" from="/" level="any" format="1" /></xsl:variable>
1485 <xsl:variable name="footnote-idref"><xsl:value-of select="@idref" /></xsl:variable>
1487 <xsl:for-each select="*[1]">
1489 <xsl:text>[</xsl:text>
1491 <xsl:attribute name="href"><xsl:value-of select="$footnote-section" /><xsl:text>.htm#</xsl:text><xsl:value-of select="$footnote-idref" /></xsl:attribute>
1492 <xsl:value-of select="$footnote-marker" />
1494 <xsl:text>] </xsl:text>
1496 <xsl:text> (</xsl:text>
1497 <xsl:call-template name="section-title-link" />
1498 <xsl:text>) </xsl:text>
1500 <xsl:apply-templates select="child::* | child::text()" />
1504 <xsl:for-each select="*[position() != 1]">
1505 <xsl:apply-templates select="." />
1511 <!-- Backwards compatibility... needed? Probably not. -->
1512 <xsl:apply-templates />
1514 <xsl:value-of select="$newline" />
1516 <xsl:call-template name="navigation-bar" />
1517 <xsl:value-of select="$newline" />
1518 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1521 <!-- ~~~~~~~~~~~~~~~~~ second-level-backmatter ~~~~~~~~~~~~~~~~~~~ -->
1523 <xsl:when test="$document-type='second-level-backmatter'">
1524 <div class="frontmatter"><xsl:value-of select="$newline" />
1525 <h2><xsl:apply-templates select="meta/title" /></h2><xsl:value-of select="$newline" />
1527 <xsl:value-of select="$newline" />
1528 <xsl:value-of select="$newline" />
1530 <xsl:apply-templates />
1532 <xsl:value-of select="$newline" />
1534 <xsl:call-template name="navigation-bar" />
1535 <xsl:value-of select="$newline" />
1536 </div><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1539 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ map-adjusted ~~~~~~~~~~~~~~~~~~~~~~~~ -->
1541 <xsl:when test="$document-type='map-adjusted'">
1542 <div class="frontmatter"><xsl:value-of select="$newline" />
1543 <h2><xsl:apply-templates select="meta/title" /></h2><xsl:value-of select="$newline" />
1545 <xsl:value-of select="$newline" />
1546 <xsl:value-of select="$newline" />
1548 <xsl:for-each select="data/* | data/text()">
1549 <xsl:variable name="map-illustration-alt-text">
1551 <xsl:when test="$language='es'">
1552 <xsl:text>mapa</xsl:text>
1555 <xsl:text>map</xsl:text>
1560 <!-- duplicated stuff here, no good way to avoid this while retaining backwards compatibility -->
1562 <xsl:when test="self::illustration and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1563 <xsl:variable name="illustration-width" select="instance[@class='html-compatible']/@width" />
1564 <xsl:variable name="illustration-height" select="instance[@class='html-compatible']/@height" />
1565 <xsl:variable name="illustration-src" select="instance[@class='html-compatible']/@src" />
1567 <xsl:variable name="illustration-width-adjusted"><xsl:number value="386" /></xsl:variable>
1568 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height * $illustration-width-adjusted div $illustration-width" /></xsl:variable>
1570 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1571 <xsl:call-template name="illustration-framed">
1572 <xsl:with-param name="illustration-width"><xsl:value-of select="$illustration-width-adjusted" /></xsl:with-param>
1573 <xsl:with-param name="illustration-height"><xsl:value-of select="$illustration-height-adjusted" /></xsl:with-param>
1574 <xsl:with-param name="illustration-src"><xsl:value-of select="$illustration-src" /></xsl:with-param>
1575 <xsl:with-param name="illustration-href">maplarge.htm</xsl:with-param>
1576 <xsl:with-param name="illustration-alt-text">
1577 <xsl:text>[</xsl:text>
1578 <xsl:value-of select="$map-illustration-alt-text"/>
1579 <xsl:text>]</xsl:text>
1581 </xsl:call-template>
1583 </div></div><xsl:value-of select="$newline" />
1585 <xsl:if test="instance[@class='text']">
1586 <xsl:apply-templates select="instance[@class='text']/*"/>
1590 <xsl:when test="self::illref and @class='html-compatible'">
1591 <xsl:for-each select="id( @idref )">
1592 <xsl:if test="contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1593 <xsl:variable name="illustration-width" select="instance[@class='html-compatible']/@width" />
1594 <xsl:variable name="illustration-height" select="instance[@class='html-compatible']/@height" />
1595 <xsl:variable name="illustration-src" select="instance[@class='html-compatible']/@src" />
1597 <xsl:variable name="illustration-width-adjusted"><xsl:number value="386" /></xsl:variable>
1598 <xsl:variable name="illustration-height-adjusted"><xsl:number value="$illustration-height * $illustration-width-adjusted div $illustration-width" /></xsl:variable>
1600 <div class="illustration">
1601 <div align="center"><xsl:value-of select="$newline" />
1602 <xsl:call-template name="illustration-framed">
1603 <xsl:with-param name="illustration-width"><xsl:value-of select="$illustration-width-adjusted" /></xsl:with-param>
1604 <xsl:with-param name="illustration-height"><xsl:value-of select="$illustration-height-adjusted" /></xsl:with-param>
1605 <xsl:with-param name="illustration-src"><xsl:value-of select="$illustration-src" /></xsl:with-param>
1606 <xsl:with-param name="illustration-href">maplarge.htm</xsl:with-param>
1607 <xsl:with-param name="illustration-alt-text">
1608 <xsl:text>[</xsl:text>
1609 <xsl:value-of select="$map-illustration-alt-text"/>
1610 <xsl:text>]</xsl:text>
1612 </xsl:call-template>
1614 </div></div><xsl:value-of select="$newline" />
1616 <xsl:if test="instance[@class='text']">
1617 <xsl:apply-templates select="instance[@class='text']/*"/>
1624 <xsl:apply-templates select="." />
1629 <xsl:value-of select="$newline" />
1631 <xsl:call-template name="navigation-bar" />
1632 <xsl:value-of select="$newline" />
1636 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1638 <xsl:when test="$document-type='map'">
1639 <div class="frontmatter"><xsl:value-of select="$newline" />
1640 <h2><xsl:apply-templates select="meta/title" /></h2><xsl:value-of select="$newline" />
1642 <xsl:value-of select="$newline" />
1643 <xsl:value-of select="$newline" />
1645 <xsl:for-each select="data/* | data/text()">
1646 <xsl:variable name="map-illustration-alt-text">
1648 <xsl:when test="$language='es'">
1649 <xsl:text>mapa</xsl:text>
1652 <xsl:text>map</xsl:text>
1657 <!-- duplicated stuff here, no good way to avoid this while retaining backwards compatibility -->
1659 <xsl:when test="self::illustration and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1660 <xsl:variable name="illustration-width" select="instance[@class='html-compatible']/@width" />
1661 <xsl:variable name="illustration-height" select="instance[@class='html-compatible']/@height" />
1662 <xsl:variable name="illustration-src" select="instance[@class='html-compatible']/@src" />
1664 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1665 <xsl:call-template name="illustration-framed">
1666 <xsl:with-param name="illustration-width"><xsl:value-of select="$illustration-width" /></xsl:with-param>
1667 <xsl:with-param name="illustration-height"><xsl:value-of select="$illustration-height" /></xsl:with-param>
1668 <xsl:with-param name="illustration-src"><xsl:value-of select="$illustration-src" /></xsl:with-param>
1669 <xsl:with-param name="illustration-href">map.htm</xsl:with-param>
1670 <xsl:with-param name="illustration-alt-text">
1671 <xsl:text>[</xsl:text>
1672 <xsl:value-of select="$map-illustration-alt-text"/>
1673 <xsl:text>]</xsl:text>
1675 </xsl:call-template>
1676 <br /><xsl:value-of select="$newline" />
1677 </div></div><xsl:value-of select="$newline" />
1680 <xsl:when test="self::illref and @class='html-compatible'">
1681 <xsl:for-each select="id( @idref )">
1682 <xsl:if test="contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
1683 <xsl:variable name="illustration-width" select="instance[@class='html-compatible']/@width" />
1684 <xsl:variable name="illustration-height" select="instance[@class='html-compatible']/@height" />
1685 <xsl:variable name="illustration-src" select="instance[@class='html-compatible']/@src" />
1687 <div class="illustration">
1688 <div align="center"><xsl:value-of select="$newline" />
1689 <xsl:call-template name="illustration-framed">
1690 <xsl:with-param name="illustration-width"><xsl:value-of select="$illustration-width" /></xsl:with-param>
1691 <xsl:with-param name="illustration-height"><xsl:value-of select="$illustration-height" /></xsl:with-param>
1692 <xsl:with-param name="illustration-src"><xsl:value-of select="$illustration-src" /></xsl:with-param>
1693 <xsl:with-param name="illustration-href">map.htm</xsl:with-param>
1694 <xsl:with-param name="illustration-alt-text">
1695 <xsl:text>[</xsl:text>
1696 <xsl:value-of select="$map-illustration-alt-text"/>
1697 <xsl:text>]</xsl:text>
1699 </xsl:call-template>
1700 <br /><xsl:value-of select="$newline" />
1701 </div></div><xsl:value-of select="$newline" />
1706 <xsl:apply-templates select="." />
1711 <xsl:value-of select="$newline" />
1713 <xsl:call-template name="navigation-bar" />
1714 <xsl:value-of select="$newline" />
1718 <!-- ~~~~~~~~~~~~~~~~~~~~~~ illustration ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1720 <xsl:when test="$document-type='illustration'">
1721 <xsl:variable name="illustration-width" select="instance[@class='html-compatible']/@width" />
1722 <xsl:variable name="illustration-height" select="instance[@class='html-compatible']/@height" />
1723 <xsl:variable name="illustration-src" select="instance[@class='html-compatible']/@src" />
1727 <xsl:when test="$language='es'">
1728 <xsl:text>Ilustración </xsl:text>
1731 <xsl:text>Illustration </xsl:text>
1734 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
1735 </h3><xsl:value-of select="$newline" />
1737 <div class="illustration"><div align="center"><xsl:value-of select="$newline" />
1738 <xsl:call-template name="illustration-framed">
1739 <xsl:with-param name="illustration-width"><xsl:value-of select="$illustration-width" /></xsl:with-param>
1740 <xsl:with-param name="illustration-height"><xsl:value-of select="$illustration-height" /></xsl:with-param>
1741 <xsl:with-param name="illustration-src"><xsl:value-of select="$illustration-src" /></xsl:with-param>
1742 </xsl:call-template>
1743 <br /><xsl:value-of select="$newline" />
1744 </div></div><xsl:value-of select="$newline" />
1745 <p class="caption"><strong><xsl:apply-templates select="meta/description" /></strong></p><xsl:value-of select="$newline" />
1748 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1752 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1753 <xsl:value-of select="$document-type" />
1754 <xsl:text>".</xsl:text>
1757 <xsl:text>xhtml-wrapper: Cannot process document of type "</xsl:text>
1758 <xsl:value-of select="$document-type" />
1759 <xsl:text>".</xsl:text>
1765 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
1767 <xsl:call-template name="process-footnotes" />
1769 <p class="copyright"><xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" /></p><xsl:value-of select="$newline" /><xsl:value-of select="$newline" />
1771 </div><xsl:value-of select="$newline" />
1773 <map name="imagemap" id="imagemap">
1774 <area shape="rect" coords="0,0,99,99" href="http://www.projectaon.org/" alt="Project Aon" target="_top" />
1775 <area shape="default" href="title.htm">
1776 <xsl:attribute name="alt"><xsl:apply-templates select="/gamebook/meta/title[1]" /></xsl:attribute>
1782 <xsl:value-of select="$newline" />
1783 <xsl:value-of select="$newline" />
1790 <xsl:template name="process-footnotes">
1791 <xsl:if test="footnotes/footnote">
1792 <div id="footnotes"><xsl:value-of select="$newline" />
1793 <xsl:for-each select="footnotes/footnote">
1794 <xsl:variable name="footnote-idref" select="@idref" />
1795 <xsl:variable name="footnote-id" select="@id" />
1796 <xsl:variable name="footnote-marker"><xsl:number count="footnotes/footnote" from="/" level="any" format="1" /></xsl:variable>
1798 <xsl:for-each select="*[1]">
1800 <xsl:text>[</xsl:text>
1801 <a href="#{$footnote-idref}" name="{$footnote-id}"><xsl:value-of select="$footnote-marker" /></a>
1802 <xsl:text>] </xsl:text>
1803 <xsl:apply-templates select="child::* | child::text()" />
1807 <xsl:for-each select="*[position() != 1]">
1808 <xsl:apply-templates select="." />
1811 </div><xsl:value-of select="$newline" />
1815 <xsl:template name="navigation-bar">
1816 <xsl:variable name="table-of-contents">
1818 <xsl:when test="$language='es'">
1819 <xsl:text>Índice de Contenidos</xsl:text>
1822 <xsl:text>Table of Contents</xsl:text>
1826 <div class="navigation">
1827 <table cellspacing="0" cellpadding="0" border="0">
1831 <xsl:when test="meta/link[@class='prev']">
1833 <xsl:attribute name="href">
1834 <xsl:apply-templates select="meta/link[@class='prev']/@idref" />
1835 <xsl:text>.htm</xsl:text>
1837 <img src="back.gif" width="150" height="30" border="0">
1838 <xsl:attribute name="alt">
1839 <xsl:value-of select="id( meta/link[@class='prev']/@idref )/meta/title" />
1845 <img src="left.gif" width="150" height="30" border="0" alt="" />
1849 <td><a href="toc.htm"><img src="toc.gif" width="150" height="30" border="0" alt="{$table-of-contents}" /></a></td>
1852 <xsl:when test="meta/link[@class='next']">
1854 <xsl:attribute name="href">
1855 <xsl:value-of select="meta/link[@class='next']/@idref" />
1856 <xsl:text>.htm</xsl:text>
1858 <img src="forward.gif" width="150" height="30" border="0">
1859 <xsl:attribute name="alt">
1861 <xsl:when test="meta/link[@class='next']/@idref = 'sect1'">
1863 <xsl:when test="$language='es'">
1864 <xsl:text>Sección 1</xsl:text>
1867 <xsl:text>Section 1</xsl:text>
1872 <xsl:value-of select="id( meta/link[@class='next']/@idref )/meta/title" />
1880 <img src="right.gif" width="150" height="30" border="0" alt="" />
1889 <xsl:template name="alpha-bar">
1890 <xsl:param name="alpha-bar-id-prefix"></xsl:param>
1892 <p class="navigation">[<a href="{$alpha-bar-id-prefix}a.htm">A</a> <a href="{$alpha-bar-id-prefix}b.htm">B</a> <a href="{$alpha-bar-id-prefix}c.htm">C</a> <a href="{$alpha-bar-id-prefix}d.htm">D</a> <a href="{$alpha-bar-id-prefix}e.htm">E</a> <a href="{$alpha-bar-id-prefix}f.htm">F</a> <a href="{$alpha-bar-id-prefix}g.htm">G</a> <a href="{$alpha-bar-id-prefix}h.htm">H</a> <a href="{$alpha-bar-id-prefix}i.htm">I</a> <a href="{$alpha-bar-id-prefix}j.htm">J</a> <a href="{$alpha-bar-id-prefix}k.htm">K</a> <a href="{$alpha-bar-id-prefix}l.htm">L</a> <a href="{$alpha-bar-id-prefix}m.htm">M</a> <a href="{$alpha-bar-id-prefix}n.htm">N</a> <a href="{$alpha-bar-id-prefix}o.htm">O</a> <a href="{$alpha-bar-id-prefix}p.htm">P</a> <a href="{$alpha-bar-id-prefix}q.htm">Q</a> <a href="{$alpha-bar-id-prefix}r.htm">R</a> <a href="{$alpha-bar-id-prefix}s.htm">S</a> <a href="{$alpha-bar-id-prefix}t.htm">T</a> <a href="{$alpha-bar-id-prefix}u.htm">U</a> <a href="{$alpha-bar-id-prefix}v.htm">V</a> <a href="{$alpha-bar-id-prefix}w.htm">W</a> <a href="{$alpha-bar-id-prefix}x.htm">X</a> <a href="{$alpha-bar-id-prefix}y.htm">Y</a> <a href="{$alpha-bar-id-prefix}z.htm">Z</a>]</p><xsl:value-of select="$newline" />
1896 <xsl:template name="illustration-framed">
1897 <xsl:param name="brdrl-width">32</xsl:param>
1898 <xsl:param name="brdr-height">32</xsl:param>
1899 <xsl:param name="brdrr-width">32</xsl:param>
1900 <xsl:param name="illustration-alt-text">
1902 <xsl:when test="$language='es'">
1903 <xsl:text>ilustración</xsl:text>
1906 <xsl:text>illustration</xsl:text>
1911 <xsl:param name="illustration-width"></xsl:param>
1912 <xsl:param name="illustration-height"></xsl:param>
1913 <xsl:param name="illustration-src"></xsl:param>
1914 <xsl:param name="illustration-href"></xsl:param>
1916 <table border="0" cellpadding="0" cellspacing="0">
1917 <xsl:value-of select="$newline" />
1919 <xsl:value-of select="$newline" />
1920 <td><img src="brdrtpl.gif" width="{$brdrl-width}" height="{$brdr-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1921 <td><img src="brdrtp.gif" width="{$illustration-width}" height="{$brdr-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1922 <td><img src="brdrtpr.gif" width="{$brdrr-width}" height="{$brdr-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1923 </tr><xsl:value-of select="$newline" />
1925 <xsl:value-of select="$newline" />
1926 <td><img src="brdrl.gif" width="{$brdrl-width}" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1929 <xsl:when test="$illustration-href">
1930 <a href="{$illustration-href}">
1931 <img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" align="middle" border="0" alt="{$illustration-alt-text}" />
1935 <img src="{$illustration-src}" width="{$illustration-width}" height="{$illustration-height}" align="middle" border="0" alt="[{$illustration-alt-text}]" />
1938 </td><xsl:value-of select="$newline" />
1939 <td><img src="brdrr.gif" width="{$brdrr-width}" height="{$illustration-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1940 </tr><xsl:value-of select="$newline" />
1942 <xsl:value-of select="$newline" />
1943 <td><img src="brdrbtl.gif" width="{$brdrl-width}" height="{$brdr-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1944 <td><img src="brdrbt.gif" width="{$illustration-width}" height="{$brdr-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1945 <td><img src="brdrbtr.gif" width="{$brdrr-width}" height="{$brdr-height}" align="middle" alt="" /></td><xsl:value-of select="$newline" />
1946 </tr><xsl:value-of select="$newline" />
1947 </table><xsl:value-of select="$newline" />
1951 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.
1953 <xsl:template name="section-title-link">
1954 <!-- will the list always contain the closest ancestor first? -->
1955 <xsl:variable name="section-title">
1956 <!-- numbered or not? -->
1957 <xsl:if test="ancestor::section[position()=1]/@class='numbered'">
1959 <xsl:when test="$language='es'">
1960 <xsl:text>Sección </xsl:text>
1963 <xsl:text>Section </xsl:text>
1967 <xsl:apply-templates select="ancestor::section[position()=1]/meta/title[1]" />
1971 <xsl:attribute name="href"><xsl:value-of select="ancestor::section[position()=1]/@id" /><xsl:text>.htm</xsl:text></xsl:attribute>
1972 <xsl:value-of select="$section-title" />