d2/tfile.h: Call ungetc() when test for non-primary transformation command fails.
[Ale.git] / doc / ale-doc.xsl
blob82666b76a257be4ec0a0ad532b7792a6340d4d55
1 <!--
2 - Copyright 2006 David Hilvert
3 -
4 - ALE documentation stylesheet definition.
6 - This file is part of the Anti-Lamenessing Engine documentation.
8 - The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
9 - it under the terms of the GNU General Public License as published by
10 - the Free Software Foundation; either version 2 of the License, or
11 - (at your option) any later version.
13 - The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
14 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 - GNU General Public License for more details.
18 - You should have received a copy of the GNU General Public License
19 - along with Anti-Lamenessing Engine; if not, write to the Free Software
20 - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 -->
23 <!DOCTYPE xsl:stylesheet [
25 <!--
26 - Entities
27 -->
29 <!--
30 - Character classes
31 -->
33 <!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
34 <!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
36 <!--
38 - NOTE: the below entities operate on edit records, which
39 - are expected to conform to exactly one of the following patterns:
41 - <edit by="David Hilvert" on="2006-Sep-24">
42 - <edit by="David Hilvert" in-month="2006-Sep">
43 - <edit by="David Hilvert" in-year="2006">
45 - The first form is preferred for occasional edits; the latter two
46 - are provided as shorthand for edits occurring over a number of
47 - days in succession, or for cases where the exact date of the edit
48 - is not known (e.g., when basing edit history on copyright notices
49 - from older files).
50 -->
53 <!--
54 - Obtain an editor name from an edit record.
55 -->
57 <!ENTITY editor 'normalize-space(@by)'>
59 <!--
60 - Obtain an edit year from an edit record.
61 -->
63 <!ENTITY year 'concat(@in-year, substring-before(@in-month, "-"), substring-before(@on, "-"))'>
65 <!--
66 - Generate a string unique for each (editor, year) combination.
67 -->
69 <!ENTITY editor-year 'concat(&editor;, &year;)'>
71 <!--
72 - Boolean test to determine whether the current node is within the scope of
73 - $objectroot.
74 -->
76 <!ENTITY scope 'count(ancestor::node()|$objectroot) = count(ancestor::node())'>
78 <!--
79 - Editor first name.
80 -->
82 <!ENTITY editor-firstname 'substring-before(&editor;, " ")'>
84 <!--
85 - Editor last name
86 -->
88 <!ENTITY editor-surname 'substring-after(&editor;, " ")'>
90 <!--
91 - Sort order for outputs including editor names.
92 -->
94 <!ENTITY editor-sort-order '&editor-surname;'>
96 <!--
97 - Sort order for years
98 -->
100 <!ENTITY year-sort-order '&year;'>
104 <xsl:stylesheet id="style1"
105 version="1.0"
106 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
107 xmlns:fo="http://www.w3.org/1999/XSL/Format"
108 xmlns:xi="http://www.w3.org/2001/XInclude">
110 <!--
111 - Product information
114 <xsl:param name="product-name" select="'ALE'"/>
115 <xsl:param name="product-version" select="'0.8.7'"/>
116 <xsl:param name="site-URL" select="
117 concat('http://auricle.dyndns.org/', $product-name, '/')"/>
118 <xsl:param name="download-URL" select="concat($site-URL, 'download/')"/>
119 <xsl:param name="windows-binary-package-name" select="
120 concat(translate($product-name, &uppercase;, &lowercase;), '-',
121 translate($product-version, '.', '_'), '-win32.zip')"/>
122 <xsl:param name="source-package-name" select="
123 concat(translate($product-name, &uppercase;, &lowercase;), '-', $product-version)"/>
124 <xsl:param name="source-package-name-tar-gz" select="
125 concat($source-package-name, '.tar.gz')"/>
126 <xsl:param name="windows-binary-URL" select="concat($download-URL, $windows-binary-package-name)"/>
127 <xsl:param name="source-URL" select="concat($download-URL, $source-package-name-tar-gz)"/>
128 <xsl:param name="mailing-list-address" select="'ale@ventricle.dyndns.org'"/>
130 <!--
131 - License information
134 <xsl:template match="*|/" mode="license-terms">
135 <para>
136 This <xsl:apply-templates select="." mode="document-type"/> is free
137 documentation; you can redistribute it and/or modify it under the
138 terms of the GNU General Public License as published by the Free
139 Software Foundation; either version 2 of the License, or (at your
140 option) any later version.
141 </para>
142 </xsl:template>
144 <xsl:template match="*|/" mode="license-object">
145 <para>
146 Unless explicitly defined within the applicable version of the GNU
147 General Public License, any references to "object code" within the
148 license shall refer to any non-source version of this
149 <xsl:apply-templates select="." mode="document-type"/> (or of any
150 work based on this <xsl:apply-templates select="."
151 mode="document-type"/>).
152 </para>
153 </xsl:template>
155 <xsl:template match="*|/" mode="license-warranty">
156 <para>
157 This <xsl:apply-templates select="." mode="document-type"/> is
158 distributed in the hope that it will be useful, but WITHOUT ANY
159 WARRANTY; without even the implied warranty of MERCHANTABILITY or
160 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
161 for more details.
162 </para>
163 </xsl:template>
165 <xsl:template match="*|/" mode="license-availability">
166 <para>
167 You should have received a copy of the GNU General Public License
168 along with this <xsl:apply-templates select="."
169 mode="document-type"/>; if not, write to the Free Software
170 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
171 02110-1301, USA.
172 </para>
173 </xsl:template>
175 <xsl:template match="*|/" mode="license">
176 <legalnotice>
177 <xsl:apply-templates select="." mode="license-terms"/>
178 <xsl:apply-templates select="." mode="license-warranty"/>
179 <xsl:apply-templates select="." mode="license-availability"/>
180 <xsl:apply-templates select="." mode="license-object"/>
181 </legalnotice>
182 </xsl:template>
184 <!--
185 - Editing information
188 <xsl:key name="editors" match="edit" use="&editor;"/>
189 <xsl:key name="editor-years" match="edit" use="&editor-year;"/>
191 <!--
192 - If no other template matches, we copy the tree structure unchanged.
195 <xsl:template match="@*|node()">
196 <xsl:copy>
197 <xsl:apply-templates select="@*|node()"/>
198 </xsl:copy>
199 </xsl:template>
201 <!--
202 - Do not pass edit tags to DocBook, as it doesn't understand them.
205 <xsl:template match="edit"/>
207 <!--
208 - Capitalize the initial letter of titles.
211 <xsl:template name="write_title">
212 <xsl:param name="product-name"/>
213 <xsl:param name="product-version"/>
214 <xsl:param name="title" select="."/>
216 <xsl:variable name="space-stripped-title" select="normalize-space($title)"/>
217 <xsl:variable name="initial" select="substring($space-stripped-title, 1, 1)"/>
218 <xsl:variable name="sequel" select="substring($space-stripped-title, 2)"/>
220 <title>
222 <xsl:copy-of select="$product-name"/>
223 <xsl:text> </xsl:text>
224 <xsl:copy-of select="$product-version"/>
225 <xsl:text> </xsl:text>
226 <xsl:copy-of select="concat(translate($initial, &lowercase;, &uppercase;), $sequel)"/>
228 </title>
229 </xsl:template>
231 <xsl:template match="text()" mode="title">
232 <xsl:call-template name="write_title">
233 <xsl:with-param name="title" select="."/>
234 </xsl:call-template>
235 </xsl:template>
237 <!--
238 - Titles other than article, book and set titles.
241 <xsl:template match="title|t">
242 <xsl:apply-templates select="text()" mode="title"/>
243 </xsl:template>
245 <!--
246 - Add package information to titles of articles, books and sets.
249 <xsl:template match="setinfo/title|bookinfo/title|articleinfo/title|setinfo/t|bookinfo/t|articleinfo/t">
250 <xsl:call-template name="write_title">
251 <xsl:with-param name="product-name" select="$product-name"/>
252 <xsl:with-param name="product-version" select="$product-version"/>
253 <xsl:with-param name="title" select="text()"/>
254 </xsl:call-template>
255 </xsl:template>
257 <!--
258 - Generate title, author, copyright, and license information for
259 - articles, books and sets.
262 <xsl:template match="setinfo" mode="document-type">
263 <xsl:text>set</xsl:text>
264 </xsl:template>
266 <xsl:template match="bookinfo" mode="document-type">
267 <xsl:text>book</xsl:text>
268 </xsl:template>
270 <xsl:template match="articleinfo" mode="document-type">
271 <xsl:text>article</xsl:text>
272 </xsl:template>
274 <xsl:template match="setinfo|bookinfo|articleinfo">
275 <xsl:copy>
276 <xsl:variable name="objectroot" select=".."/>
277 <xsl:variable name="editors-unique" select="$objectroot//edit[count(.|key('editors', &editor;)[&scope;][1]) = 1]"/>
278 <xsl:variable name="editor-years-unique" select="$objectroot//edit[count(.|key('editor-years', &editor-year;)[&scope;][1]) = 1]"/>
280 <!--
281 - Generate the title, if available.
284 <xsl:apply-templates select="title|t"/>
286 <!--
287 - Preserve abstracts.
290 <xsl:apply-templates select="abstract"/>
292 <!--
293 - Add author information.
296 <xsl:for-each select="$editors-unique">
297 <xsl:sort select="&editor-sort-order;"/>
298 <author>
299 <firstname>
300 <xsl:value-of select="&editor-firstname;"/>
301 </firstname>
302 <surname>
303 <xsl:value-of select="&editor-surname;"/>
304 </surname>
305 </author>
306 </xsl:for-each>
308 <!--
309 - Add copyright information
312 <xsl:for-each select="$editors-unique">
313 <xsl:sort select="&editor-sort-order;"/>
314 <xsl:variable name="this-editor" select="&editor;"/>
315 <copyright>
316 <holder>
317 <xsl:value-of select="&editor;"/>
318 </holder>
319 <xsl:for-each select="$editor-years-unique">
320 <xsl:sort select="&year-sort-order;"/>
321 <xsl:if test="&editor; = $this-editor">
322 <year>
323 <xsl:value-of select="&year;"/>
324 </year>
325 </xsl:if>
326 </xsl:for-each>
327 </copyright>
328 </xsl:for-each>
331 <!--
332 - Add a license notice
335 <xsl:apply-templates select="." mode="license"/>
337 </xsl:copy>
338 </xsl:template>
340 <!--
341 - Changelogs and news files.
344 <!--
345 - Changelog item
348 <xsl:template match="entry">
349 <listitem>
350 <xsl:apply-templates select="text/text()"/>
351 </listitem>
352 </xsl:template>
354 <!--
355 - Keys
358 <xsl:key name="word-map" match="entry" use="word/child::text()"/>
360 <!--
361 - Taxonomy
364 <xsl:variable name="taxonomy-root" select="document('taxonomy.xmli')"/>
366 <!--
367 - Write a fragment substring for a (change, category) pair.
370 <xsl:template name="write-change-category">
371 <xsl:param name="change"/>
372 <xsl:param name="category"/>
373 <xsl:value-of select="concat(generate-id($change), ':', generate-id($category), ' ')"/>
374 </xsl:template>
376 <!--
377 - Get a change category from a fragment result
380 <xsl:template name="get-change-category">
381 <xsl:param name="change"/>
382 <xsl:param name="fragment"/>
383 <xsl:value-of select="substring-before(substring-after(substring-after($fragment, generate-id($change)), ':'), ' ')"/>
384 </xsl:template>
386 <!--
387 - Get a tree fragment with categories set to zero.
390 <xsl:template name="get-zero-categories">
391 <xsl:param name="changes"/>
392 <xsl:for-each select="$changes">
393 <xsl:call-template name="write-change-category">
394 <xsl:with-param name="change" select="."/>
395 <xsl:with-param name="category" select="$taxonomy-root"/>
396 </xsl:call-template>
397 </xsl:for-each>
398 </xsl:template>
400 <!--
401 - Determine whether a category tree is valid (no undefineds) for all
402 - changes. Returns a tree fragment including the string 'fail'
403 - upon failure.
406 <xsl:template name="categories-valid">
407 <xsl:param name="changes"/>
408 <xsl:param name="fragment"/>
409 <xsl:for-each select="$changes">
410 <xsl:variable name="category">
411 <xsl:call-template name="get-change-category">
412 <xsl:with-param name="change" select="."/>
413 <xsl:with-param name="fragment" select="$fragment"/>
414 </xsl:call-template>
415 </xsl:variable>
417 <xsl:if test="$category = ''">
418 <xsl:text>fail: </xsl:text>
419 <apply-templates select="."/>
420 </xsl:if>
421 </xsl:for-each>
422 </xsl:template>
424 <!--
425 - make a map unique
427 <xsl:template name="make-map-unique">
428 <xsl:param name="map"/>
429 <xsl:param name="map-prefix"/>
431 <xsl:choose>
432 <xsl:when test="$map = ''">
433 </xsl:when>
434 <xsl:when test="contains($map-prefix, substring-before($map, ':'))">
435 <xsl:call-template name="make-map-unique">
436 <xsl:with-param name="map" select="substring-after($map, ' ')"/>
437 <xsl:with-param name="map-prefix" select="$map-prefix"/>
438 </xsl:call-template>
439 </xsl:when>
440 <xsl:otherwise>
441 <xsl:value-of select="substring-before($map, ' ')"/>
442 <xsl:text> </xsl:text>
443 <xsl:call-template name="make-map-unique">
444 <xsl:with-param name="map" select="substring-after($map, ' ')"/>
445 <xsl:with-param name="map-prefix" select="concat($map-prefix, substring-before($map, ' '))"/>
446 </xsl:call-template>
447 </xsl:otherwise>
448 </xsl:choose>
449 </xsl:template>
451 <!--
452 - Attempt to map all changes to sublevels
455 <xsl:template name="map-changes-to-sublevels">
456 <xsl:param name="taxonomy"/>
457 <xsl:param name="changes"/>
459 <xsl:variable name="non-unique-map">
460 <xsl:for-each select="$taxonomy">
461 <xsl:sort select="@match-priority" order="descending"/>
463 <xsl:variable name="category" select="."/>
465 <xsl:variable name="keywords" select=".//keyword"/>
467 <xsl:for-each select="$changes">
469 <xsl:variable name="change" select="."/>
471 <xsl:choose>
472 <xsl:when test="name($category) = name(.)">
473 <xsl:call-template name="write-change-category">
474 <xsl:with-param name="change" select="."/>
475 <xsl:with-param name="category" select="$category"/>
476 </xsl:call-template>
477 </xsl:when>
478 <xsl:when test="count(key('word-map', $keywords/child::text()))
479 = count(key('word-map', $keywords/child::text())|.)">
480 <xsl:call-template name="write-change-category">
481 <xsl:with-param name="change" select="."/>
482 <xsl:with-param name="category" select="$category"/>
483 </xsl:call-template>
484 </xsl:when>
485 </xsl:choose>
486 </xsl:for-each>
487 </xsl:for-each>
488 </xsl:variable>
490 <xsl:call-template name="make-map-unique">
491 <xsl:with-param name="map" select="$non-unique-map"/>
492 </xsl:call-template>
493 </xsl:template>
495 <!--
496 - Write changes
499 <xsl:template name="write-changes">
500 <xsl:param name="taxonomy"/>
501 <xsl:param name="changes"/>
503 <!--
504 - Attempt to map changes to sublevels
507 <xsl:variable name="map">
508 <xsl:call-template name="map-changes-to-sublevels">
509 <xsl:with-param name="taxonomy" select="$taxonomy"/>
510 <xsl:with-param name="changes" select="$changes"/>
511 </xsl:call-template>
512 </xsl:variable>
514 <xsl:variable name="map-failures">
515 <xsl:call-template name="categories-valid">
516 <xsl:with-param name="changes" select="$changes"/>
517 <xsl:with-param name="fragment" select="$map"/>
518 </xsl:call-template>
519 </xsl:variable>
521 <xsl:choose>
522 <xsl:when test="contains($map-failures, 'fail')">
524 <!--
525 - In case of failure, insert all nodes at the current level.
528 <itemizedlist>
529 <xsl:apply-templates select="$changes"/>
530 </itemizedlist>
532 </xsl:when>
533 <xsl:otherwise>
535 <!--
536 - In case of success, insert all nodes within sublevels.
539 <xsl:for-each select="$taxonomy">
540 <xsl:variable name="category" select="."/>
541 <xsl:if test="contains($map, concat(generate-id($category), ' '))">
542 <section tocexclude="1">
543 <xsl:call-template name="write_title">
544 <xsl:with-param name="title">
545 <xsl:choose>
546 <xsl:when test="@t != ''">
547 <xsl:value-of select="@t"/>
548 </xsl:when>
549 <xsl:otherwise>
550 <xsl:value-of select="translate(name($category), '-', ' ')"/>
551 </xsl:otherwise>
552 </xsl:choose>
553 </xsl:with-param>
554 </xsl:call-template>
555 <xsl:call-template name="write-changes">
556 <xsl:with-param name="taxonomy" select="$category/*"/>
557 <xsl:with-param name="changes" select="$changes[name(.) = name($category)]/*|$changes[not(name(.) = name($category))][contains($map, concat(generate-id(.), ':', generate-id($category), ' '))]"/>
558 </xsl:call-template>
559 </section>
560 </xsl:if>
561 </xsl:for-each>
563 </xsl:otherwise>
565 </xsl:choose>
567 </xsl:template>
569 <!--
570 - News entries.
573 <xsl:template match="fm">
574 <para>
575 <xsl:choose>
576 <xsl:when test="@nh">
577 <xsl:apply-templates/><xsl:text> (Freshmeat announcement via Neohapsis)</xsl:text>
578 </xsl:when>
579 <xsl:otherwise>
580 <xsl:apply-templates/><xsl:text> (Freshmeat announcement)</xsl:text>
581 </xsl:otherwise>
582 </xsl:choose>
583 </para>
584 </xsl:template>
586 <xsl:template match="sum">
587 <section tocexclude="1"><title>Program summary</title>
588 <xsl:if test="@revised">
589 <para>This release includes a revised summary:</para>
590 <!-- This release is accompanied by a revised summary: -->
591 </xsl:if>
592 <para>
593 <xsl:apply-templates/>
594 </para>
595 </section>
596 </xsl:template>
598 <xsl:template match="ed-note">
599 <xsl:apply-templates/>
600 </xsl:template>
602 <xsl:template match="notes">
603 <section tocexclude="1"><title>Notes</title>
604 <para>
605 <xsl:apply-templates/>
606 </para>
607 </section>
608 </xsl:template>
610 <xsl:template match="ch">
611 <section tocexclude="1"><title>Changelog summary</title>
612 <xsl:apply-templates/>
613 </section>
614 </xsl:template>
616 <xsl:template match="ml">
617 <section tocexclude="1"><title>Mailing list announcement</title>
618 <xsl:apply-templates/>
619 </section>
620 </xsl:template>
622 <!--
623 - Releases
626 <xsl:template match="release" name="release-news" mode="news">
627 <xsl:param name="label" select="1"/>
628 <section label="{$label}" tocexclude="1">
629 <!-- <section label="{@version}"> -->
630 <xsl:choose>
631 <xsl:when test="@date">
632 <title>
633 <xsl:text>Version </xsl:text>
634 <xsl:value-of select="@version"/>
635 <xsl:text>, </xsl:text>
636 <xsl:value-of select="@date"/>
637 </title>
638 </xsl:when>
639 <xsl:otherwise>
640 <title>
641 <xsl:text>Version </xsl:text>
642 <xsl:value-of select="@version"/>
643 </title>
644 </xsl:otherwise>
645 </xsl:choose>
647 <!--
648 - Notes
651 <xsl:apply-templates select=".//note"/>
653 <!--
654 - Write subsections.
657 <xsl:apply-templates/>
659 </section>
660 </xsl:template>
662 <xsl:template match="release" name="release-changelog" mode="changelog">
663 <xsl:param name="label" select="1"/>
664 <section label="{$label}" tocexclude="1">
665 <!-- <section label="{@version}"> -->
666 <xsl:choose>
667 <xsl:when test="@date">
668 <title>
669 <xsl:text>Version </xsl:text>
670 <xsl:value-of select="@version"/>
671 <xsl:text>, </xsl:text>
672 <xsl:value-of select="@date"/>
673 </title>
674 </xsl:when>
675 <xsl:otherwise>
676 <title>
677 <xsl:text>Version </xsl:text>
678 <xsl:value-of select="@version"/>
679 </title>
680 </xsl:otherwise>
681 </xsl:choose>
683 <!--
684 - Notes
687 <xsl:apply-templates select=".//note"/>
689 <!--
690 - Write changes according to the change taxonomy
693 <xsl:call-template name="write-changes">
694 <xsl:with-param name="taxonomy" select="$taxonomy-root/taxonomy/*"/>
695 <xsl:with-param name="changes" select="./*[name() != 'edit']"/>
696 </xsl:call-template>
697 </section>
698 </xsl:template>
700 <xsl:template match="news">
701 <xsl:for-each select="release">
702 <xsl:call-template name="release-news">
703 <xsl:with-param name="label" select="count(../release) - position()"/>
704 </xsl:call-template>
705 </xsl:for-each>
706 </xsl:template>
708 <xsl:template match="changelog">
709 <xsl:for-each select="release">
710 <xsl:call-template name="release-changelog" mode="changelog">
711 <xsl:with-param name="label" select="count(../release) - position()"/>
712 </xsl:call-template>
713 </xsl:for-each>
714 </xsl:template>
716 <!--
717 - Inline product information
720 <xsl:template match="winpack">
721 <xsl:value-of select="$windows-binary-package-name"/>
722 </xsl:template>
724 <xsl:template match="ver">
725 <xsl:value-of select="$product-version"/>
726 </xsl:template>
728 <xsl:template match="sourcepack">
729 <xsl:value-of select="$source-package-name"/>
730 </xsl:template>
732 <xsl:template match="sourcepacktargz">
733 <xsl:value-of select="$source-package-name-tar-gz"/>
734 </xsl:template>
736 <xsl:template match="winurl">
737 <xsl:choose>
738 <xsl:when test="contains($product-version, 'pre')">
739 <note>
740 Windows binaries are not available for this prerelease version.
741 </note>
742 </xsl:when>
743 <xsl:otherwise>
744 <ulink url="{$windows-binary-URL}"/>
745 </xsl:otherwise>
746 </xsl:choose>
747 </xsl:template>
749 <xsl:template match="sourceurl">
750 <ulink url="{$source-URL}"/>
751 </xsl:template>
753 <xsl:template match="mailinglist">
754 <xsl:value-of select="$mailing-list-address"/>
755 </xsl:template>
757 <!--
758 - Abbreviations for DocBook elements.
761 <xsl:template match="p">
762 <para>
763 <xsl:apply-templates/>
764 </para>
765 </xsl:template>
767 <xsl:template match="ul">
768 <itemizedlist>
769 <xsl:apply-templates/>
770 </itemizedlist>
771 </xsl:template>
773 <xsl:template match="li">
774 <listitem>
775 <xsl:apply-templates/>
776 </listitem>
777 </xsl:template>
779 <xsl:template match="s">
780 <section>
781 <xsl:apply-templates/>
782 </section>
783 </xsl:template>
785 <xsl:template match="code">
786 <literal>
787 <xsl:apply-templates/>
788 </literal>
789 </xsl:template>
791 <xsl:template match="l">
792 <literal>
793 <xsl:apply-templates/>
794 </literal>
795 </xsl:template>
797 <xsl:template match="pre">
798 <literallayout class="monospaced">
799 <xsl:apply-templates/>
800 </literallayout>
801 </xsl:template>
803 <xsl:template match="ll">
804 <literallayout class="monospaced">
805 <xsl:apply-templates/>
806 </literallayout>
807 </xsl:template>
809 <xsl:template match="ui">
810 <userinput>
811 <xsl:apply-templates/>
812 </userinput>
813 </xsl:template>
815 <xsl:template match="meta">
816 <emphasis>
817 <xsl:apply-templates/>
818 </emphasis>
819 </xsl:template>
821 <xsl:template match="i">
822 <emphasis>
823 <xsl:apply-templates/>
824 </emphasis>
825 </xsl:template>
827 <xsl:template match="sup">
828 <superscript>
829 <xsl:apply-templates/>
830 </superscript>
831 </xsl:template>
833 <xsl:template match="sub">
834 <subscript>
835 <xsl:apply-templates/>
836 </subscript>
837 </xsl:template>
840 </xsl:stylesheet>