1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE xsl:stylesheet [<!ENTITY nbsp " ">]>
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
5 SWFTools documentation stylesheet.
7 Major portions shamelessly stolen from the gentoo documentation project (www.gentoo.org).
9 This file is distributed under the GPL, see file COPYING for details.
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">
17 <xsl:template match="/guide">
20 <link title="new" rel="stylesheet" href="caiviar.css" type="text/css"/>
21 <link REL="shortcut icon" HREF="/favicon.ico" TYPE="image/x-icon"/>
23 <xsl:value-of select="title"/>
26 <body style="margin-left:0px;margin-top:0px;" bgcolor="#ffffff">
30 <font class="dochead" align="center">
31 <xsl:value-of select="title"/>
37 <table cellspacing="0" cellpadding="0">
39 <xsl:apply-templates select="chapter" mode="toc"/>
44 <xsl:apply-templates select="chapter"/>
47 <table cellspacing="0" cellpadding="0">
50 <td width="100%" align="center">SWFC Manual: __currentchapter__</td>
60 <xsl:template match="chapter" mode="toc">
61 <xsl:variable name="chid2"><xsl:number/></xsl:variable>
63 chapterlink<xsl:value-of select="$chid2"/>
65 <td width="20"> </td>
68 <xsl:template match="chapter">
70 <xsl:text disable-output-escaping = "yes">
71 <!-- snip:chapter !!!"</xsl:text><xsl:value-of select="@title"/><xsl:text disable-output-escaping = "yes">"!!! -->
74 <xsl:variable name="chid"><xsl:number/></xsl:variable>
77 <font class="chapnum">
78 <a name="doc_chap{$chid}"><xsl:number/>.</a>
80 <xsl:value-of select="@title"/>
84 <xsl:with-param name="chid" select="$chid"/>
85 </xsl:apply-templates>
87 <xsl:text disable-output-escaping = "yes">
88 <!-- snip:/chapter -->
92 <xsl:template match="mail">
93 <a href="mailto:{@link}">
94 <xsl:value-of select="."/>
99 <xsl:template match="section">
100 <xsl:param name="chid"/>
101 <xsl:variable name="sid"><xsl:number/></xsl:variable>
102 <xsl:if test="title">
104 <xsl:value-of select="$chid"/>.<xsl:value-of select="$sid"/> 
105 <a name=""><xsl:value-of select="title"/> </a>
108 <xsl:apply-templates>
109 <xsl:with-param name="chid" select="$chid"/>
110 <xsl:with-param name="sid" select="$sid"/>
111 </xsl:apply-templates>
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"/> 
121 <a name=""><xsl:value-of select="title"/> </a>
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>
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"/> 
139 <a name=""><xsl:value-of select="title"/> </a>
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>
150 <xsl:template match="figure">
151 <xsl:with-param name="chid"/>
152 <xsl:variable name="fignum">
153 <xsl:number level="any" from="chapter" count="figure"/>
155 <xsl:variable name="figid">doc_chap<xsl:value-of select="$chid"/>_fig<xsl:value-of select="$fignum"/></xsl:variable>
158 <table cellspacing="0" cellpadding="0" border="0">
160 <td class="infohead" bgcolor="#7a5ada">
163 <xsl:when test="@caption">
164 Figure <xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/>: <xsl:value-of select="@caption"/>
167 Figure <xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/>
174 <td align="center" bgcolor="#ddddff">
176 <xsl:when test="@short">
177 <img src="{@link}" alt="Fig. {$fignum}: {@short}"/>
180 <img src="{@link}" alt="Fig. {$fignum}"/>
189 <!--figure without a caption; just a graphical element-->
190 <xsl:template match="fig">
193 <xsl:when test="@linkto">
195 <img src="{@link}" alt="{@short}"/>
199 <img src="{@link}" alt="{@short}"/>
205 <xsl:template match="br">
209 <xsl:template match="note">
210 <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
212 <td bgcolor="#bbffbb">
215 <xsl:apply-templates/>
222 <xsl:template match="impo">
223 <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
225 <td bgcolor="#ffffbb">
228 <xsl:apply-templates/>
235 <xsl:template match="warn">
236 <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
238 <td bgcolor="#ffbbbb">
241 <xsl:apply-templates/>
248 <xsl:template match="codenote">
249 <font class="comment">// <xsl:value-of select="."/></font>
252 <xsl:template match="comment">
253 <font class="comment">
254 <xsl:apply-templates/>
258 <xsl:template match="i">
260 <xsl:apply-templates/>
264 <xsl:template match="b">
266 <xsl:apply-templates/>
270 <xsl:template match="brite">
273 <xsl:apply-templates/>
278 <xsl:template match="c">
280 <xsl:apply-templates/>
284 <xsl:template match="box">
286 <xsl:apply-templates/>
290 <xsl:template match="shell">
291 <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
293 <td bgcolor="#f0f0f0">
295 <font><xsl:apply-templates/></font>
303 <xsl:template match="property">
304 <table class="itable" width="100%" cellspacing="0" cellpadding="0" border="0">
305 <tr><td width="2%"></td><td></td></tr> <!-- FIXME -->
310 <font><b><xsl:apply-templates/></b></font>
314 <tr><td width="2%"></td><td></td></tr> <!-- FIXME -->
318 <xsl:template match="code">
319 <xsl:param name="chid"/>
320 <xsl:variable name="prenum">
321 <xsl:number level="any" from="chapter" count="code"/>
323 <xsl:variable name="preid">doc_chap<xsl:value-of select="$chid"/>_pre<xsl:value-of select="$prenum"/></xsl:variable>
325 <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
327 <td></td><td width="32"></td>
328 <td class="infohead" bgcolor="#6c6cff">
331 <xsl:when test="@caption">
332 Code listing <xsl:value-of select="$chid"/>.<xsl:value-of select="$prenum"/>: <xsl:value-of select="@caption"/>
335 Code listing <xsl:value-of select="$chid"/>.<xsl:value-of select="$prenum"/>
342 <!-- <td> is inserted by perl -->
343 [CALLPERL <xsl:value-of select="@lang"/> left]
344 <xsl:apply-templates/>
346 <!-- </td> is inserted by perl -->
349 <td bgcolor="#e0ffff" valign="top">
350 [CALLPERL <xsl:value-of select="@lang"/> right]
351 <xsl:apply-templates/>
359 <xsl:template match="f">
361 <xsl:value-of select="."/>
365 <xsl:template match="a">
366 <!-- expand templates to handle things like <a href="http://bar"><c>foo</c></a> -->
368 <xsl:when test="@href">
370 <xsl:apply-templates/>
374 <xsl:variable name="loc" select="."/>
376 <xsl:apply-templates/>
382 <xsl:template match="p">
383 <xsl:param name="chid"/>
385 <xsl:when test="@class">
387 <xsl:apply-templates>
388 <xsl:with-param name="chid" select="$chid"/>
389 </xsl:apply-templates>
394 <xsl:apply-templates>
395 <xsl:with-param name="chid" select="$chid"/>
396 </xsl:apply-templates>
402 <xsl:template match="title">
405 <xsl:template match="e">
406 <font class="emphasis">
407 <xsl:apply-templates/>
411 <xsl:template match="mail">
412 <a href="mailto:{@link}">
413 <xsl:value-of select="."/>
417 <xsl:template match="table">
418 <table class="ntable">
419 <xsl:apply-templates/>
423 <xsl:template match="tr">
425 <xsl:apply-templates/>
429 <xsl:template match="ti">
430 <td bgcolor="#cccccc" class="tableinfo">
431 <xsl:apply-templates/>
435 <xsl:template match="th">
436 <td bgcolor="#6c6cff" class="infohead">
438 <xsl:apply-templates/>
443 <xsl:template match="ul">
445 <xsl:apply-templates/>
449 <xsl:template match="ol">
451 <xsl:apply-templates/>
455 <xsl:template match="li">
457 <xsl:apply-templates/>
461 <!-- <xsl:template match="text()">
463 <xsl:value-of select="value()"/>