/[suikacvs]/www/2005/tutorial/tutorial-html.ja.xsl
Suika

Contents of /www/2005/tutorial/tutorial-html.ja.xsl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download) (as text)
Tue Mar 7 06:23:49 2006 UTC (18 years, 9 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: application/xml
New

1 wakaba 1.1 <?xml version="1.0" encoding="iso-2022-jp"?>
2     <!DOCTYPE t:stylesheet [
3     <!ENTITY sort-key "
4     self::doc:*/@key |
5     @doc:key |
6     self::*[not (self::doc:*) and
7     not (@doc:key)] |
8     self::doc:*[not (@key)]
9     ">
10     ]>
11     <t:stylesheet xmlns:t="http://www.w3.org/1999/XSL/Transform"
12     xmlns:dc="http://purl.org/dc/elements/1.1/"
13     xmlns:doc="http://suika.fam.cx/~wakaba/archive/2005/7/tutorial#"
14     xmlns:tree="http://pc5.2ch.net/test/read.cgi/hp/1101043958/564"
15     xmlns:xhtml1="http://www.w3.org/1999/xhtml"
16     xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2/"
17     xmlns:html5="http://www.w3.org/1999/xhtml"
18     xmlns="http://www.w3.org/1999/xhtml"
19     version="1.0">
20    
21     <t:template match="child::doc:document">
22     <html lang="{@xml:lang}" xml:lang="{@xml:lang}">
23     <head>
24     <t:apply-templates select="child::xhtml2:h[position () = 1]" mode="title"/>
25     <link rel="stylesheet" href="tutorial-style.css"
26     type="text/css" media="all"/>
27     </head>
28     <body>
29     <t:apply-templates select="@*"/>
30     <t:apply-templates select="child::*" mode="h1"/>
31     <t:if test="descendant::doc:ed | descendant::doc:todo">
32     <t:apply-templates select="self::node ()" mode="todo-list"/>
33     </t:if>
34     </body>
35     </html>
36     </t:template>
37    
38     <t:template match="doc:document/@published-year"/>
39    
40     <t:template match="doc:document" mode="todo-list">
41     <div class="section ed">
42     <h2>$BL$40@.$N2U=j(B</h2>
43     <ol class="xoxo">
44     <t:apply-templates select="descendant::doc:ed |
45     descendant::doc:todo" mode="todo-list"/>
46     </ol>
47     </div>
48     </t:template>
49    
50     <t:template match="child::doc:insert[@content = 'toc']" mode="h2">
51     <t:for-each select="ancestor::doc:document">
52     <ol class="xoxo doc-toc">
53     <t:apply-templates select="child::html5:section |
54     child::doc:appendix |
55     child::doc:presection" mode="toc"/>
56     </ol>
57     </t:for-each>
58     </t:template>
59    
60     <t:template match="child::doc:insert[@content = 'toc-detail']" mode="h2">
61     <t:for-each select="ancestor::doc:document">
62     <ol class="xoxo doc-toc-detail">
63     <t:apply-templates select="child::html5:section |
64     child::doc:appendix |
65     child::doc:presection" mode="toc-detail"/>
66     </ol>
67     </t:for-each>
68     </t:template>
69    
70     <t:template match="child::doc:insert[@content = 'list-of-figures']" mode="h2">
71     <t:for-each select="ancestor::doc:document">
72     <ol class="xoxo doc-list-of-figures">
73     <t:apply-templates select="descendant::doc:fig |
74     descendant::html5:table |
75     descendant::doc:quote |
76     descendant::doc:example" mode="toc-figures"/>
77     </ol>
78     </t:for-each>
79     </t:template>
80    
81     <t:template match="child::doc:insert[@content = 'list-of-columns']" mode="h2">
82     <t:for-each select="ancestor::doc:document">
83     <ol class="xoxo doc-list-of-columns">
84     <t:apply-templates select="descendant::doc:miniColumn" mode="toc-columns"/>
85     </ol>
86     </t:for-each>
87     </t:template>
88    
89     <t:template match="child::doc:insert[@content = 'list-of-keypoints']" mode="h2">
90     <t:for-each select="ancestor::doc:document">
91     <ol class="xoxo doc-list-of-keypoints">
92     <t:apply-templates select="descendant::doc:keyPoints" mode="toc-keypoints"/>
93     </ol>
94     </t:for-each>
95     </t:template>
96    
97     <t:template match="child::doc:insert[@content = 'answers']" mode="h2">
98     <t:for-each select="ancestor::doc:document">
99     <t:apply-templates select="child::html5:section" mode="answer-h3"/>
100     </t:for-each>
101     </t:template>
102    
103     <t:template match="child::doc:insert[@content = 'index-aiueo']" mode="h2">
104     <t:for-each select="ancestor::doc:document">
105     <t:variable name="target" select="descendant::html5:dfn |
106     descendant::doc:iw"/>
107     <t:variable name="target-a"
108     select="$target[contains ('$B$"$$$&$($*%"%$%&%(%*(B',
109     substring (string (&sort-key;), 1, 1))]"/>
110     <ol class="xoxo">
111     <t:call-template name="index-part">
112     <t:with-param name="header">$B$"9T(B</t:with-param>
113     <t:with-param name="header-lang">ja</t:with-param>
114     <t:with-param name="name" select="'aiueo-a'"/>
115     <t:with-param name="items" select="$target-a"/>
116     </t:call-template>
117     <t:variable name="target-ka"
118     select="$target[contains ('$B$+$-$/$1$3%+%-%/%1%3$,$.$0$2$4%,%.%0%2%4(B',
119     substring (string (&sort-key;), 1, 1))]"/>
120     <t:call-template name="index-part">
121     <t:with-param name="header">$B$+9T(B</t:with-param>
122     <t:with-param name="header-lang">ja</t:with-param>
123     <t:with-param name="name" select="'aiueo-ka'"/>
124     <t:with-param name="items" select="$target-ka"/>
125     </t:call-template>
126     <t:variable name="target-sa"
127     select="$target[contains ('$B$5$7$9$;$=%5%7%9%;%=$6$8$:$<$>%6%8%:%<%>(B',
128     substring (string (&sort-key;), 1, 1))]"/>
129     <t:call-template name="index-part">
130     <t:with-param name="header">$B$59T(B</t:with-param>
131     <t:with-param name="header-lang">ja</t:with-param>
132     <t:with-param name="name" select="'aiueo-sa'"/>
133     <t:with-param name="items" select="$target-sa"/>
134     </t:call-template>
135     <t:variable name="target-ta"
136     select="$target[contains ('$B$?$A$D$F$H%?%A%D%F%H$@$B$E$G$I%@%B%E%G%I(B',
137     substring (string (&sort-key;), 1, 1))]"/>
138     <t:call-template name="index-part">
139     <t:with-param name="header">$B$?9T(B</t:with-param>
140     <t:with-param name="header-lang">ja</t:with-param>
141     <t:with-param name="items" select="$target-ta"/>
142     <t:with-param name="name" select="'aiueo-ta'"/>
143     </t:call-template>
144     <t:variable name="target-na"
145     select="$target[contains ('$B$J$K$L$M$N%J%K%L%M%N(B',
146     substring (string (&sort-key;), 1, 1))]"/>
147     <t:call-template name="index-part">
148     <t:with-param name="header">$B$J9T(B</t:with-param>
149     <t:with-param name="header-lang">ja</t:with-param>
150     <t:with-param name="name" select="'aiueo-na'"/>
151     <t:with-param name="items" select="$target-na"/>
152     </t:call-template>
153     <t:variable name="target-ha"
154     select="$target[contains ('$B$O$R$U$X$[%O%R%U%X%[$P$S$V$Y$\%P%S%V%Y%\$Q$T$W$Z$]%Q%T%W%Z%](B',
155     substring (string (&sort-key;), 1, 1))]"/>
156     <t:call-template name="index-part">
157     <t:with-param name="header">$B$O9T(B</t:with-param>
158     <t:with-param name="header-lang">ja</t:with-param>
159     <t:with-param name="items" select="$target-ha"/>
160     <t:with-param name="name" select="'aiueo-ha'"/>
161     </t:call-template>
162     <t:variable name="target-ma"
163     select="$target[contains ('$B$^$_$`$a$b%^%_%`%a%b(B',
164     substring (string (&sort-key;), 1, 1))]"/>
165     <t:call-template name="index-part">
166     <t:with-param name="header">$B$^9T(B</t:with-param>
167     <t:with-param name="header-lang">ja</t:with-param>
168     <t:with-param name="name" select="'aiueo-ma'"/>
169     <t:with-param name="items" select="$target-ma"/>
170     </t:call-template>
171     <t:variable name="target-ya"
172     select="$target[contains ('$B$d$f$h%d%f%h(B',
173     substring (string (&sort-key;), 1, 1))]"/>
174     <t:call-template name="index-part">
175     <t:with-param name="header">$B$d9T(B</t:with-param>
176     <t:with-param name="header-lang">ja</t:with-param>
177     <t:with-param name="name" select="'aiueo-ya'"/>
178     <t:with-param name="items" select="$target-ya"/>
179     </t:call-template>
180     <t:variable name="target-ra"
181     select="$target[contains ('$B$i$j$k$l$m%i%j%k%l%m(B',
182     substring (string (&sort-key;), 1, 1))]"/>
183     <t:call-template name="index-part">
184     <t:with-param name="header">$B$i9T(B</t:with-param>
185     <t:with-param name="header-lang">ja</t:with-param>
186     <t:with-param name="name" select="'aiueo-ra'"/>
187     <t:with-param name="items" select="$target-ra"/>
188     </t:call-template>
189     <t:variable name="target-wa"
190     select="$target[contains ('$B$o$p$q$r$s%o%p%q%r%s(B',
191     substring (string (&sort-key;), 1, 1))]"/>
192     <t:call-template name="index-part">
193     <t:with-param name="header">$B$o9T(B</t:with-param>
194     <t:with-param name="header-lang">ja</t:with-param>
195     <t:with-param name="name" select="'aiueo-wa'"/>
196     <t:with-param name="items" select="$target-wa"/>
197     </t:call-template>
198     <t:variable name="target-misc"
199     select="$target[not (contains ('$B$"$$$&$($*%"%$%&%(%*$+$-$/$1$3%+%-%/%1%3$,$.$0$2$4%,%.%0%2%4$5$7$9$;$=%5%7%9%;%=$6$8$:$<$>%6%8%:%<%>$?$A$D$F$H%?%A%D%F%H$@$B$E$G$I%@%B%E%G%I$J$K$L$M$N%J%K%L%M%N$O$R$U$X$[%O%R%U%X%[$P$S$V$Y$\%P%S%V%Y%\$Q$T$W$Z$]%Q%T%W%Z%]$^$_$`$a$b%^%_%`%a%b$d$f$h%d%f%h$i$j$k$l$m%i%j%k%l%m$o$p$q$r$s%o%p%q%r%s(B',
200     substring (string (&sort-key;), 1, 1)))]"/>
201     <t:call-template name="index-part">
202     <t:with-param name="header">$B$=$NB>(B</t:with-param>
203     <t:with-param name="header-lang">ja</t:with-param>
204     <t:with-param name="name" select="'aiueo-misc'"/>
205     <t:with-param name="items" select="$target-misc"/>
206     </t:call-template>
207     </ol>
208     </t:for-each>
209     </t:template>
210    
211     <t:template name="index-part">
212     <t:param name="header"/>
213     <t:param name="header-lang"/>
214     <t:param name="name"/>
215     <t:param name="items"/>
216     <t:if test="$items">
217     <li class="doc-index-{$name}">
218     <div class="non-para" lang="{$header-lang}" xml:lang="{$header-lang}">
219     <t:value-of select="$header"/>
220     </div>
221     <ol>
222     <t:for-each select="$items">
223     <t:sort select="&sort-key;"/>
224     <t:variable name="same-name-items"
225     select="$items[(self::doc:*/@name | @doc:name) =
226     (current ()/self::doc:*/@name |
227     current ()/@doc:name)]"/>
228     <t:if test="generate-id ($same-name-items) =
229     generate-id (self::node ())">
230     <t:call-template name="index-item">
231     <t:with-param name="items" select="$same-name-items"/>
232     </t:call-template>
233     </t:if>
234     </t:for-each>
235     </ol>
236     </li>
237     </t:if>
238     </t:template>
239    
240     <t:template match="child::doc:insert[@content = 'gnu-fdl-summary']" mode="h2">
241     <t:for-each select="/descendant::doc:insert[@content = 'gnu-fdl']
242     /ancestor::doc:appendix">
243     <t:variable name="id" select="@xml:id"/>
244    
245     <div class="non-para" lang="en" xml:lang="en"
246     >Copyright &#x00A9; <t:value-of select="/child::doc:document/@published-year"
247     /><!-- YOUR NAME -->.</div>
248    
249     <p lang="en" xml:lang="en">Permission is granted to copy, distribute
250     and/or modify this document
251     under the terms of the GNU Free Documentation License, Version 1.1
252     or any later version published by the <a
253     href="http://www.fsf.org/">Free Software Foundation</a>;
254     with no <a href="#{$id}-gnu-fdl-invariant-sections">Invariant Sections</a>,
255     with no <a href="#{$id}-gnu-fdl-front-cover-texts">Front$B!>(BCover Texts</a>,
256     and with no <a href="#{$id}-gnu-fdl-back-cover-texts">Back$B!>(BCover Texts</a>.
257     A copy of the license is included in the section entitled
258     <cite class="section">
259     <a href="#{$id}-gnu-fdl">GNU Free Documentation License</a>
260     </cite>.</p>
261     </t:for-each>
262     </t:template>
263    
264     <t:template match="child::doc:insert[@content = 'gnu-fdl']" mode="h2">
265     <t:variable name="id" select="ancestor::doc:appendix/@xml:id"/>
266     <div class="section document-gnu-fdl" id="{$id}-gnu-fdl"
267     lang="en" xml:lang="en">
268     <h3>GNU Free Documentation License</h3>
269    
270     <div class="non-para">Version 1.1, March 2000</div>
271    
272     <p>
273     <span class="line">Copyright &#x00A9; 2000 Free Software Foundation,
274     Inc.</span>
275     <span class="line">51 Franklin St, Fifth Floor, Boston, MA 02110-1301
276     USA</span>
277     <span class="line">Everyone is permitted to copy and distribute verbatim
278     copies of this license document, but changing it is not allowed.</span>
279     </p>
280    
281     <div class="section">
282     <h4>0. PREAMBLE</h4>
283    
284     <p>The purpose of this License is to make a manual, textbook, or other written document <q>free</q> in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.</p>
285    
286     <p>This License is a kind of <q>copyleft</q>, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.</p>
287    
288     <p>We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.</p>
289     </div>
290    
291     <div class="section">
292     <h4>1. APPLICABILITY AND DEFINITIONS</h4>
293    
294     <p>This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The <q>Document</q>, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as <q>you</q>.</p>
295    
296     <p>A <q>Modified Version</q> of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.</p>
297    
298     <p>A <q>Secondary Section</q> is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.</p>
299    
300     <p id="{$id}-gnu-fdl-invariant-sections">The <q>Invariant Sections</q> are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.</p>
301    
302     <p>The <q>Cover Texts</q> are certain short passages of text that are listed, as <i id="{$id}-gnu-fdl-front-cover-texts">Front$B!>(BCover Texts</i> or <i id="{$id}-gnu-fdl-back-cover-texts">Back$B!>(BCover Texts</i>, in the notice that says that the Document is released under this License.</p>
303    
304     <p>A <q>Transparent</q> copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not <q>Transparent</q> is called <q>Opaque</q>.</p>
305    
306     <p>Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, <span
307     class="latex">L<span class="latex-a">a</span>T<span
308     class="latex-e">e</span>X</span> input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine$B!>(Bgenerated HTML produced by some word processors for output purposes only.</p>
309    
310     <p>The <q>Title Page</q> means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, <q>Title Page</q> means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.</p>
311     </div>
312    
313     <div class="section">
314     <h4>2. VERBATIM COPYING</h4>
315    
316     <p>You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.</p>
317    
318     <p>You may also lend copies, under the same conditions stated above, and you may publicly display copies.</p>
319     </div>
320    
321     <div class="section">
322     <h4>3. COPYING IN QUANTITY</h4>
323    
324     <p>If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front$B!>(BCover Texts on the front cover, and Back$B!>(BCover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.</p>
325    
326     <p>If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.</p>
327    
328     <p>If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine$B!>(Breadable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly$B!>(Baccessible computer$B!>(Bnetwork location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.</p>
329    
330     <p>It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.</p>
331     </div>
332    
333     <div class="section">
334     <h4>4. MODIFICATIONS</h4>
335    
336     <p>You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:</p>
337    
338     <ul class="has-marker">
339     <li><span class="marker">A.</span> Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.</li>
340     <li><span class="marker">B.</span> List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five).</li>
341     <li><span class="marker">C.</span> State on the Title page the name of the publisher of the Modified Version, as the publisher.</li>
342     <li><span class="marker">D.</span> Preserve all the copyright notices of the Document.</li>
343     <li><span class="marker">E.</span> Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.</li>
344     <li><span class="marker">F.</span> Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.</li>
345     <li><span class="marker">G.</span> Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.</li>
346     <li><span class="marker">H.</span> Include an unaltered copy of this License.</li>
347     <li><span class="marker">I.</span> Preserve the section entitled <q>History</q>, and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled <q>History</q> in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.</li>
348     <li><span class="marker">J.</span> Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the <q>History</q> section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.</li>
349     <li><span class="marker">K.</span> In any section entitled <q>Acknowledgements</q> or <q>Dedications</q>, preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.</li>
350     <li><span class="marker">L.</span> Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.</li>
351     <li><span class="marker">M.</span> Delete any section entitled <q>Endorsements</q>. Such a section may not be included in the Modified Version.</li>
352     <li><span class="marker">N.</span> Do not retitle any existing section as <q>Endorsements</q> or to conflict in title with any Invariant Section.</li>
353     </ul>
354    
355     <p>If the Modified Version includes new front$B!>(Bmatter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.</p>
356    
357     <p>You may add a section entitled <q>Endorsements</q>, provided it contains nothing but endorsements of your Modified Version by various parties$B!=!=(Bfor example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.</p>
358    
359     <p>You may add a passage of up to five words as a Front$B!>(BCover Text, and a passage of up to 25 words as a Back$B!>(BCover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front$B!>(BCover Text and one of Back$B!>(BCover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.</p>
360    
361     <p>The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.</p>
362     </div>
363    
364     <div class="section">
365     <h4>5. COMBINING DOCUMENTS</h4>
366    
367     <p>You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice.</p>
368    
369     <p>The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.</p>
370    
371     <p>In the combination, you must combine any sections entitled <q>History</q> in the various original documents, forming one section entitled <q>History</q>; likewise combine any sections entitled <q>Acknowledgements</q>, and any sections entitled <q>Dedications</q>. You must delete all sections entitled <q>Endorsements.</q></p>
372     </div>
373    
374     <div class="section">
375     <h4>6. COLLECTIONS OF DOCUMENTS</h4>
376    
377     <p>You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.</p>
378    
379     <p>You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.</p>
380     </div>
381    
382     <div class="section">
383     <h4>7. AGGREGATION WITH INDEPENDENT WORKS</h4>
384    
385     <p>A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an <q>aggregate</q>, and this License does not apply to the other self$B!>(Bcontained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document.</p>
386    
387     <p>If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.</p>
388     </div>
389    
390     <div class="section">
391     <h4>8. TRANSLATION</h4>
392    
393     <p>Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.</p>
394     </div>
395    
396     <div class="section">
397     <h4>9. TERMINATION</h4>
398    
399     <p>You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.</p>
400     </div>
401    
402     <div class="section">
403     <h4>10. FUTURE REVISIONS OF THIS LICENSE</h4>
404    
405     <p>The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See <code class="uri"><a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a></code>.</p>
406    
407     <p>Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License <q>or any later version</q> applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.</p>
408     </div>
409     </div>
410     </t:template>
411    
412     <t:template match="child::xhtml2:h" mode="title">
413     <title>
414     <t:apply-templates select="self::*" mode="lang"/>
415     <t:value-of select="self::*"/>
416     </title>
417     </t:template>
418    
419     <t:template match="child::xhtml2:h" mode="attr">
420     <t:value-of select="self::*"/>
421     </t:template>
422    
423     <t:template match="child::xhtml2:h" mode="h1">
424     <h1>
425     <t:apply-templates select="@*"/>
426     <t:apply-templates/>
427     </h1>
428     </t:template>
429    
430     <t:template match="child::xhtml2:h" mode="h2">
431     <h2>
432     <t:apply-templates select="@*"/>
433     <t:number count="html5:section" format="1. "/>
434     <t:apply-templates/>
435     </h2>
436     </t:template>
437    
438     <t:template match="child::xhtml2:h" mode="h3">
439     <h3>
440     <t:apply-templates select="@*"/>
441     <t:number level="multiple" count="html5:section" format="1. "/>
442     <t:apply-templates/>
443     </h3>
444     </t:template>
445    
446     <t:template match="child::xhtml2:h" mode="toc">
447     <span>
448     <t:apply-templates select="@*"/>
449     <t:number level="multiple" count="html5:section" format="1. "/>
450     <t:apply-templates mode="text"/>
451     </span>
452     </t:template>
453    
454     <t:template match="doc:appendix/child::xhtml2:h" mode="h2">
455     <h2>
456     <t:apply-templates select="@*"/>
457     <t:number count="doc:appendix" format="A. "/>
458     <t:apply-templates/>
459     </h2>
460     </t:template>
461    
462     <t:template match="doc:appendix//xhtml2:h" mode="h3">
463     <h3>
464     <t:apply-templates select="@*"/>
465     <t:number count="doc:appendix" format="A."/>
466     <t:number count="html5:section" format="1. "/>
467     <t:apply-templates/>
468     </h3>
469     </t:template>
470    
471     <t:template match="doc:appendix//xhtml2:h" mode="toc">
472     <span>
473     <t:apply-templates select="@*"/>
474     <t:number count="doc:appendix" format="A."/>
475     <t:choose>
476     <t:when test="parent::html5:section">
477     <t:number count="html5:section" format="1. "/>
478     </t:when>
479     <t:otherwise><t:value-of select="' '"/></t:otherwise>
480     </t:choose>
481     <t:apply-templates mode="text"/>
482     </span>
483     </t:template>
484    
485     <t:template match="doc:presection/child::xhtml2:h" mode="h2">
486     <h2>
487     <t:apply-templates select="@*"/>
488     <t:apply-templates/>
489     </h2>
490     </t:template>
491    
492     <t:template match="doc:presection//xhtml2:h" mode="toc">
493     <span>
494     <t:apply-templates select="@*"/>
495     <t:apply-templates mode="text"/>
496     </span>
497     </t:template>
498    
499     <t:template match="doc:quote//xhtml2:h">
500     <h4>
501     <t:apply-templates select="@*"/>
502     <t:apply-templates/>
503     </h4>
504     </t:template>
505    
506     <t:template match="child::html5:section" mode="h1">
507     <div class="section">
508     <t:apply-templates select="@*"/>
509     <t:apply-templates mode="h2"/>
510     </div>
511     </t:template>
512    
513     <t:template match="child::doc:presection" mode="h1">
514     <div class="section">
515     <t:apply-templates select="@*"/>
516     <t:apply-templates mode="h2"/>
517     </div>
518     </t:template>
519    
520     <t:template match="child::html5:section" mode="h2">
521     <div class="section">
522     <t:apply-templates select="@*"/>
523     <t:apply-templates mode="h3"/>
524     </div>
525     </t:template>
526    
527     <t:template match="child::html5:section |
528     child::doc:appendix |
529     child::doc:presection" mode="toc">
530     <li class="doc-{local-name ()}">
531     <t:apply-templates select="self::node ()" mode="toc-value"/>
532     </li>
533     </t:template>
534    
535     <t:template match="child::html5:section |
536     child::doc:appendix |
537     child::doc:presection" mode="toc-detail">
538     <li class="doc-{local-name ()}">
539     <t:apply-templates select="self::node ()" mode="toc-value"/>
540     <t:if test="child::html5:section">
541     <ol>
542     <t:apply-templates select="child::html5:section" mode="toc-detail"/>
543     </ol>
544     </t:if>
545     </li>
546     </t:template>
547    
548     <t:template match="child::html5:section |
549     child::doc:appendix |
550     child::doc:presection" mode="toc-value">
551     <span class="doc-{local-name ()}-value">
552     <a href="#{@xml:id}">
553     <t:apply-templates select="child::xhtml2:h" mode="toc"/>
554     </a>
555     <t:if test="child::doc:keyword">
556     <t:value-of select="' ('"/>
557     <t:apply-templates select="child::doc:keyword[position () = 1]"
558     mode="toc"/>
559     <t:if test="child::doc:keyword[position () = 2]">
560     <t:for-each select="child::doc:keyword[position () != 1]">
561     <t:value-of select="', '"/>
562     <t:apply-templates select="self::node ()" mode="toc"/>
563     </t:for-each>
564     </t:if>
565     <t:value-of select="')'"/>
566     </t:if>
567     </span>
568     </t:template>
569    
570     <t:template match="child::html5:section" mode="answer-h3">
571     <t:if test="child::doc:exercise">
572     <div class="section">
573     <t:apply-templates select="child::xhtml2:h" mode="h3"/>
574     <t:apply-templates select="child::doc:exercise" mode="answer-h4"/>
575     </div>
576     </t:if>
577     </t:template>
578    
579     <t:template match="child::doc:appendix" mode="h1">
580     <div class="section appendix">
581     <t:apply-templates select="@*"/>
582     <t:apply-templates mode="h2"/>
583     </div>
584     </t:template>
585    
586     <t:template match="child::doc:appendix" mode="h2">
587     <div class="section appendix">
588     <t:apply-templates select="@*"/>
589     <t:apply-templates mode="h3"/>
590     </div>
591     </t:template>
592    
593     <t:template match="child::doc:b">
594     <div class="doc-section-body">
595     <t:apply-templates select="@*"/>
596     <t:apply-templates/>
597     </div>
598     </t:template>
599    
600     <t:template match="child::doc:keyword" mode="h2"/>
601    
602     <t:template match="child::doc:keyword" mode="toc">
603     <span class="doc-keyword">
604     <t:apply-templates select="@*"/>
605     <t:apply-templates/>
606     </span>
607     </t:template>
608    
609     <t:template match="child::doc:preamble">
610     <div class="doc-preamble">
611     <t:apply-templates select="@*"/>
612     <t:apply-templates/>
613     </div>
614     </t:template>
615     <t:template match="child::doc:preamble" mode="h1">
616     <t:apply-templates select="self::node ()"/>
617     </t:template>
618     <t:template match="child::doc:preamble" mode="h2">
619     <t:apply-templates select="self::node ()"/>
620     </t:template>
621     <t:template match="child::doc:preamble" mode="h3">
622     <t:apply-templates select="self::node ()"/>
623     </t:template>
624    
625     <t:template match="child::doc:postamble" mode="h2">
626     <div class="doc-postamble">
627     <t:apply-templates select="@*"/>
628     <t:apply-templates/>
629     </div>
630     </t:template>
631    
632     <t:template match="child::doc:exercise" mode="h2">
633     <div class="section doc-exercise"
634     id="{ancestor::html5:section/@xml:id}-exercise">
635     <t:apply-templates select="@*"/>
636     <h2 lang="ja" xml:lang="ja">$B1i=,LdBj(B</h2>
637     <t:apply-templates mode="h3"/>
638     </div>
639     </t:template>
640    
641     <t:template match="child::doc:exercise" mode="answer-h4">
642     <t:apply-templates select="child::doc:problem" mode="answer-h4"/>
643     </t:template>
644    
645     <t:template match="child::doc:problem" mode="h3">
646     <div class="section doc-problem">
647     <t:apply-templates select="@*"/>
648     <h3 lang="ja" xml:lang="ja">$BLd(B<t:number count="doc:problem" format="1"/></h3>
649     <t:apply-templates/>
650     </div>
651     </t:template>
652    
653     <t:template match="child::doc:problem" mode="answer-h4">
654     <div class="section doc-problem" id="answers-{@xml:id}">
655     <h4 lang="ja" xml:lang="ja">
656     <a href="#{@xml:id}">$BLd(B<t:number count="doc:problem" format="1"/></a>
657     </h4>
658     <t:choose>
659     <t:when test="child::doc:answer">
660     <t:apply-templates select="child::doc:answer" mode="answer"/>
661     </t:when>
662     <t:otherwise>
663     <p>$B>JN,!#(B</p>
664     </t:otherwise>
665     </t:choose>
666     </div>
667     </t:template>
668    
669     <t:template match="child::doc:answer"/>
670    
671     <t:template match="child::doc:answer" mode="answer">
672     <t:apply-templates/>
673     </t:template>
674    
675     <t:template match="child::doc:note">
676     <div class="info memo">
677     <t:apply-templates select="@*"/>
678     <t:apply-templates/>
679     </div>
680     </t:template>
681     <t:template match="child::doc:note" mode="h2">
682     <t:apply-templates select="self::node ()"/>
683     </t:template>
684     <t:template match="child::doc:note" mode="h3">
685     <t:apply-templates select="self::node ()"/>
686     </t:template>
687    
688     <t:template match="child::doc:ed">
689     <div class="info memo ed" id="ed-{generate-id (self::node ())}">
690     <t:apply-templates select="@*"/>
691     <t:apply-templates/>
692     </div>
693     </t:template>
694     <t:template match="child::doc:ed" mode="h1">
695     <t:apply-templates select="self::node ()"/>
696     </t:template>
697     <t:template match="child::doc:ed" mode="h2">
698     <t:apply-templates select="self::node ()"/>
699     </t:template>
700     <t:template match="child::doc:ed" mode="h3">
701     <t:apply-templates select="self::node ()"/>
702     </t:template>
703    
704     <t:template match="child::doc:todo">
705     <div class="info memo ed todo" id="ed-{generate-id (self::node ())}">
706     <t:apply-templates select="@*"/>
707     <t:apply-templates/>
708     </div>
709     </t:template>
710     <t:template match="child::doc:todo" mode="h1">
711     <t:apply-templates select="self::node ()"/>
712     </t:template>
713     <t:template match="child::doc:todo" mode="h2">
714     <t:apply-templates select="self::node ()"/>
715     </t:template>
716     <t:template match="child::doc:todo" mode="h3">
717     <t:apply-templates select="self::node ()"/>
718     </t:template>
719    
720     <t:template match="doc:ed | doc:todo" mode="todo-list">
721     <li>
722     <t:if test="ancestor::html5:section | ancestor::doc:appendix">
723     <t:value-of select="'$B!x(B'"/>
724     <t:if test="ancestor::doc:appendix">
725     <t:number count="doc:appendix" format="A"/>
726     <t:if test="ancestor::html5:section">
727     <t:value-of select="'.'"/>
728     </t:if>
729     </t:if>
730     <t:number count="html5:section" level="multiple" format="1.1"/>
731     <t:value-of select="' '"/>
732     </t:if>
733     <a href="#ed-{generate-id (self::node ())}">
734     <t:value-of select="substring (normalize-space (self::node ()), 0, 30)"/>
735     <t:if test="string-length (normalize-space (self::node ())) > 30">
736     <span class="snip">...</span>
737     </t:if>
738     </a>
739     </li>
740     </t:template>
741    
742     <t:template match="child::doc:keyPoints">
743     <div class="doc-key-points" id="{parent::node ()/@xml:id}-keypoints">
744     <t:apply-templates select="@*"/>
745     <div class="caption">$B!x(B<t:number count="html5:section" level="multiple"
746     format="1.1"/> $B$N$^$H$a(B</div>
747     <ul>
748     <t:apply-templates/>
749     </ul>
750     </div>
751     </t:template>
752     <t:template match="child::doc:keyPoints" mode="h2">
753     <t:apply-templates select="self::node ()"/>
754     </t:template>
755     <t:template match="child::doc:keyPoints" mode="h3">
756     <t:apply-templates select="self::node ()"/>
757     </t:template>
758    
759     <t:template match="child::doc:keyPoints" mode="toc-keypoints">
760     <li>
761     <a href="#{parent::node ()/@xml:id}-keypoints"
762     >$B!x(B<t:number count="html5:section" level="multiple"
763     format="1.1"/> <cite class="section">
764     <t:apply-templates select="parent::node ()/child::xhtml2:h/@*" mode="text"/>
765     <t:apply-templates select="parent::node ()/child::xhtml2:h/child::node ()"
766     mode="text"/>
767     </cite>$B$N$^$H$a(B</a>
768     </li>
769     </t:template>
770    
771     <t:template match="child::html5:ul">
772     <ul>
773     <t:apply-templates select="@*"/>
774     <t:apply-templates/>
775     </ul>
776     </t:template>
777     <t:template match="child::html5:ol">
778     <ol>
779     <t:apply-templates select="@*"/>
780     <t:apply-templates/>
781     </ol>
782     </t:template>
783     <t:template match="child::html5:dl">
784     <dl>
785     <t:apply-templates select="@*"/>
786     <t:apply-templates/>
787     </dl>
788     </t:template>
789     <t:template match="child::html5:ul |
790     child::html5:ol |
791     child::html5:dl" mode="h2">
792     <t:apply-templates select="self::node ()"/>
793     </t:template>
794     <t:template match="child::html5:ul |
795     child::html5:ol |
796     child::html5:dl" mode="h3">
797     <t:apply-templates select="self::node ()"/>
798     </t:template>
799    
800     <t:template match="child::html5:li">
801     <li>
802     <t:apply-templates select="@*"/>
803     <t:apply-templates/>
804     </li>
805     </t:template>
806    
807     <t:template match="child::xhtml2:di">
808     <!--<di>
809     <t:apply-templates select="@*"/>-->
810     <t:apply-templates/>
811     <!--</di>-->
812     </t:template>
813    
814     <t:template match="child::html5:dt">
815     <dt>
816     <t:apply-templates select="@*"/>
817     <t:apply-templates/>
818     </dt>
819     </t:template>
820    
821     <t:template match="child::html5:dd">
822     <dd>
823     <t:apply-templates select="@*"/>
824     <t:apply-templates/>
825     </dd>
826     </t:template>
827    
828     <t:template match="child::doc:quote">
829     <div class="fig quote">
830     <t:apply-templates select="@*"/>
831     <t:apply-templates/>
832     </div>
833     </t:template>
834     <t:template match="child::doc:quote" mode="h2">
835     <t:apply-templates select="self::node ()"/>
836     </t:template>
837     <t:template match="child::doc:quote" mode="h3">
838     <t:apply-templates select="self::node ()"/>
839     </t:template>
840    
841     <t:template match="child::doc:quote" mode="toc-figures">
842     <li>
843     <a href="#{@xml:id}">
844     <t:apply-templates select="child::doc:quoteCredit" mode="toc"/>
845     </a>
846     </li>
847     </t:template>
848    
849     <t:template match="doc:miniColumn" mode="figure-number"/>
850    
851     <t:template match="child::doc:quoteBody">
852     <blockquote><!-- @@ html5 semantics ?? -->
853     <t:apply-templates select="@*"/>
854     <t:apply-templates/>
855     </blockquote>
856     </t:template>
857    
858     <t:template match="child::doc:quoteCredit">
859     <div class="credit">
860     <t:apply-templates select="@*"/>
861     <t:apply-templates/>
862     </div>
863     </t:template>
864    
865     <t:template match="child::doc:quoteCredit" mode="toc">
866     <span lang="ja" xml:lang="ja">$B0zMQ(B</span>
867     <t:value-of select="' '"/>
868     <span>
869     <t:apply-templates select="@*" mode="text"/>
870     <t:apply-templates mode="text"/>
871     </span>
872     </t:template>
873    
874     <t:template match="child::doc:quoteCredit" mode="text">
875     <span lang="ja" xml:lang="ja">$B0zMQ(B</span>
876     <t:value-of select="' '"/>
877     <span>
878     <t:apply-templates select="@*" mode="text"/>
879     <t:apply-templates mode="text"/>
880     </span>
881     </t:template>
882    
883     <t:template match="child::doc:quoteCredit" mode="attr">
884     <t:value-of select="'$B0zMQ(B '"/>
885     <t:apply-templates mode="attr"/>
886     </t:template>
887    
888     <t:template match="child::doc:fig">
889     <div class="fig">
890     <t:apply-templates select="@*"/>
891     <t:apply-templates/>
892     </div>
893     </t:template>
894     <t:template match="child::doc:fig" mode="h2">
895     <t:apply-templates select="self::node ()"/>
896     </t:template>
897     <t:template match="child::doc:fig" mode="h3">
898     <t:apply-templates select="self::node ()"/>
899     </t:template>
900    
901     <t:template match="child::doc:fig" mode="clone">
902     <div class="fig doc-clone">
903     <t:apply-templates select="@*[not (namespace-uri () = 'http://www.w3.org/XML/1998/namespace' and local-name () = 'id')]"/>
904     <t:apply-templates mode="clone"/>
905     </div>
906     </t:template>
907    
908     <t:template match="child::doc:fig |
909     child::doc:example" mode="toc-figures">
910     <li>
911     <a href="#{@xml:id}">
912     <t:apply-templates select="child::doc:caption" mode="toc"/>
913     </a>
914     </li>
915     </t:template>
916    
917     <t:template match="doc:fig |
918     doc:example" mode="figure-number">
919     <span lang="ja" xml:lang="ja">$B?^(B</span>
920     <t:value-of select="' '"/>
921     <t:if test="ancestor::doc:appendix">
922     <t:number count="doc:appendix" format="A."/>
923     </t:if>
924     <t:number level="multiple" count="html5:section" format="1.1"/>
925     <t:number count="doc:fig | doc:example" format=".1"/>
926     </t:template>
927    
928     <t:template match="doc:fig |
929     doc:example" mode="figure-number-attr">
930     <t:value-of select="'$B?^(B '"/>
931     <t:if test="ancestor::doc:appendix">
932     <t:number count="doc:appendix" format="A."/>
933     </t:if>
934     <t:number level="multiple" count="html5:section" format="1.1"/>
935     <t:number count="doc:fig | doc:example" format=".1"/>
936     </t:template>
937    
938     <t:template match="child::doc:figBody">
939     <div class="fig-body">
940     <t:apply-templates select="@*"/>
941     <t:apply-templates/>
942     </div>
943     </t:template>
944     <t:template match="child::doc:figBody" mode="clone">
945     <t:apply-templates select="self::node ()"/>
946     </t:template>
947    
948     <t:template match="child::doc:figClone">
949     <t:apply-templates mode="clone"
950     select="/descendant::doc:fig[string (@xml:id) = string (current ()/@of)]"/>
951     </t:template>
952     <t:template match="child::doc:figClone" mode="h2">
953     <t:apply-templates select="self::node ()"/>
954     </t:template>
955     <t:template match="child::doc:figClone" mode="h3">
956     <t:apply-templates select="self::node ()"/>
957     </t:template>
958    
959     <t:template match="child::doc:example">
960     <div class="example">
961     <t:apply-templates select="@*"/>
962     <t:apply-templates/>
963     </div>
964     </t:template>
965     <t:template match="child::doc:example" mode="h2">
966     <t:apply-templates select="self::node ()"/>
967     </t:template>
968     <t:template match="child::doc:example" mode="h3">
969     <t:apply-templates select="self::node ()"/>
970     </t:template>
971    
972     <t:template match="child::doc:miniColumn" mode="h3">
973     <div class="doc-mini-column">
974     <t:apply-templates select="@*"/>
975     <t:apply-templates/>
976     </div>
977     </t:template>
978    
979     <t:template match="child::doc:miniColumn" mode="toc-columns">
980     <li>
981     <a href="#{@xml:id}">
982     <t:apply-templates select="child::doc:caption" mode="toc"/>
983     </a>
984     </li>
985     </t:template>
986    
987     <t:template match="doc:miniColumn" mode="figure-number"/>
988    
989     <t:template match="child::doc:caption">
990     <div class="caption">
991     <t:apply-templates select="@*"/>
992     <t:apply-templates/>
993     </div>
994     </t:template>
995    
996     <t:template match="doc:fig/doc:caption |
997     doc:example/doc:caption">
998     <div class="caption">
999     <t:apply-templates select="@*"/>
1000     <t:apply-templates select="parent::node ()" mode="figure-number"/>
1001     <t:value-of select="' '"/>
1002     <t:apply-templates/>
1003     </div>
1004     </t:template>
1005    
1006     <t:template match="child::doc:caption" mode="clone">
1007     <div class="caption">
1008     <t:apply-templates select="@*"/>
1009     <t:apply-templates/>
1010     <t:value-of select="' '"/>
1011     <span lang="ja" xml:lang="ja">($B:F7G(B)</span>
1012     </div>
1013     </t:template>
1014    
1015     <t:template match="doc:fig/doc:caption |
1016     doc:example/doc:caption" mode="clone">
1017     <div class="caption">
1018     <t:apply-templates select="@*"/>
1019     <t:apply-templates select="parent::node ()" mode="figure-number"/>
1020     <t:value-of select="' '"/>
1021     <t:apply-templates/>
1022     <t:value-of select="' '"/>
1023     <span lang="ja" xml:lang="ja">($B:F7G(B)</span>
1024     </div>
1025     </t:template>
1026    
1027     <t:template match="child::doc:caption" mode="toc">
1028     <t:apply-templates select="parent::node ()" mode="figure-number"/>
1029     <t:value-of select="' '"/>
1030     <span>
1031     <t:apply-templates select="@*" mode="text"/>
1032     <t:apply-templates mode="text"/>
1033     </span>
1034     </t:template>
1035    
1036     <t:template match="child::doc:caption" mode="text">
1037     <t:apply-templates select="parent::node ()" mode="figure-number"/>
1038     <t:value-of select="' '"/>
1039     <cite class="section">
1040     <t:apply-templates select="@*" mode="text"/>
1041     <t:apply-templates mode="text"/>
1042     </cite>
1043     </t:template>
1044    
1045     <t:template match="child::doc:caption" mode="attr">
1046     <t:apply-templates select="parent::node ()" mode="figure-number-attr"/>
1047     <t:value-of select="' $B!V(B'"/>
1048     <t:apply-templates mode="attr"/>
1049     <t:value-of select="'$B!W(B'"/>
1050     </t:template>
1051    
1052     <t:template match="child::html5:p">
1053     <p>
1054     <t:apply-templates select="@*"/>
1055     <t:apply-templates/>
1056     </p>
1057     </t:template>
1058     <t:template match="child::html5:p" mode="h2">
1059     <p>
1060     <t:apply-templates select="@*"/>
1061     <t:apply-templates/>
1062     </p>
1063     </t:template>
1064     <t:template match="child::html5:p" mode="h3">
1065     <p>
1066     <t:apply-templates select="@*"/>
1067     <t:apply-templates/>
1068     </p>
1069     </t:template>
1070    
1071     <t:template match="html5:p//doc:syntax">
1072     <span class="block tutorial-syntax">
1073     <t:apply-templates select="@*"/>
1074     <t:apply-templates/>
1075     </span>
1076     </t:template>
1077    
1078     <t:template match="child::doc:snip">
1079     <div class="non-para snip">
1080     <t:apply-templates select="@*"/>
1081     <t:choose>
1082     <t:when test="child::node ()">
1083     <t:apply-templates/>
1084     </t:when>
1085     <t:otherwise>
1086     <t:attribute name="lang">ja</t:attribute>
1087     <t:attribute name="xml:lang">ja</t:attribute>
1088     <t:value-of select="'($BCfN,(B)'"/>
1089     </t:otherwise>
1090     </t:choose>
1091     </div>
1092     </t:template>
1093    
1094     <t:template match="html5:p//doc:snip | html5:li//doc:snip |
1095     tree:content//doc:snip | tree:leaf//doc:snip |
1096     doc:htmlCode//doc:snip">
1097     <span class="snip">
1098     <t:apply-templates select="@*"/>
1099     <t:choose>
1100     <t:when test="child::node ()">
1101     <t:apply-templates/>
1102     </t:when>
1103     <t:otherwise>
1104     <t:attribute name="lang">ja</t:attribute>
1105     <t:attribute name="xml:lang">ja</t:attribute>
1106     <t:value-of select="'$B!&!&!&!&!&!&(B'"/>
1107     </t:otherwise>
1108     </t:choose>
1109     </span>
1110     </t:template>
1111    
1112     <t:template match="child::tree:root">
1113     <ol class="xoxo">
1114     <t:apply-templates select="@*"/>
1115     <li class="tree-root doc-node-type-{@doc:nodeType}">
1116     <t:apply-templates select="child::tree:content"/>
1117     <t:if test="child::tree:leaf | child::tree:node">
1118     <ol>
1119     <t:apply-templates select="child::tree:leaf | child::tree:node"/>
1120     </ol>
1121     </t:if>
1122     </li>
1123     </ol>
1124     </t:template>
1125    
1126     <t:template match="child::tree:node">
1127     <li class="tree-node doc-node-type-{@doc:nodeType}">
1128     <t:apply-templates select="@*"/>
1129     <t:apply-templates select="child::tree:content"/>
1130     <t:if test="child::tree:leaf | child::tree:node">
1131     <ol>
1132     <t:apply-templates select="child::tree:leaf | child::tree:node"/>
1133     </ol>
1134     </t:if>
1135     </li>
1136     </t:template>
1137    
1138     <t:template match="child::tree:content">
1139     <div class="non-para tree-content">
1140     <t:apply-templates select="@*"/>
1141     <t:apply-templates/>
1142     </div>
1143     </t:template>
1144    
1145     <t:template match="child::tree:leaf">
1146     <li class="tree-leaf doc-node-type-{@doc:nodeType}">
1147     <t:apply-templates select="@*"/>
1148     <t:apply-templates/>
1149     </li>
1150     </t:template>
1151    
1152     <t:template match="@doc:nodeType"/>
1153    
1154     <t:template match="child::doc:he">
1155     <code class="HTMLe">
1156     <t:apply-templates select="@*"/>
1157     <t:choose>
1158     <t:when test="not (parent::html5:dfn) and
1159     not (parent::doc:iw) and
1160     not (parent::doc:markRef) and
1161     /descendant::html5:dfn
1162     [string (@doc:name) = concat ('html-', string (current ()))]">
1163     <a href="#dt-html-{string (self::*)}">
1164     <t:apply-templates/>
1165     </a>
1166     </t:when>
1167     <t:otherwise>
1168     <t:apply-templates/>
1169     </t:otherwise>
1170     </t:choose>
1171     </code>
1172     </t:template>
1173    
1174     <t:template match="child::doc:he" mode="text">
1175     <code class="HTMLe">
1176     <t:apply-templates select="@*"/>
1177     <t:apply-templates/>
1178     </code>
1179     <t:value-of select="' '"/>
1180     <span lang="ja" xml:lang="ja">(<abbr
1181     lang="en" xml:lang="en" title="Hypertext Markup Language">HTML</abbr>
1182     $BMWAG7?(B)</span>
1183     </t:template>
1184    
1185     <t:template match="child::doc:ha">
1186     <code class="HTMLa">
1187     <t:apply-templates select="@*"/>
1188     <t:choose>
1189     <t:when test="@name and
1190     not (parent::html5:dfn) and
1191     not (parent::doc:iw) and
1192     not (parent::doc:markRef) and
1193     /descendant::html5:dfn
1194     [string (@doc:name) = string (current ()/@name)]">
1195     <a href="#dt-{string (@name)}">
1196     <t:apply-templates/>
1197     </a>
1198     </t:when>
1199     <t:when test="not (parent::html5:dfn) and
1200     not (parent::doc:iw) and
1201     not (parent::doc:markRef) and
1202     /descendant::html5:dfn
1203     [string (@doc:name) =
1204     concat ('html-attr-', string (current ()))]">
1205     <a href="#dt-html-attr-{string (self::*)}">
1206     <t:apply-templates/>
1207     </a>
1208     </t:when>
1209     <t:otherwise>
1210     <t:apply-templates/>
1211     </t:otherwise>
1212     </t:choose>
1213     </code>
1214     </t:template>
1215     <t:template match="doc:ha/@name"/>
1216    
1217     <t:template match="child::doc:ha" mode="text">
1218     <code class="HTMLa">
1219     <t:apply-templates select="@*"/>
1220     <t:apply-templates/>
1221     </code>
1222     <t:value-of select="' '"/>
1223     <span lang="ja" xml:lang="ja">(<abbr
1224     lang="en" xml:lang="en" title="Hypertext Markup Language">HTML</abbr>
1225     $BB0@-(B)</span>
1226     </t:template>
1227     <t:template match="doc:ha/@name" mode="text"/>
1228    
1229    
1230     <t:template match="child::doc:cp">
1231     <code class="CSS">
1232     <t:apply-templates select="@*"/>
1233     <t:choose>
1234     <t:when test="not (parent::html5:dfn) and
1235     not (parent::doc:iw) and
1236     not (parent::doc:markRef) and
1237     /descendant::html5:dfn
1238     [string (@doc:name) =
1239     concat ('css-prop-', string (current ()))]">
1240     <a href="#dt-css-prop-{string (self::*)}">
1241     <t:apply-templates/>
1242     </a>
1243     </t:when>
1244     <t:otherwise>
1245     <t:apply-templates/>
1246     </t:otherwise>
1247     </t:choose>
1248     </code>
1249     </t:template>
1250    
1251     <t:template match="child::doc:cp" mode="text">
1252     <code class="CSS">
1253     <t:apply-templates select="@*"/>
1254     <t:apply-templates/>
1255     </code>
1256     <t:value-of select="' '"/>
1257     <span lang="ja" xml:lang="ja">(<abbr
1258     lang="en" xml:lang="en" title="Cascading Style Sheets">CSS</abbr>
1259     $BFC@-(B)</span>
1260     </t:template>
1261    
1262     <t:template match="child::html5:dfn">
1263     <dfn>
1264     <t:apply-templates select="@*"/>
1265     <t:apply-templates/>
1266     </dfn>
1267     </t:template>
1268    
1269     <t:template name="index-item">
1270     <t:param name="items"/>
1271     <t:variable name="rep-item"
1272     select="$items[self::html5:dfn and position () = 1]"/>
1273     <t:variable name="other-item"
1274     select="$items[not (self::html5:dfn and position () = 1)]"/>
1275     <li>
1276     <span class="doc-index-item">
1277     <t:choose>
1278     <t:when test="$rep-item">
1279     <t:for-each select="$rep-item">
1280     <a href="#dt-{self::doc:*/@name | @doc:name}">
1281     <t:apply-templates select="@xml:lang"/>
1282     <t:apply-templates mode="text"/>
1283     </a>
1284     </t:for-each>
1285     </t:when>
1286     <t:otherwise>
1287     <a>
1288     <t:apply-templates select="@xml:lang"/>
1289     <t:apply-templates select="$items[position () = 1]/child::node ()"
1290     mode="text"/>
1291     </a>
1292     </t:otherwise>
1293     </t:choose>
1294     <t:if test="self::doc:*/@en | @doc:en">
1295     <t:value-of select="' ('"/>
1296     <span lang="en" xml:lang="en">
1297     <t:value-of select="self::doc:*/@en | @doc:en"/>
1298     </span>
1299     <t:value-of select="')'"/>
1300     </t:if>
1301     </span>
1302    
1303     <span class="doc-index-page">
1304     <t:value-of select="' '"/>
1305     <t:apply-templates select="$items[position () = 1]" mode="index-page"/>
1306     <t:for-each select="$items[position () != 1]">
1307     <t:value-of select="', '"/>
1308     <t:apply-templates select="self::node ()" mode="index-page"/>
1309     </t:for-each>
1310     </span>
1311     </li>
1312     </t:template>
1313    
1314     <t:template match="html5:dfn" mode="index-page">
1315     <em><a href="#dt-{@doc:name}">
1316     <t:apply-templates select="self::node ()" mode="index-page-section"/>
1317     </a></em>
1318     </t:template>
1319    
1320     <t:template match="doc:iw" mode="index-page">
1321     <a href="#index-{generate-id (self::node ())}">
1322     <t:apply-templates select="self::node ()" mode="index-page-section"/>
1323     </a>
1324     </t:template>
1325    
1326     <t:template match="html5:dfn | doc:iw" mode="index-page-section">
1327     <t:attribute name="title">
1328     <t:choose>
1329     <t:when test="ancestor::html5:section">
1330     <t:apply-templates select="ancestor::html5:section[position () = 1]/
1331     child::xhtml2:h" mode="attr"/>
1332     </t:when>
1333     <t:when test="ancestor::doc:presection">
1334     <t:apply-templates select="ancestor::doc:presection[position () = 1]/
1335     child::xhtml2:h" mode="attr"/>
1336     </t:when>
1337     <t:otherwise>
1338     <t:apply-templates select="ancestor::doc:appendix[position () = 1]/
1339     child::xhtml2:h" mode="attr"/>
1340     </t:otherwise>
1341     </t:choose>
1342     </t:attribute>
1343     <t:value-of select="'$B!x(B'"/>
1344     <t:if test="ancestor::doc:appendix">
1345     <t:number count="doc:appendix" format="A."/>
1346     </t:if>
1347     <t:number count="html5:section" level="multiple" format="1.1"/>
1348     <t:if test="ancestor::doc:note">
1349     <t:value-of select="' '"/>
1350     <span lang="ja" xml:lang="ja">$B%a%b(B</span>
1351     </t:if>
1352     </t:template>
1353    
1354     <t:template match="html5:dfn/@doc:name" mode="text"/>
1355     <t:template match="html5:dfn/@doc:key" mode="text"/>
1356     <t:template match="html5:dfn/@doc:en" mode="text"/>
1357     <t:template match="doc:iw/@name" mode="text"/>
1358     <t:template match="doc:iw/@key" mode="text"/>
1359     <t:template match="doc:iw/@en" mode="text"/>
1360    
1361     <t:template match="html5:dfn/@doc:name">
1362     <t:attribute name="id">dt-<t:value-of select="self::node ()"/></t:attribute>
1363     </t:template>
1364    
1365     <t:template match="html5:dfn/@doc:en | html5:i/@doc:en | doc:iw/@en">
1366     <t:attribute name="title"><t:value-of select="self::node ()"/></t:attribute>
1367     </t:template>
1368    
1369     <t:template match="child::html5:dfn/@doc:key"/>
1370    
1371     <t:template match="child::doc:iw | child::html5:i">
1372     <t:variable name="dfn" select="/descendant::html5:dfn[(string (@doc:name) = string (current ()/self::doc:iw/@name | current ()/self::html5:i/@doc:name)) or (string (self::*) = string (current ()))] [position () = 1]"/>
1373     <i>
1374     <t:apply-templates select="@*"/>
1375     <t:if test="self::doc:iw and not (@xml:id)">
1376     <t:attribute name="id">
1377     <t:value-of select="'index-'"/>
1378     <t:value-of select="generate-id (self::node ())"/>
1379     </t:attribute>
1380     </t:if>
1381     <t:choose>
1382     <t:when test="$dfn and not (ancestor::doc:markRef)">
1383     <a href="#dt-{$dfn/@doc:name}" rel="glossary">
1384     <t:apply-templates/>
1385     </a>
1386     </t:when>
1387     <t:otherwise>
1388     <t:apply-templates/>
1389     </t:otherwise>
1390     </t:choose>
1391     </i>
1392     </t:template>
1393    
1394     <t:template match="child::html5:i" mode="text">
1395     <i>
1396     <t:apply-templates select="@*"/>
1397     <t:apply-templates/>
1398     </i>
1399     </t:template>
1400    
1401     <t:template match="child::html5:i" mode="attr">
1402     <t:apply-templates mode="attr"/>
1403     </t:template>
1404    
1405     <t:template match="child::html5:i/@doc:name"/>
1406     <t:template match="child::doc:iw/@name"/>
1407     <t:template match="child::doc:iw/@key"/>
1408    
1409     <t:template match="child::doc:iref[@section]">
1410     <t:variable name="target"
1411     select="(/descendant::html5:section | /descendant::doc:appendix |
1412     /descendant::doc:presection)
1413     [string (@xml:id) = string (current ()/@section)]"/>
1414     <a class="doc-iref-section">
1415     <t:if test="$target">
1416     <t:attribute name="href">#<t:value-of select="@section"/></t:attribute>
1417     </t:if>
1418     <t:apply-templates select="@*"/>
1419     <t:choose>
1420     <t:when test="child::node ()">
1421     <t:attribute name="title">
1422     <t:value-of select="$target/child::xhtml2:h"/>
1423     </t:attribute>
1424     <t:apply-templates/>
1425     </t:when>
1426     <t:otherwise>
1427     <t:for-each select="$target">
1428     <t:choose>
1429     <t:when test="$target/ancestor-or-self::doc:appendix">
1430     <t:number count="doc:appendix" format="$B!x(BA"/>
1431     <t:if test="$target/self::html5:section">
1432     <t:number level="multiple" count="html5:section" format=".1"/>
1433     </t:if>
1434     <t:value-of select="' '"/>
1435     </t:when>
1436     <t:when test="$target/ancestor-or-self::doc:presection"/>
1437     <t:otherwise>
1438     <t:number level="multiple" count="html5:section" format="$B!x(B1.1 "/>
1439     </t:otherwise>
1440     </t:choose>
1441     <cite class="section"><t:value-of select="child::xhtml2:h"/></cite>
1442     </t:for-each>
1443     </t:otherwise>
1444     </t:choose>
1445     </a>
1446     </t:template>
1447     <t:template match="doc:iref[@section]/@section"/>
1448    
1449     <t:template match="child::doc:iref[@fig]">
1450     <t:variable name="target"
1451     select="/descendant::doc:fig
1452     [string (@xml:id) = string (current ()/@fig)]"/>
1453     <a class="doc-iref-fig">
1454     <t:if test="$target">
1455     <t:attribute name="href">#<t:value-of select="@fig"/></t:attribute>
1456     </t:if>
1457     <t:apply-templates select="@*"/>
1458     <t:choose>
1459     <t:when test="child::node ()">
1460     <t:attribute name="title">
1461     <t:apply-templates select="$target/child::doc:caption" mode="attr"/>
1462     </t:attribute>
1463     <t:apply-templates/>
1464     </t:when>
1465     <t:otherwise>
1466     <t:apply-templates select="$target/child::doc:caption" mode="text"/>
1467     </t:otherwise>
1468     </t:choose>
1469     </a>
1470     </t:template>
1471     <t:template match="doc:iref[@fig]/@fig"/>
1472    
1473    
1474     <t:template match="child::doc:iref[@quote]">
1475     <t:variable name="target"
1476     select="/descendant::doc:quote
1477     [string (@xml:id) = string (current ()/@quote)]"/>
1478     <a class="doc-iref-quote">
1479     <t:if test="$target">
1480     <t:attribute name="href">#<t:value-of select="@quote"/></t:attribute>
1481     </t:if>
1482     <t:apply-templates select="@*"/>
1483     <t:choose>
1484     <t:when test="child::node ()">
1485     <t:attribute name="title">
1486     <t:apply-templates select="$target/child::doc:quoteCredit" mode="attr"/>
1487     </t:attribute>
1488     <t:apply-templates/>
1489     </t:when>
1490     <t:otherwise>
1491     <t:apply-templates select="$target" mode="figure-number"/>
1492     <t:apply-templates select="$target/child::doc:quoteCredit" mode="text"/>
1493     </t:otherwise>
1494     </t:choose>
1495     </a>
1496     </t:template>
1497     <t:template match="doc:iref[@quote]/@quote"/>
1498    
1499     <t:template match="doc:quote" mode="figure-number"/>
1500    
1501     <t:template match="child::doc:iref[@problem]">
1502     <t:variable name="target"
1503     select="/descendant::doc:problem
1504     [string (@xml:id) = string (current ()/@problem)]"/>
1505     <a class="doc-iref-problem">
1506     <t:if test="$target">
1507     <t:attribute name="href">#<t:value-of select="@problem"/></t:attribute>
1508     </t:if>
1509     <t:apply-templates select="@*"/>
1510     <t:choose>
1511     <t:when test="child::node ()">
1512     <t:attribute name="title">
1513     <t:value-of select="'$BLd(B'"/>
1514     <t:for-each select="$target">
1515     <t:number count="doc:problem"/>
1516     </t:for-each>
1517     </t:attribute>
1518     <t:apply-templates/>
1519     </t:when>
1520     <t:otherwise>
1521     <span class="section" lang="ja" xml:lang="ja">
1522     <t:value-of select="'$BLd(B'"/>
1523     <t:for-each select="$target">
1524     <t:number count="doc:problem"/>
1525     </t:for-each>
1526     </span>
1527     </t:otherwise>
1528     </t:choose>
1529     </a>
1530     </t:template>
1531     <t:template match="doc:iref[@problem]/@problem"/>
1532    
1533     <t:template match="child::html5:em | child::html5:q |
1534     child::html5:code | child::html5:var |
1535     child::html5:abbr | child::html5:span |
1536     child::xhtml1:rb | child::xhtml1:rt |
1537     child::html5:blockquote">
1538     <t:element namespace="{namespace-uri ()}" name="{local-name ()}">
1539     <t:apply-templates select="@*"/>
1540     <t:apply-templates/>
1541     </t:element>
1542     </t:template>
1543    
1544     <t:template match="child::html5:abbr |
1545     child::html5:code" mode="text">
1546     <t:apply-templates select="self::node ()"/>
1547     </t:template>
1548    
1549     <t:template match="child::html5:abbr" mode="attr">
1550     <t:apply-templates mode="attr"/>
1551     </t:template>
1552    
1553     <t:template match="child::html5:em" mode="text">
1554     <t:apply-templates/>
1555     </t:template>
1556    
1557     <t:template match="child::html5:m" mode="text">
1558     <t:apply-templates/>
1559     </t:template>
1560    
1561     <t:template match="child::html5:q" mode="text">
1562     <q>
1563     <t:apply-templates select="@*"/>
1564     <t:apply-templates/>
1565     </q>
1566     </t:template>
1567    
1568     <t:template match="child::xhtml1:ruby">
1569     <ruby>
1570     <t:apply-templates select="@*"/>
1571     <t:apply-templates select="child::xhtml1:rb"/>
1572     <rp> (</rp>
1573     <t:apply-templates select="child::xhtml1:rt[position () = 1]"/>
1574     <t:if test="child::xhtml1:rt[position () = 2]">
1575     <rp> / </rp>
1576     <t:apply-templates select="child::xhtml1:rt[position () = 2]"/>
1577     </t:if>
1578     <rp>) </rp>
1579     </ruby>
1580     </t:template>
1581    
1582     <t:template match="child::xhtml1:ruby" mode="text">
1583     <t:apply-templates select="(child::xhtml1:rb |
1584     child::xhtml1:rbc/child::xhtml1:rb)/child::node ()"/>
1585     </t:template>
1586    
1587     <t:template match="html5:abbr/@title">
1588     <t:attribute name="title"><t:value-of select="self::node ()"/></t:attribute>
1589     </t:template>
1590    
1591     <t:template match="child::html5:m">
1592     <em class="m">
1593     <t:apply-templates select="@*"/>
1594     <t:apply-templates/>
1595     </em>
1596     </t:template>
1597    
1598     <t:template match="child::doc:tag">
1599     <code class="tutorial-tag">
1600     <t:apply-templates select="@*"/>
1601     <t:apply-templates/>
1602     </code>
1603     </t:template>
1604    
1605     <t:template match="child::doc:declaration">
1606     <code class="HTML doc-sgml-declaration">
1607     <t:apply-templates select="@*"/>
1608     <t:apply-templates/>
1609     </code>
1610     </t:template>
1611    
1612     <t:template match="child::doc:lang-tag">
1613     <code class="lang">
1614     <t:apply-templates select="@*"/>
1615     <t:apply-templates/>
1616     </code>
1617     </t:template>
1618     <t:template match="child::doc:lang-tag" mode="text">
1619     <t:apply-templates select="self::node ()"/>
1620     </t:template>
1621    
1622     <t:template match="child::doc:uri">
1623     <code class="uri">
1624     <t:apply-templates select="@*"/>
1625     <t:apply-templates/>
1626     </code>
1627     </t:template>
1628     <t:template match="child::doc:uri" mode="text">
1629     <t:apply-templates select="self::node ()"/>
1630     </t:template>
1631    
1632     <t:template match="html5:a[@href]">
1633     <a href="{string (@href)}">
1634     <t:apply-templates select="@*"/>
1635     <t:apply-templates/>
1636     </a>
1637     </t:template>
1638     <t:template match="html5:a/@href"/>
1639    
1640     <t:template match="child::doc:weak">
1641     <span class="weak">
1642     <t:apply-templates select="@*"/>
1643     <t:apply-templates/>
1644     </span>
1645     </t:template>
1646     <t:template match="child::doc:weak" mode="text"/>
1647     <t:template match="child::doc:weak" mode="attr"/>
1648    
1649     <t:template match="child::dc:title">
1650     <cite class="dc-title">
1651     <t:apply-templates select="@*"/>
1652     <t:apply-templates/>
1653     </cite>
1654     </t:template>
1655     <t:template match="child::dc:title" mode="text">
1656     <t:apply-templates select="self::node ()"/>
1657     </t:template>
1658    
1659     <t:template match="child::dc:title" mode="attr">
1660     <t:value-of select="'$B!X(B'"/>
1661     <t:apply-templates mode="attr"/>
1662     <t:value-of select="'$B!Y(B'"/>
1663     </t:template>
1664    
1665     <t:template match="child::dc:creator">
1666     <cite class="dc-creator">
1667     <t:apply-templates select="@*"/>
1668     <t:apply-templates/>
1669     </cite>
1670     </t:template>
1671     <t:template match="child::dc:creator" mode="text">
1672     <t:apply-templates select="self::node ()"/>
1673     </t:template>
1674    
1675     <t:template match="child::dc:creator" mode="attr">
1676     <t:apply-templates mode="attr"/>
1677     </t:template>
1678    
1679     <t:template match="child::doc:htmlCode">
1680     <code class="HTML">
1681     <t:apply-templates select="@*"/>
1682     <t:apply-templates/>
1683     </code>
1684     </t:template>
1685    
1686     <t:template match="doc:figBody/child::doc:htmlCode |
1687     doc:answer/child::doc:htmlCode |
1688     doc:htmlCode[@display = 'block']">
1689     <pre><code class="HTML">
1690     <t:apply-templates select="@*"/>
1691     <t:apply-templates/>
1692     </code></pre>
1693     </t:template>
1694     <t:template match="doc:htmlCode/@display[string (self::node ()) = 'block']"/>
1695    
1696     <t:template match="child::doc:cssCode">
1697     <code class="CSS">
1698     <t:apply-templates select="@*"/>
1699     <t:apply-templates/>
1700     </code>
1701     </t:template>
1702    
1703     <t:template match="doc:figBody/child::doc:cssCode |
1704     doc:answer/child::doc:cssCode">
1705     <pre><code class="CSS">
1706     <t:apply-templates select="@*"/>
1707     <t:apply-templates/>
1708     </code></pre>
1709     </t:template>
1710    
1711     <t:template match="child::doc:unit-number">
1712     <span class="unit-number">
1713     <t:apply-templates select="@*"/>
1714     <t:apply-templates/>
1715     </span>
1716     </t:template>
1717    
1718     <t:template match="child::doc:number">
1719     <span class="number">
1720     <t:apply-templates select="@*"/>
1721     <t:apply-templates/>
1722     </span>
1723     </t:template>
1724    
1725     <t:template match="child::doc:unit">
1726     <t:choose>
1727     <t:when test="string (self::node ()) = 'mm'">
1728     <abbr class="unit" title="millimeter" lang="en" xml:lang="en">
1729     <t:apply-templates select="@*"/>
1730     <t:apply-templates/>
1731     </abbr>
1732     </t:when>
1733     <t:when test="string (self::node ()) = 'cm'">
1734     <abbr class="unit" title="centimeter" lang="en" xml:lang="en">
1735     <t:apply-templates select="@*"/>
1736     <t:apply-templates/>
1737     </abbr>
1738     </t:when>
1739     <t:otherwise>
1740     <span class="unit">
1741     <t:apply-templates select="@*"/>
1742     <t:apply-templates/>
1743     </span>
1744     </t:otherwise>
1745     </t:choose>
1746     </t:template>
1747    
1748     <t:template match="doc:markRef">
1749     <t:variable name="mark"
1750     select="/descendant::*[@doc:markName = current ()/@mark]"/>
1751     <a class="doc-mark-ref" href="#mark-{generate-id ($mark)}">
1752     <t:attribute name="onmouseover">
1753     <t:for-each select="$mark">
1754     document.getElementById ('mark-<t:value-of
1755     select="generate-id (self::node ())"
1756     />').className += ' doc-mark-enabled';
1757     </t:for-each>
1758     </t:attribute>
1759     <t:attribute name="onmouseout">
1760     var el;
1761     <t:for-each select="$mark">
1762     el = document.getElementById ('mark-<t:value-of select="generate-id
1763     (self::node ())" />');
1764     el.className = el.className.replace (/\s*\bdoc-mark-enabled\b/g, '');
1765     <!-- TODO: Clones -->
1766     </t:for-each>
1767     </t:attribute>
1768     <t:apply-templates select="@*"/>
1769     <t:apply-templates/>
1770     </a>
1771     </t:template>
1772     <t:template match="doc:markRef/@mark"/>
1773    
1774     <t:template match="@doc:markName">
1775     <t:attribute name="id">
1776     <t:value-of select="concat ('mark-', generate-id (parent::node ()))"/>
1777     </t:attribute>
1778     </t:template>
1779    
1780     <t:template match="@xml:lang">
1781     <t:apply-templates select="parent::*" mode="lang"/>
1782     </t:template>
1783    
1784     <t:template match="@xml:lang" mode="text">
1785     <t:apply-templates select="self::node ()"/>
1786     </t:template>
1787    
1788     <t:template match="child::*" mode="lang">
1789     <t:choose>
1790     <t:when test="@xml:lang">
1791     <t:attribute name="lang"><t:value-of select="@xml:lang"/></t:attribute>
1792     <t:attribute name="xml:lang"><t:value-of select="@xml:lang"/></t:attribute>
1793     </t:when>
1794     <t:otherwise>
1795     <t:attribute name="lang">
1796     <t:value-of select="ancestor::*[@xml:lang]/@xml:lang"/>
1797     </t:attribute>
1798     <t:attribute name="xml:lang">
1799     <t:value-of select="ancestor::*[@xml:lang]/@xml:lang"/>
1800     </t:attribute>
1801     </t:otherwise>
1802     </t:choose>
1803     </t:template>
1804    
1805     <t:template match="html5:*/@class">
1806     <t:attribute name="class"><t:value-of select="self::node ()"/></t:attribute>
1807     </t:template>
1808    
1809     <t:template match="@xml:id">
1810     <t:attribute name="id"><t:value-of select="self::node ()"/></t:attribute>
1811     </t:template>
1812    
1813     <t:template match="@xml:space">
1814     <t:attribute name="xml:space"><t:value-of select="self::node ()"/></t:attribute>
1815     </t:template>
1816    
1817     <t:template match="text ()" mode="attr">
1818     <t:value-of select="normalize-space (self::node ())"/>
1819     </t:template>
1820    
1821     <t:template match="child::*" mode="unknown">
1822     <span>
1823     <code>
1824     <t:value-of select="concat ('{&lt;', namespace-uri (), '>:',
1825     local-name (), '}')"/>
1826     </code>
1827     <t:apply-templates select="@*"/>
1828     <t:apply-templates/>
1829     <code>
1830     <t:value-of select="'{/}'"/>
1831     </code>
1832     </span>
1833     </t:template>
1834     <t:template match="child::*">
1835     <t:apply-templates select="self::node ()" mode="unknown"/>
1836     </t:template>
1837     <t:template match="child::*" mode="h1">
1838     <t:apply-templates select="self::node ()" mode="unknown"/>
1839     </t:template>
1840     <t:template match="child::*" mode="h2">
1841     <t:apply-templates select="self::node ()" mode="unknown"/>
1842     </t:template>
1843     <t:template match="child::*" mode="h3">
1844     <t:apply-templates select="self::node ()" mode="unknown"/>
1845     </t:template>
1846     <t:template match="child::*" mode="answer">
1847     <t:apply-templates select="self::node ()" mode="unknown"/>
1848     </t:template>
1849     <t:template match="child::*" mode="toc">
1850     <t:apply-templates select="self::node ()" mode="unknown"/>
1851     </t:template>
1852     <t:template match="child::*" mode="text">
1853     <t:apply-templates select="self::node ()" mode="unknown"/>
1854     </t:template>
1855     <t:template match="child::*" mode="toc-figures">
1856     <t:apply-templates select="self::node ()" mode="unknown"/>
1857     </t:template>
1858     <t:template match="child::*" mode="toc-value">
1859     <t:apply-templates select="self::node ()" mode="unknown"/>
1860     </t:template>
1861     <t:template match="child::*" mode="toc-detail">
1862     <t:apply-templates select="self::node ()" mode="unknown"/>
1863     </t:template>
1864     <t:template match="child::*" mode="toc-columns">
1865     <t:apply-templates select="self::node ()" mode="unknown"/>
1866     </t:template>
1867     <t:template match="child::*" mode="toc-keypoints">
1868     <t:apply-templates select="self::node ()" mode="unknown"/>
1869     </t:template>
1870     <t:template match="child::*" mode="figure-number">
1871     <t:apply-templates select="self::node ()" mode="unknown"/>
1872     </t:template>
1873     <t:template match="child::*" mode="figure-number-attr">
1874     <t:apply-templates select="self::node ()" mode="unknown"/>
1875     </t:template>
1876     <t:template match="child::*" mode="todo-list">
1877     <t:apply-templates select="self::node ()" mode="unknown"/>
1878     </t:template>
1879    
1880     <t:template match="child::*" mode="attr">
1881     <t:value-of select="concat ('{&lt;', namespace-uri (), '>:',
1882     local-name (), '}')"/>
1883     <t:apply-templates mode="attr"/>
1884     <t:value-of select="'{/}'"/>
1885     </t:template>
1886    
1887     <t:template match="@*" mode="unknown">
1888     <span>
1889     <code>
1890     <t:value-of select="concat ('{@&lt;', namespace-uri (), '>:',
1891     local-name (), '=')"/>
1892     </code>
1893     <t:value-of select="string (self::node ())"/>
1894     <code>
1895     <t:value-of select="'/}'"/>
1896     </code>
1897     </span>
1898     </t:template>
1899     <t:template match="@*">
1900     <t:apply-templates select="self::node ()" mode="unknown"/>
1901     </t:template>
1902     <t:template match="@*" mode="text">
1903     <t:apply-templates select="self::node ()" mode="unknown"/>
1904     </t:template>
1905     </t:stylesheet>
1906     <!--
1907     License: GNU FDL (See |webpage.ja.html|).
1908     $Date:$
1909     -->

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24