fixed bug in jpeg2000 decoding
[swftools.git] / doc / guide.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#160;">]>
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4 <!--
5    SWFTools documentation stylesheet.
6
7    Major portions shamelessly stolen from the gentoo documentation project (www.gentoo.org).
8
9    This file is distributed under the GPL, see file COPYING for details.
10 -->
11   <xsl:output encoding="iso-8859-15" method="html" indent="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
12   <xsl:preserve-space elements="code"/>
13   <xsl:template match="img">
14       <img src="{@src}"/>
15   </xsl:template>
16
17   <xsl:template match="/guide">
18         <html>
19         <head>
20          <link title="new" rel="stylesheet" href="caiviar.css" type="text/css"/>
21          <link REL="shortcut icon" HREF="/favicon.ico" TYPE="image/x-icon"/>
22          <title>
23          <xsl:value-of select="title"/>
24          </title>
25         </head>
26         <body style="margin-left:0px;margin-top:0px;" bgcolor="#ffffff">
27
28         <h1>
29          <b>
30          <font class="dochead" align="center">
31             <xsl:value-of select="title"/>
32          </font>
33          </b>
34         </h1>
35
36         <hr/>
37         <table cellspacing="0" cellpadding="0">
38         <tr>
39             <xsl:apply-templates select="chapter" mode="toc"/>
40         </tr>
41         </table>
42         <hr/>
43
44         <xsl:apply-templates select="chapter"/>
45
46         <hr/>
47         <table cellspacing="0" cellpadding="0">
48         <tr>
49             <td>__prevlink__</td>
50             <td width="100%" align="center"><!--SWFC Manual: -->__currentchapter__</td>
51             <td>__nextlink__</td>
52         </tr>
53         </table>
54         <hr/>
55
56         </body>
57         </html>
58   </xsl:template>
59   
60   <xsl:template match="chapter" mode="toc">
61     <xsl:variable name="chid2"><xsl:number/></xsl:variable>
62     <td>
63         chapterlink<xsl:value-of select="$chid2"/>
64     </td>
65     <td width="20">&nbsp;</td>
66   </xsl:template>
67     
68   <xsl:template match="chapter">
69
70     <xsl:text disable-output-escaping = "yes">
71 &lt;!-- snip:chapter !!!"</xsl:text><xsl:value-of select="@title"/><xsl:text disable-output-escaping = "yes">"!!! --&gt;
72     </xsl:text>
73
74     <xsl:variable name="chid"><xsl:number/></xsl:variable>
75
76     <p class="chaphead">
77       <font class="chapnum">
78         <a name="doc_chap{$chid}"><xsl:number/>.</a>
79       </font>
80       <xsl:value-of select="@title"/>
81     </p>
82
83     <xsl:apply-templates>
84       <xsl:with-param name="chid" select="$chid"/>
85     </xsl:apply-templates>
86
87     <xsl:text disable-output-escaping = "yes">
88 &lt;!-- snip:/chapter --&gt;
89     </xsl:text>
90   </xsl:template>
91   
92   <xsl:template match="mail">
93     <a href="mailto:{@link}">
94       <xsl:value-of select="."/>
95     </a>
96   </xsl:template>
97
98
99   <xsl:template match="section">
100     <xsl:param name="chid"/>
101     <xsl:variable name="sid"><xsl:number/></xsl:variable>
102     <xsl:if test="title">
103       <p class="secthead">
104         <xsl:value-of select="$chid"/>.<xsl:value-of select="$sid"/>&#160;
105         <a name=""><xsl:value-of select="title"/>&#160;</a>
106       </p>
107     </xsl:if>
108     <xsl:apply-templates>
109       <xsl:with-param name="chid" select="$chid"/>
110       <xsl:with-param name="sid" select="$sid"/>
111     </xsl:apply-templates>
112   </xsl:template>
113
114   <xsl:template match="subsection">
115     <xsl:param name="chid"/>
116     <xsl:param name="sid"/>
117     <xsl:variable name="ssid"><xsl:number/></xsl:variable>
118     <xsl:if test="title">
119       <p class="subsecthead">
120         <xsl:value-of select="$chid"/>.<xsl:value-of select="$sid"/>.<xsl:value-of select="$ssid"/>&#160;
121         <a name=""><xsl:value-of select="title"/>&#160;</a>
122       </p>
123     </xsl:if>
124     <xsl:apply-templates>
125       <xsl:with-param name="chid" select="$chid"/>
126       <xsl:with-param name="sid" select="$sid"/>
127       <xsl:with-param name="ssid" select="$ssid"/>
128     </xsl:apply-templates>
129   </xsl:template>
130
131   <xsl:template match="subsubsection">
132     <xsl:param name="chid"/>
133     <xsl:param name="sid"/>
134     <xsl:param name="ssid"/>
135     <xsl:variable name="sssid"><xsl:number/></xsl:variable>
136     <xsl:if test="title">
137       <p class="subsubsecthead">
138         <xsl:value-of select="$chid"/>.<xsl:value-of select="$sid"/>.<xsl:value-of select="$ssid"/>.<xsl:value-of select="$sssid"/>&#160;
139         <a name=""><xsl:value-of select="title"/>&#160;</a>
140       </p>
141     </xsl:if>
142     <xsl:apply-templates>
143       <xsl:with-param name="chid" select="$chid"/>
144       <xsl:with-param name="sid" select="$sid"/>
145       <xsl:with-param name="ssid" select="$ssid"/>
146       <xsl:with-param name="sssid" select="$sssid"/>
147     </xsl:apply-templates>
148   </xsl:template>
149
150   <!--figure without a caption; just a graphical element-->
151   <xsl:template match="fig">
152     <center>
153       <xsl:choose>
154         <xsl:when test="@linkto">
155           <a href="{@linkto}">
156             <img src="{@link}" alt="{@short}"/>
157           </a>
158         </xsl:when>
159         <xsl:otherwise>
160           <img src="{@link}" alt="{@short}"/>
161         </xsl:otherwise>
162       </xsl:choose>
163     </center>
164   </xsl:template>
165
166   <xsl:template match="br">
167     <br/>
168   </xsl:template>
169
170   <xsl:template match="note">
171     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
172       <tr>
173         <td bgcolor="#bbffbb">
174           <p class="note">
175             <b>Note: </b>
176             <xsl:apply-templates/>
177           </p>
178         </td>
179       </tr>
180     </table>
181   </xsl:template>
182
183   <xsl:template match="impo">
184     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
185       <tr>
186         <td bgcolor="#ffffbb">
187           <p class="note">
188             <b>Important: </b>
189             <xsl:apply-templates/>
190           </p>
191         </td>
192       </tr>
193     </table>
194   </xsl:template>
195
196   <xsl:template match="warn">
197     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
198       <tr>
199         <td bgcolor="#ffbbbb">
200           <p class="note">
201             <b>Warning: </b>
202             <xsl:apply-templates/>
203           </p>
204         </td>
205       </tr>
206     </table>
207   </xsl:template>
208
209   <xsl:template match="codenote">
210     <font class="comment">// <xsl:value-of select="."/></font>
211   </xsl:template>
212
213   <xsl:template match="comment">
214     <font class="comment">
215       <xsl:apply-templates/>
216     </font>
217   </xsl:template>
218
219   <xsl:template match="i">
220     <font class="input">
221       <xsl:apply-templates/>
222     </font>
223   </xsl:template>
224
225   <xsl:template match="b">
226     <b>
227       <xsl:apply-templates/>
228     </b>
229   </xsl:template>
230
231   <xsl:template match="brite">
232     <font class="brite">
233       <b>
234         <xsl:apply-templates/>
235       </b>
236     </font>
237   </xsl:template>
238
239   <xsl:template match="c">
240     <font class="code">
241       <xsl:apply-templates/>
242     </font>
243   </xsl:template>
244
245   <xsl:template match="box">
246     <p class="infotext">
247       <xsl:apply-templates/>
248     </p>
249   </xsl:template>
250
251   <xsl:template match="shell">
252     <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
253       <tr>
254         <td bgcolor="#f0f0f0">
255           <pre>
256             <font><xsl:apply-templates/></font>
257           </pre>
258         </td>
259       </tr>
260     </table>
261     <br/>
262   </xsl:template>
263
264   <xsl:template match="property">
265     <table class="itable" width="100%" cellspacing="0" cellpadding="0" border="0">
266     <tr><td width="2%"></td><td></td></tr> <!-- FIXME -->
267       <tr>
268         <td width="2%">
269         </td>
270         <td>
271             <font><b><xsl:apply-templates/></b></font>
272         </td>
273       </tr>
274     <tr></tr>
275     <tr><td width="2%"></td><td></td></tr> <!-- FIXME -->
276     </table>
277   </xsl:template>
278
279   <xsl:template match="code">
280     <xsl:param name="chid"/>
281     <xsl:variable name="prenum">
282       <xsl:number level="any" from="chapter" count="code"/>
283     </xsl:variable>
284     <xsl:variable name="preid">doc_chap<xsl:value-of select="$chid"/>_pre<xsl:value-of select="$prenum"/></xsl:variable>
285     <a name="{$preid}"/>
286     <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
287       <tr>
288         <td></td><td width="32"></td>
289         <td class="infohead" bgcolor="#6c6cff">
290           <p class="caption">
291             <xsl:choose>
292               <xsl:when test="@caption">
293                         Code listing <xsl:value-of select="$chid"/>.<xsl:value-of select="$prenum"/>: <xsl:value-of select="@caption"/>
294                 </xsl:when>
295               <xsl:otherwise>
296                         Code listing <xsl:value-of select="$chid"/>.<xsl:value-of select="$prenum"/>
297                 </xsl:otherwise>
298             </xsl:choose>
299           </p>
300         </td>
301       </tr>
302       <tr>
303       <!-- <td> is inserted by perl -->
304 [CALLPERL <xsl:value-of select="@lang"/> left]
305 <xsl:apply-templates/>
306 [CALLPERL end]
307       <!-- </td> is inserted by perl -->
308         <td width="32">
309         </td>
310         <td bgcolor="#e0ffff" valign="top">
311 [CALLPERL <xsl:value-of select="@lang"/> right]
312 <xsl:apply-templates/>
313 [CALLPERL end]
314         </td>
315       </tr>
316     </table>
317     <br/>
318   </xsl:template>
319
320   <xsl:template match="f">
321     <font class="path">
322       <xsl:value-of select="."/>
323     </font>
324   </xsl:template>
325
326   <xsl:template match="a">
327   <!-- expand templates to handle things like <a href="http://bar"><c>foo</c></a> -->
328     <xsl:choose>
329       <xsl:when test="@href">
330         <a href="{@href}">
331           <xsl:apply-templates/>
332         </a>
333       </xsl:when>
334       <xsl:otherwise>
335         <xsl:variable name="loc" select="."/>
336         <a href="{$loc}">
337           <xsl:apply-templates/>
338         </a>
339       </xsl:otherwise>
340     </xsl:choose>
341   </xsl:template>
342
343   <xsl:template match="p">
344     <xsl:param name="chid"/>
345       <xsl:choose>
346       <xsl:when test="@class">
347                 <p class="{@class}">
348                 <xsl:apply-templates>
349                 <xsl:with-param name="chid" select="$chid"/>
350                 </xsl:apply-templates>
351                 </p>
352         </xsl:when>
353         <xsl:otherwise>
354                 <p>
355                 <xsl:apply-templates>
356                 <xsl:with-param name="chid" select="$chid"/>
357                 </xsl:apply-templates>
358                 </p>
359         </xsl:otherwise>
360         </xsl:choose>
361   </xsl:template>
362
363   <xsl:template match="title">
364   </xsl:template>
365
366   <xsl:template match="e">
367     <font class="emphasis">
368       <xsl:apply-templates/>
369     </font>
370   </xsl:template>
371
372   <xsl:template match="mail">
373     <a href="mailto:{@link}">
374       <xsl:value-of select="."/>
375     </a>
376   </xsl:template>
377
378   <xsl:template match="table">
379     <table class="ntable">
380       <xsl:apply-templates/>
381     </table>
382   </xsl:template>
383
384   <xsl:template match="tr">
385     <tr>
386       <xsl:apply-templates/>
387     </tr>
388   </xsl:template>
389
390   <xsl:template match="ti">
391     <td bgcolor="#cccccc" class="tableinfo">
392       <xsl:apply-templates/>
393     </td>
394   </xsl:template>
395
396   <xsl:template match="th">
397     <td bgcolor="#6c6cff" class="infohead">
398       <b>
399         <xsl:apply-templates/>
400       </b>
401     </td>
402   </xsl:template>
403
404   <xsl:template match="ul">
405     <ul>
406       <xsl:apply-templates/>
407     </ul>
408   </xsl:template>
409
410   <xsl:template match="ol">
411     <ol>
412       <xsl:apply-templates/>
413     </ol>
414   </xsl:template>
415
416   <xsl:template match="li">
417     <li>
418       <xsl:apply-templates/>
419     </li>
420   </xsl:template>
421
422 <!--  <xsl:template match="text()">
423    [
424    <xsl:value-of select="value()"/>
425    ]
426   </xsl:template>
427 -->
428 </xsl:stylesheet>