2 <!DOCTYPE xsl:transform [
3 <!ENTITY % pml.characters SYSTEM "pmlchar.mod">
12 Revision 1.1 2005/01/30 01:32:52 jonathan.blake
13 Initial freepository revision of XML support documents.
15 Revision 1.2 2003/01/07 16:55:28 jblake
16 Restarted work from base xhtml.xsl.
21 <xsl:transform version="1.0"
22 xmlns="http://www.w3.org/1999/xhtml"
23 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
24 xmlns:lxslt="http://xml.apache.org/xslt">
26 <xsl:output method="text" encoding="ISO-8859-1" />
28 <xsl:strip-space elements="gamebook section meta data ol ul dl li dd footnotes footnote illustration instance" />
29 <xsl:preserve-space elements="p choice" />
31 <!-- ====================== parameters ========================== -->
33 <xsl:param name="use-illustrators" />
35 <!-- ======================= variables ========================== -->
37 <xsl:variable name="newline">
42 <xsl:variable name="newparagraph">
43 <xsl:value-of select="$newline" />
44 <xsl:value-of select="$newline" />
47 <xsl:variable name="newpage">
48 <xsl:value-of select="$newline" />
49 <xsl:text>\p</xsl:text>
52 <!-- ======================== Templates ========================= -->
54 <!-- ================= hierarchical sections ==================== -->
56 <xsl:template match="meta" />
58 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
60 <xsl:template match="/gamebook/section[@id='title']">
61 <xsl:text>\vTITLE="</xsl:text><xsl:value-of select="/gamebook/meta/title" /><xsl:text>"\v</xsl:text>
62 <xsl:value-of select="$newline" />
63 <xsl:value-of select="$newline" />
65 <xsl:text>\X0\l\B</xsl:text>
66 <xsl:text>\c</xsl:text>
67 <xsl:value-of select="/gamebook/meta/title" />
68 <xsl:value-of select="$newline" />
69 <xsl:text>\c</xsl:text>
70 <xsl:text>\B\l\X0</xsl:text>
71 <xsl:value-of select="$newparagraph" />
73 <xsl:text>\c</xsl:text>
74 <xsl:apply-templates select="/gamebook/meta/creator[@class='medium']" />
75 <xsl:value-of select="$newline" />
76 <xsl:text>\c</xsl:text>
78 <xsl:value-of select="$newpage" />
80 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
82 <xsl:value-of select="$newparagraph" />
83 <xsl:text>Publication Date: </xsl:text>
84 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
85 <xsl:text> </xsl:text>
87 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
88 <xsl:text>January</xsl:text>
90 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
91 <xsl:text>February</xsl:text>
93 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
94 <xsl:text>March</xsl:text>
96 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
97 <xsl:text>April</xsl:text>
99 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
100 <xsl:text>May</xsl:text>
102 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
103 <xsl:text>June</xsl:text>
105 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
106 <xsl:text>July</xsl:text>
108 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
109 <xsl:text>August</xsl:text>
111 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
112 <xsl:text>September</xsl:text>
114 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
115 <xsl:text>October</xsl:text>
117 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
118 <xsl:text>November</xsl:text>
120 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
121 <xsl:text>December</xsl:text>
124 <xsl:text>Invalid Month</xsl:text>
127 <xsl:text> </xsl:text>
129 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
131 <xsl:value-of select="$newparagraph" />
132 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
134 <xsl:if test="data/section[@class='frontmatter']">
135 <xsl:apply-templates select="data/section[@class='frontmatter']" />
138 <xsl:if test="data/section[@class='mainmatter']">
139 <xsl:apply-templates select="data/section[@class='mainmatter']" />
142 <xsl:if test="data/section[@class='numbered']">
143 <xsl:apply-templates select="data/section[@class='numbered']" />
146 <xsl:if test="data/section[@class='backmatter']">
147 <xsl:apply-templates select="data/section[@class='backmatter']" />
150 <xsl:for-each select="//footnote">
151 <xsl:value-of select="$newparagraph" />
152 <xsl:text><footnote id="</xsl:text><xsl:value-of select="@id" /><xsl:text>"></xsl:text>
153 <xsl:text>[</xsl:text><xsl:number count="footnote" from="/" level="any" format="1" /><xsl:text>]</xsl:text>
154 <xsl:apply-templates />
155 <xsl:text></footnote></xsl:text>
160 <xsl:template match="/gamebook/section[@id='toc']" />
162 <xsl:template match="section" />
164 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
166 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
167 <xsl:value-of select="$newpage" />
169 <xsl:text>\X1\l\B\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
170 <xsl:value-of select="meta/title" />
171 <xsl:text>\B\l\X1</xsl:text>
172 <xsl:value-of select="$newparagraph" />
174 <xsl:apply-templates />
177 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
179 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
180 <xsl:value-of select="$newpage" />
181 <xsl:text>\X2\l\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
182 <xsl:value-of select="meta/title" />
183 <xsl:text>\l\X2</xsl:text>
184 <xsl:value-of select="$newparagraph" />
186 <xsl:apply-templates />
189 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
190 <xsl:text>\l\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
191 <xsl:value-of select="meta/title" />
192 <xsl:text>\l</xsl:text>
193 <xsl:value-of select="$newparagraph" />
195 <xsl:apply-templates />
196 <xsl:if test="following-sibling::node( )">
197 <xsl:value-of select="$newparagraph" />
201 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
203 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
204 <xsl:text>\B\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
205 <xsl:value-of select="meta/title" />
206 <xsl:text>\B</xsl:text>
207 <xsl:value-of select="$newparagraph" />
209 <xsl:apply-templates />
210 <xsl:if test="following-sibling::node( )">
211 <xsl:value-of select="$newparagraph" />
215 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
217 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
218 <xsl:text>\Q{</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
219 <xsl:value-of select="meta/title" />
220 <xsl:value-of select="$newparagraph" />
222 <xsl:apply-templates />
223 <xsl:if test="following-sibling::node( )">
224 <xsl:value-of select="$newparagraph" />
228 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
230 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
231 <xsl:value-of select="$newpage" />
232 <xsl:text>\X1\l\B\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
233 <xsl:value-of select="meta/title" />
234 <xsl:text>\B\l\X1</xsl:text>
235 <xsl:value-of select="$newparagraph" />
237 <xsl:apply-templates />
240 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
242 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter-separate']">
243 <xsl:value-of select="$newpage" />
244 <xsl:text>\X2\l\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
245 <xsl:value-of select="meta/title" />
246 <xsl:text>\l\X2</xsl:text>
247 <xsl:value-of select="$newparagraph" />
249 <xsl:apply-templates />
252 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter']">
253 <xsl:text>\l\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
254 <xsl:value-of select="meta/title" />
255 <xsl:text>\l</xsl:text>
256 <xsl:value-of select="$newparagraph" />
258 <xsl:apply-templates />
259 <xsl:if test="following-sibling::node( )">
260 <xsl:value-of select="$newparagraph" />
264 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
266 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter-separate']">
267 <xsl:text>\B\Q="</xsl:text><xsl:value-of select="@id" />><xsl:text>"</xsl:text>
268 <xsl:value-of select="meta/title" />
269 <xsl:text>\B</xsl:text>
270 <xsl:value-of select="$newparagraph" />
272 <xsl:apply-templates />
273 <xsl:if test="following-sibling::node( )">
274 <xsl:value-of select="$newparagraph" />
278 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter']">
279 <xsl:text>\B\Q="</xsl:text><xsl:value-of select="@id" />><xsl:text>"</xsl:text>
280 <xsl:value-of select="meta/title" />
281 <xsl:text>\B</xsl:text>
282 <xsl:value-of select="$newparagraph" />
284 <xsl:apply-templates />
285 <xsl:if test="following-sibling::node( )">
286 <xsl:value-of select="$newparagraph" />
290 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
292 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
293 <xsl:text>\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
294 <xsl:value-of select="meta/title" />
295 <xsl:value-of select="$newparagraph" />
297 <xsl:apply-templates />
298 <xsl:if test="following-sibling::node( )">
299 <xsl:value-of select="$newparagraph" />
303 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
304 <!-- Glossary sections should be contained in a second level section. -->
306 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary-separate']">
307 <xsl:value-of select="$newpage" />
308 <xsl:text>\X2\l\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
309 <xsl:value-of select="meta/title" />
310 <xsl:text>\l\X2</xsl:text>
311 <xsl:value-of select="$newparagraph" />
313 <xsl:apply-templates />
316 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary']">
317 <xsl:text>\l\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
318 <xsl:value-of select="meta/title" />
319 <xsl:text>\l</xsl:text>
320 <xsl:value-of select="$newparagraph" />
322 <xsl:apply-templates />
323 <xsl:if test="following-sibling::node( )">
324 <xsl:value-of select="$newparagraph" />
328 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
330 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
331 <xsl:value-of select="$newpage" />
332 <xsl:text>\X1\l\B\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
333 <xsl:value-of select="meta/title" />
334 <xsl:text>\B\l\X1</xsl:text>
335 <xsl:value-of select="$newparagraph" />
337 <xsl:apply-templates />
340 <xsl:template match="/gamebook/section/data/section[@class='numbered']/data/section[@class='numbered']">
341 <xsl:value-of select="$newpage" />
342 <xsl:text>\c\l\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
343 <xsl:value-of select="meta/title" />
344 <xsl:text>\l</xsl:text>
345 <xsl:value-of select="$newline" />
346 <xsl:text>\c</xsl:text><xsl:value-of select="$newline" />
348 <xsl:apply-templates />
349 <xsl:value-of select="$newparagraph" />
350 <xsl:text>\w="50%"</xsl:text>
353 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
355 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
356 <xsl:value-of select="$newpage" />
357 <xsl:text>\X1\l\B\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
358 <xsl:value-of select="meta/title" />
359 <xsl:text>\B\l\X1</xsl:text>
360 <xsl:value-of select="$newparagraph" />
362 <xsl:apply-templates />
365 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
367 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
368 <xsl:text>\l\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
369 <xsl:value-of select="meta/title" />
370 <xsl:text>\l</xsl:text>
371 <xsl:value-of select="$newparagraph" />
373 <xsl:apply-templates />
374 <xsl:if test="following-sibling::node( )">
375 <xsl:value-of select="$newparagraph" />
379 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
381 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
382 <xsl:text>\B\Q="</xsl:text><xsl:value-of select="@id" />><xsl:text>"</xsl:text>
383 <xsl:value-of select="meta/title" />
384 <xsl:text>\B</xsl:text>
385 <xsl:value-of select="$newparagraph" />
387 <xsl:apply-templates />
388 <xsl:if test="following-sibling::node( )">
389 <xsl:value-of select="$newparagraph" />
393 <!-- :::::::::::::::::: dedication template ::::::::::::::::::::: -->
395 <xsl:template match="id( 'dedicate' )">
396 <!-- PML doesn't allow blank lines at the top of a page without a space -->
397 <xsl:value-of select="$newpage" />
398 <xsl:text> </xsl:text><xsl:value-of select="$newparagraph" />
399 <xsl:text> </xsl:text><xsl:value-of select="$newparagraph" />
400 <xsl:text>\c\i</xsl:text>
401 <xsl:apply-templates select="data/p" />
402 <xsl:text>\i</xsl:text>
403 <xsl:value-of select="$newline" />
404 <xsl:text>\c</xsl:text>
405 <xsl:value-of select="$newline" />
408 <!-- ==================== block elements ======================== -->
410 <xsl:template match="p">
411 <xsl:apply-templates />
412 <xsl:if test="following-sibling::node( )">
413 <xsl:value-of select="$newparagraph" />
417 <xsl:template match="dd/p | li/p">
418 <xsl:apply-templates />
419 <xsl:if test="following-sibling::node( )">
421 <xsl:when test="following-sibling::illustration">
422 <xsl:if test="following-sibling::illustration/instance[@class='text']">
423 <xsl:value-of select="$newparagraph" />
427 <xsl:value-of select="$newparagraph" />
433 <xsl:template match="ul | ol | dl">
434 <xsl:apply-templates />
435 <xsl:if test="following-sibling::node( )">
436 <xsl:value-of select="$newparagraph" />
440 <xsl:template match="li/ul | li/ol | li/dl | dd/ul | dd/ol | dd/dl">
441 <xsl:apply-templates />
442 <xsl:if test="following-sibling::node( )">
443 <xsl:value-of select="$newparagraph" />
447 <xsl:template match="table">
448 <xsl:apply-templates />
449 <xsl:if test="following-sibling::node( )">
450 <xsl:value-of select="$newparagraph" />
454 <xsl:template match="tr">
455 <xsl:apply-templates />
456 <xsl:if test="following-sibling::node( )">
457 <xsl:value-of select="$newline" />
461 <xsl:template match="th">
462 <xsl:variable name="indent-level" select="count( th | td )" />
464 <xsl:when test="$indent-level = 2"><xsl:text>\T="33%"</xsl:text></xsl:when>
465 <xsl:when test="$indent-level = 3"><xsl:text>\T="66%"</xsl:text></xsl:when>
467 <xsl:text>\B</xsl:text><xsl:apply-templates /><xsl:text>\B</xsl:text>
470 <xsl:template match="td">
471 <xsl:variable name="indent-level" select="count( th | td )" />
473 <xsl:when test="$indent-level = 2"><xsl:text>\T="33%"</xsl:text></xsl:when>
474 <xsl:when test="$indent-level = 3"><xsl:text>\T="66%"</xsl:text></xsl:when>
476 <xsl:apply-templates />
479 <xsl:template match="combat">
480 <xsl:text>\t</xsl:text>
481 <xsl:apply-templates select="enemy" />
482 <xsl:text>:</xsl:text>
483 <xsl:text>\t</xsl:text>
485 <xsl:value-of select="$newline" />
486 <xsl:text>\t </xsl:text>
488 <xsl:when test="enemy-attribute[@class='combatskill']">
489 <xsl:text>COMBAT SKILL </xsl:text>
490 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
492 <xsl:when test="enemy-attribute[@class='closecombatskill']">
493 <xsl:text>CLOSE COMBAT SKILL </xsl:text>
494 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
497 <xsl:text>\t</xsl:text>
499 <xsl:value-of select="$newline" />
500 <xsl:text>\t </xsl:text>
501 <xsl:text>ENDURANCE </xsl:text>
503 <xsl:when test="enemy-attribute[@class='target']">
504 <xsl:text>(TARGET points) </xsl:text>
505 <xsl:value-of select="enemy-attribute[@class='target']" />
507 <xsl:when test="enemy-attribute[@class='resistance']">
508 <xsl:text>(RESISTANCE points) </xsl:text>
509 <xsl:value-of select="enemy-attribute[@class='resistance']" />
512 <xsl:value-of select="enemy-attribute[@class='endurance']" />
515 <xsl:text>\t</xsl:text>
517 <xsl:if test="following-sibling::node( )">
518 <xsl:value-of select="$newparagraph" />
522 <xsl:template match="choice">
523 <xsl:variable name="link">
524 <xsl:value-of select="@idref" />
527 <xsl:text>\t</xsl:text>
528 <xsl:for-each select="* | text()">
530 <xsl:when test="self::link-text">
531 <xsl:text>\q="#</xsl:text><xsl:value-of select="$link" /><xsl:text>"</xsl:text>
532 <xsl:apply-templates />
533 <xsl:text>\q</xsl:text>
536 <xsl:apply-templates select="." />
540 <xsl:text>\t</xsl:text>
541 <xsl:if test="following-sibling::node( )">
542 <xsl:value-of select="$newparagraph" />
546 <xsl:template match="signpost">
547 <xsl:text>\c</xsl:text>
548 <xsl:apply-templates />
549 <xsl:value-of select="$newline" />
550 <xsl:text>\c</xsl:text>
551 <xsl:if test="following-sibling::node( )">
552 <xsl:value-of select="$newparagraph" />
556 <xsl:template match="blockquote">
557 <xsl:text>\t</xsl:text>
558 <xsl:apply-templates />
559 <xsl:text>\t</xsl:text>
560 <xsl:if test="following-sibling::node( )">
561 <xsl:value-of select="$newparagraph" />
565 <xsl:template match="illustration">
567 <xsl:when test="instance[@class='pml'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
568 <xsl:text>\c\m="</xsl:text><xsl:value-of select="instance[@class='pml']/@src" /><xsl:text>"</xsl:text>
569 <xsl:value-of select="$newline" />
570 <xsl:text>\c</xsl:text>
571 <xsl:if test="following-sibling::node( )">
572 <xsl:value-of select="$newparagraph" />
575 <xsl:when test="instance[@class='text'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
576 <xsl:apply-templates select="instance[@class='text']/*" />
577 <xsl:if test="following-sibling::node( )">
578 <xsl:value-of select="$newparagraph" />
584 <xsl:template match="instance" />
586 <xsl:template match="footnotes" />
588 <xsl:template match="footnote">
589 <xsl:apply-templates />
592 <xsl:template match="hr">
593 <xsl:text>\w="80%"</xsl:text>
594 <xsl:value-of select="$newline" />
597 <xsl:template match="dt">
598 <xsl:apply-templates />
599 <xsl:if test="following-sibling::node( )">
600 <xsl:value-of select="$newline" />
604 <xsl:template match="dd">
605 <xsl:text>\t</xsl:text>
606 <xsl:apply-templates />
607 <xsl:text>\t</xsl:text>
608 <xsl:if test="following-sibling::node( )">
609 <xsl:value-of select="$newline" />
613 <xsl:template match="ol/li">
614 <xsl:number count="li" /><xsl:text>. </xsl:text>
615 <xsl:apply-templates />
616 <xsl:if test="following-sibling::node( )">
617 <xsl:value-of select="$newline" />
621 <xsl:template match="ul/li">
622 <xsl:text>• </xsl:text>
623 <xsl:apply-templates />
624 <xsl:if test="following-sibling::node( )">
625 <xsl:value-of select="$newline" />
629 <xsl:template match="ul[@class='unbulleted']/li">
630 <xsl:apply-templates />
631 <xsl:if test="following-sibling::node( )">
632 <xsl:value-of select="$newline" />
636 <!-- ==================== inline elements ======================= -->
638 <xsl:template match="a">
640 <xsl:text>\Q="</xsl:text><xsl:value-of select="@id" /><xsl:text>"</xsl:text>
642 <xsl:if test="@idref">
643 <xsl:text>\q="#</xsl:text><xsl:value-of select="@idref" /><xsl:text>"</xsl:text>
646 <xsl:apply-templates />
648 <xsl:if test="@idref">
649 <xsl:text>\q</xsl:text>
653 <xsl:template match="footnote//a">
654 <xsl:apply-templates />
657 <xsl:template match="a[@class='footnote']">
658 <xsl:apply-templates />
659 <xsl:text>\Sp\Fn="</xsl:text><xsl:value-of select="@idref" /><xsl:text>"</xsl:text>
660 <xsl:number count="a[@class='footnote']" from="/" level="any" format="1" />
661 <xsl:text>\Fn\Sp</xsl:text>
664 <xsl:template match="em">
665 <xsl:text>\i{</xsl:text><xsl:apply-templates /><xsl:text>i</xsl:text>
668 <xsl:template match="strong">
669 <xsl:text>\B</xsl:text><xsl:apply-templates /><xsl:text>\B</xsl:text>
672 <xsl:template match="cite">
673 <xsl:text>\i</xsl:text><xsl:apply-templates /><xsl:text>\i</xsl:text>
676 <xsl:template match="thought">
677 <xsl:text>\i</xsl:text><xsl:apply-templates /><xsl:text>\i</xsl:text>
680 <xsl:template match="onomatopoeia">
681 <xsl:text>\i</xsl:text><xsl:apply-templates /><xsl:text>\i</xsl:text>
684 <xsl:template match="spell">
685 <xsl:text>\i</xsl:text><xsl:apply-templates /><xsl:text>\i</xsl:text>
688 <xsl:template match="item">
689 <xsl:apply-templates />
692 <xsl:template match="foreign">
693 <xsl:text>\i</xsl:text><xsl:apply-templates /><xsl:text>\i</xsl:text>
696 <xsl:template match="quote">
697 <xsl:text>&lsquot;</xsl:text>
698 <xsl:apply-templates />
699 <xsl:text>&rsquot;</xsl:text>
702 <xsl:template match="quote//quote">
703 <xsl:text>&ldquot;</xsl:text>
704 <xsl:apply-templates />
705 <xsl:text>&rdquot;</xsl:text>
708 <xsl:template match="code">
709 <xsl:apply-templates />
712 <xsl:template match="br">
713 <xsl:value-of select="$newline" />