/[gentoo]/xml/htdocs/xsl/guide.xsl
Gentoo

Contents of /xml/htdocs/xsl/guide.xsl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.176 - (hide annotations) (download) (as text)
Mon May 1 09:30:47 2006 UTC (7 years ago) by neysx
Branch: MAIN
Changes since 1.175: +26 -27 lines
File MIME type: application/xml
Fix chapter numbering

1 rajiv 1.6 <?xml version="1.0" encoding="UTF-8"?>
2 neysx 1.123 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
3 neysx 1.129 xmlns:exslt="http://exslt.org/common"
4 neysx 1.131 xmlns:func="http://exslt.org/functions"
5     extension-element-prefixes="exslt func" >
6 swift 1.73
7 neysx 1.146 <xsl:output encoding="UTF-8" method="html" indent="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
8    
9 swift 1.73 <!-- Include external stylesheets -->
10 swift 1.102 <xsl:include href="content.xsl" />
11     <xsl:include href="handbook.xsl" />
12     <xsl:include href="inserts.xsl" />
13 swift 1.73
14     <!-- When using <pre>, whitespaces should be preserved -->
15     <xsl:preserve-space elements="pre"/>
16    
17     <!-- Global definition of style parameter -->
18     <xsl:param name="style">0</xsl:param>
19 neysx 1.146 <xsl:param name="newsitemcount">6</xsl:param>
20 swift 1.73
21 neysx 1.163 <!-- Category from metadoc -->
22     <xsl:param name="catid">0</xsl:param>
23    
24    
25    
26 swift 1.73 <!-- img tag -->
27     <xsl:template match="img">
28 neysx 1.157 <img src="{@src}" alt=""/>
29 swift 1.73 </xsl:template>
30    
31 neysx 1.165 <xsl:template name="show-disclaimer">
32     <!-- Disclaimer stuff -->
33     <xsl:if test="/*[1][@disclaimer] or /*[1][@redirect]">
34     <table class="ncontent" align="center" width="90%" border="1px" cellspacing="0" cellpadding="4px">
35     <tr>
36     <td bgcolor="#ddddff">
37     <p class="note">
38     <xsl:if test="/*[1][@disclaimer]">
39     <b><xsl:value-of select="func:gettext('disclaimer')"/>: </b>
40     <xsl:apply-templates select="func:gettext(/*[1]/@disclaimer)"/>
41     </xsl:if>
42     <xsl:if test="/*[1][@redirect]">
43     <xsl:apply-templates select="func:gettext('redirect')">
44     <xsl:with-param name="paramlink" select="/*[1]/@redirect"/>
45     </xsl:apply-templates>
46     </xsl:if>
47     </p>
48     </td>
49     </tr>
50     </table>
51     </xsl:if>
52     </xsl:template>
53    
54    
55 swift 1.73 <!-- Content of /guide -->
56     <xsl:template name="guidecontent">
57 neysx 1.141 <xsl:if test="$style != 'printable'">
58     <br />
59     </xsl:if>
60 neysx 1.165
61 swift 1.118 <h1>
62 swift 1.73 <xsl:choose>
63     <xsl:when test="/guide/subtitle"><xsl:value-of select="/guide/title"/>: <xsl:value-of select="/guide/subtitle"/></xsl:when>
64     <xsl:otherwise><xsl:value-of select="/guide/title"/></xsl:otherwise>
65     </xsl:choose>
66 swift 1.118 </h1>
67 swift 1.73
68 swift 1.96 <xsl:choose>
69     <xsl:when test="$style = 'printable'">
70     <xsl:apply-templates select="author" />
71 neysx 1.141 <br/>
72     <i><xsl:call-template name="contentdate"/></i>
73 neysx 1.165 <xsl:variable name="outdated">
74     <xsl:call-template name="outdated-translation"/>
75     </xsl:variable>
76     <xsl:if test="string-length($outdated) &gt; 1">
77     <br/><i><xsl:copy-of select="$outdated"/></i>
78     </xsl:if>
79 swift 1.96 </xsl:when>
80     <xsl:otherwise>
81 neysx 1.149 <xsl:if test="count(/guide/chapter)&gt;1">
82 swift 1.96 <form name="contents" action="http://www.gentoo.org">
83 neysx 1.123 <b><xsl:value-of select="func:gettext('Content')"/></b>:
84 neysx 1.146 <select name="url" size="1" OnChange="location.href=form.url.options[form.url.selectedIndex].value" style="font-family:sans-serif,Arial,Helvetica">
85 swift 1.96 <xsl:for-each select="chapter">
86     <xsl:variable name="chapid">doc_chap<xsl:number/></xsl:variable><option value="#{$chapid}"><xsl:number/>. <xsl:value-of select="title"/></option>
87     </xsl:for-each>
88     </select>
89     </form>
90 neysx 1.149 </xsl:if>
91 swift 1.96 </xsl:otherwise>
92     </xsl:choose>
93 swift 1.73
94 neysx 1.147 <xsl:choose>
95     <xsl:when test="/guide">
96     <xsl:apply-templates select="chapter"/>
97     </xsl:when>
98     <xsl:when test="/sections">
99     <xsl:apply-templates select="/sections/section"/>
100     </xsl:when>
101     </xsl:choose>
102 swift 1.73 <br/>
103     <xsl:if test="/guide/license">
104     <xsl:apply-templates select="license" />
105     </xsl:if>
106     <br/>
107     </xsl:template>
108    
109     <!-- Layout for documentation -->
110     <xsl:template name="doclayout">
111 neysx 1.165 <html>
112     <xsl:if test="string-length($glang)>1">
113     <xsl:attribute name="lang"><xsl:value-of select="translate($glang,'_','-')"/></xsl:attribute>
114     </xsl:if>
115     <head>
116     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
117 neysx 1.172 <link title="new" rel="stylesheet" href="/css/main.css" type="text/css"/>
118 neysx 1.165 <link REL="shortcut icon" HREF="http://www.gentoo.org/favicon.ico" TYPE="image/x-icon"/>
119     <!-- Just remove this bit if http refresh is too annoying -->
120     <xsl:if test="/*[1][@redirect]">
121     <meta http-equiv="Refresh">
122     <xsl:attribute name="content"><xsl:value-of select="concat('15; URL=', /*[1]/@redirect)"/></xsl:attribute>
123     </meta>
124     </xsl:if>
125    
126 swift 1.96 <title>
127 swift 1.73 <xsl:choose>
128 swift 1.96 <xsl:when test="/guide/@type='project'">Gentoo Linux Projects</xsl:when>
129     <xsl:when test="/guide/@type='newsletter'">Gentoo Linux Newsletter</xsl:when>
130 neysx 1.147 <xsl:when test="/sections">Gentoo Linux Handbook Page</xsl:when>
131 neysx 1.123 <xsl:otherwise><xsl:value-of select="func:gettext('GLinuxDoc')"/></xsl:otherwise>
132 swift 1.73 </xsl:choose>
133 neysx 1.129 --
134 swift 1.73 <xsl:choose>
135     <xsl:when test="subtitle"><xsl:if test="/guide/@type!='newsletter'"><xsl:value-of select="title"/>:</xsl:if> <xsl:value-of select="subtitle"/></xsl:when>
136     <xsl:otherwise><xsl:value-of select="title"/></xsl:otherwise>
137     </xsl:choose>
138     </title>
139 swift 1.118
140 neysx 1.165 </head>
141 swift 1.118 <xsl:choose>
142     <xsl:when test="$style = 'printable'">
143     <!-- Insert the node-specific content -->
144     <body bgcolor="#ffffff">
145 neysx 1.165 <xsl:call-template name="show-disclaimer"/>
146 swift 1.118 <xsl:call-template name="content"/>
147     </body>
148     </xsl:when>
149     <xsl:otherwise>
150 swift 1.100 <body style="margin:0px;" bgcolor="#ffffff">
151 swift 1.73 <table width="100%" border="0" cellspacing="0" cellpadding="0">
152     <tr>
153     <td valign="top" height="125" bgcolor="#45347b">
154 neysx 1.146 <a href="/"><img border="0" src="/images/gtop-www.jpg" alt="Gentoo Logo"/></a>
155 swift 1.73 </td>
156     </tr>
157     <tr>
158     <td valign="top" align="right" colspan="1" bgcolor="#ffffff">
159     <table border="0" cellspacing="0" cellpadding="0" width="100%">
160     <tr>
161     <td width="99%" class="content" valign="top" align="left">
162     <!-- Insert the node-specific content -->
163 neysx 1.165 <xsl:call-template name="show-disclaimer"/>
164 swift 1.73 <xsl:call-template name="content"/>
165     </td>
166     <td width="1%" bgcolor="#dddaec" valign="top">
167 neysx 1.146 <xsl:call-template name="rhcol"/>
168 swift 1.73 </td>
169     </tr>
170     </table>
171     </td>
172     </tr>
173     <tr>
174 neysx 1.146 <td colspan="2" align="right" class="infohead">
175 neysx 1.171 Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Foundation, Inc. Questions, Comments? Email <a class="highlight" href="mailto:www@gentoo.org">www@gentoo.org</a>.
176 swift 1.73 </td>
177     </tr>
178     </table>
179    
180     </body>
181 swift 1.118 </xsl:otherwise>
182     </xsl:choose>
183 neysx 1.165 </html>
184 swift 1.73 </xsl:template>
185    
186     <!-- Guide template -->
187     <xsl:template match="/guide">
188     <xsl:call-template name="doclayout" />
189     </xsl:template>
190    
191     <!-- {Mainpage, News, Email} template -->
192 neysx 1.172 <xsl:template match="/mainpage | /news"> <!-- Removed " | /email" can't find any use -->
193 neysx 1.165 <html>
194     <xsl:if test="string-length($glang)>1">
195     <xsl:attribute name="lang"><xsl:value-of select="translate($glang,'_','-')"/></xsl:attribute>
196     </xsl:if>
197     <head>
198     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
199 neysx 1.172 <link title="new" rel="stylesheet" href="/css/main.css" type="text/css"/>
200 neysx 1.165 <link REL="shortcut icon" HREF="http://www.gentoo.org/favicon.ico" TYPE="image/x-icon"/>
201    
202 swift 1.73 <xsl:if test="/mainpage/@id='news'">
203     <link rel="alternate" type="application/rss+xml" title="Gentoo Linux News RDF" href="http://www.gentoo.org/rdf/en/gentoo-news.rdf" />
204     </xsl:if>
205     <xsl:choose>
206     <xsl:when test="/mainpage | /news">
207 neysx 1.129 <title>Gentoo Linux -- <xsl:value-of select="title"/></title>
208 swift 1.73 </xsl:when>
209 neysx 1.172 <!-- Can't find any use for this. Will be deleted.
210 swift 1.73 <xsl:when test="/email">
211     <title><xsl:value-of select="subject"/></title>
212     </xsl:when>
213 neysx 1.172 -->
214 swift 1.73 </xsl:choose>
215 neysx 1.165 </head>
216 swift 1.100 <body style="margin:0px;" bgcolor="#000000">
217 drobbins 1.1
218 swift 1.73 <table border="0" width="100%" cellspacing="0" cellpadding="0">
219     <tr>
220     <td valign="top" height="125" width="1%" bgcolor="#45347b">
221 neysx 1.146 <a href="/"><img border="0" src="/images/gtop-www.jpg" alt="Gentoo Logo"/></a>
222 swift 1.73 </td>
223 neysx 1.146
224 neysx 1.149 <td valign="bottom" align="left" bgcolor="#000000" colspan="2" lang="en">
225 swift 1.73 <p class="menu">
226     <xsl:choose>
227     <xsl:when test="/mainpage/@id='about'">
228 neysx 1.146 <a class="highlight" href="/main/en/about.xml">About</a>
229 swift 1.73 </xsl:when>
230     <xsl:otherwise>
231 neysx 1.146 <a class="menulink" href="/main/en/about.xml">About</a>
232 swift 1.73 </xsl:otherwise>
233     </xsl:choose>
234 neysx 1.146 |
235 swift 1.73 <xsl:choose>
236     <xsl:when test="/mainpage/@id='projects'">
237 neysx 1.146 <a class="highlight" href="/proj/en/index.xml?showlevel=1">Projects</a>
238 swift 1.73 </xsl:when>
239     <xsl:otherwise>
240 neysx 1.146 <a class="menulink" href="/proj/en/index.xml?showlevel=1">Projects</a>
241 swift 1.73 </xsl:otherwise>
242     </xsl:choose>
243 neysx 1.146 |
244 swift 1.73 <xsl:choose>
245     <xsl:when test="/mainpage/@id='docs'">
246 neysx 1.146 <a class="highlight" href="/doc/en/index.xml">Docs</a>
247 swift 1.73 </xsl:when>
248     <xsl:otherwise>
249 neysx 1.146 <a class="menulink" href="/doc/en/index.xml">Docs</a>
250 swift 1.73 </xsl:otherwise>
251     </xsl:choose>
252 neysx 1.146 | <a class="menulink" href="http://forums.gentoo.org">Forums</a>
253     |
254 swift 1.73 <xsl:choose>
255     <xsl:when test="/mainpage/@id='lists'">
256 neysx 1.146 <a class="highlight" href="/main/en/lists.xml">Lists</a>
257 swift 1.73 </xsl:when>
258     <xsl:otherwise>
259 neysx 1.146 <a class="menulink" href="/main/en/lists.xml">Lists</a>
260 swift 1.73 </xsl:otherwise>
261 neysx 1.149 </xsl:choose>
262     | <a class="menulink" href="http://bugs.gentoo.org">Bugs</a>
263     | <a class="menulink" href="http://www.cafepress.com/officialgentoo/">Store</a>
264     |
265 swift 1.73 <xsl:choose>
266     <xsl:when test="/mainpage/@id='newsletter'">
267 neysx 1.146 <a class="highlight" href="/news/en/gwn/gwn.xml"> GWN</a>
268 swift 1.73 </xsl:when>
269     <xsl:otherwise>
270 neysx 1.146 <a class="menulink" href="/news/en/gwn/gwn.xml"> GWN</a>
271 swift 1.73 </xsl:otherwise>
272     </xsl:choose>
273 neysx 1.146 |
274 swift 1.73 <xsl:choose>
275     <xsl:when test="/mainpage/@id='where'">
276 neysx 1.146 <a class="highlight" href="/main/en/where.xml">Get Gentoo!</a>
277 swift 1.73 </xsl:when>
278     <xsl:otherwise>
279 neysx 1.146 <a class="menulink" href="/main/en/where.xml">Get Gentoo!</a>
280 swift 1.73 </xsl:otherwise>
281     </xsl:choose>
282 neysx 1.146 |
283 swift 1.73 <xsl:choose>
284 swift 1.114 <xsl:when test="/mainpage/@id='support'">
285 neysx 1.146 <a class="highlight" href="/main/en/support.xml">Support</a>
286 swift 1.114 </xsl:when>
287     <xsl:otherwise>
288 neysx 1.146 <a class="menulink" href="/main/en/support.xml">Support</a>
289 swift 1.114 </xsl:otherwise>
290     </xsl:choose>
291 neysx 1.146 |
292 swift 1.114 <xsl:choose>
293 swift 1.73 <xsl:when test="/mainpage/@id='sponsors'">
294     <a class="highlight" href="/main/en/sponsors.xml">Sponsors</a>
295     </xsl:when>
296     <xsl:otherwise>
297 blackace 1.98 <a class="menulink" href="/main/en/sponsors.xml">Sponsors</a>
298 swift 1.73 </xsl:otherwise>
299     </xsl:choose>
300 neysx 1.146 | <a class="menulink" href="http://planet.gentoo.org">Planet</a>
301 swift 1.73 </p>
302     </td>
303     </tr>
304     <tr>
305     <td valign="top" align="right" width="1%" bgcolor="#dddaec">
306     <table width="100%" cellspacing="0" cellpadding="0" border="0">
307     <tr>
308     <td height="1%" valign="top" align="right">
309     <img src="/images/gridtest.gif" alt="Gentoo Spaceship"/>
310     </td>
311     </tr>
312     <tr>
313 neysx 1.149 <td height="99%" valign="top" align="left">
314 swift 1.73 <!--info goes here-->
315     <table cellspacing="0" cellpadding="5" border="0">
316     <tr>
317 neysx 1.149 <td valign="top" class="leftmenu" lang="en">
318 swift 1.73 <p class="altmenu">
319 neysx 1.149 Installation:
320     <br/>
321     <a class="altlink" href="/doc/en/handbook/index.xml">Gentoo Handbook</a>
322     <br/>
323     <a class="altlink" href="/doc/en/index.xml?catid=install#doc_chap2">Installation Docs</a>
324     <br/><br/>
325 swift 1.73 Documentation:
326     <br/>
327 neysx 1.170 <a class="altlink" href="/doc/en/">Home</a>
328     <br/>
329     <a class="altlink" href="/doc/en/list.xml">Listing</a>
330 drobbins 1.1 <br/>
331 neysx 1.149 <a class="altlink" href="/main/en/about.xml">About Gentoo</a>
332 swift 1.73 <br/>
333 neysx 1.149 <a class="altlink" href="/main/en/philosophy.xml">Philosophy</a>
334 swift 1.73 <br/>
335 neysx 1.149 <a class="altlink" href="/main/en/contract.xml">Social Contract</a>
336 swift 1.73 <br/><br/>
337 neysx 1.149 Resources:
338 swift 1.73 <br/>
339 neysx 1.149 <a class="altlink" href="http://bugs.gentoo.org">Bug Tracker</a>
340 swift 1.73 <br/>
341 swift 1.162 <a class="altlink" href="/proj/en/devrel/roll-call/userinfo.xml">Developer List</a>
342     <br/>
343 neysx 1.149 <a class="altlink" href="http://forums.gentoo.org">Discussion Forums</a>
344 swift 1.73 <br/>
345 plasmaroo 1.173 <a class="altlink" href="http://torrents.gentoo.org/">Gentoo BitTorrents</a>
346 swift 1.162 <br/>
347     <a class="altlink" href="/proj/en/glep/">Gentoo Linux Enhancement Proposals</a>
348     <br/>
349     <a class="altlink" href="/main/en/irc.xml">IRC Channels</a>
350     <br/>
351 neysx 1.149 <a class="altlink" href="/main/en/lists.xml">Mailing Lists</a>
352 klieber 1.108 <br/>
353 swift 1.162 <a class="altlink" href="/main/en/mirrors.xml">Mirrors</a>
354 klieber 1.75 <br/>
355 swift 1.162 <a class="altlink" href="/main/en/name-logo.xml">Name and Logo Guidelines</a>
356 swift 1.73 <br/>
357 neysx 1.149 <a class="altlink" href="http://packages.gentoo.org/">Online Package Database</a>
358 swift 1.73 <br/>
359 swift 1.162 <a class="altlink" href="/security/en/index.xml">Security Announcements</a>
360 swift 1.73 <br/>
361 neysx 1.149 <a class="altlink" href="/proj/en/devrel/staffing-needs/">Staffing Needs</a>
362     <br/>
363 swift 1.162 <a class="altlink" href="http://vendors.gentoo.org/">Supporting Vendors</a>
364 swift 1.155 <br/>
365 swift 1.162 <a class="altlink" href="http://viewcvs.gentoo.org/">View our CVS</a>
366    
367 neysx 1.146 <!--
368     <a class="altlink" href="/dyn/index-cvs.xml">Daily CVS ChangeLog</a>
369     -->
370 swift 1.73 <!--<a class="altlink" href="http://stats.gentoo.org">Gentoo Usage Statistics</a>
371     <br/>
372     <a class="altlink" href="http://stable.gentoo.org">Gentoo Stable Project</a>
373     <br/>
374     -->
375     <br/><br/>
376     Graphics:
377     <br/>
378     <a class="altlink" href="/main/en/graphics.xml">Logos and themes</a>
379     <br/>
380     <a class="altlink" href="/dyn/icons.xml">Icons</a>
381     <br/>
382     <a class="altlink" href="/main/en/shots.xml">ScreenShots</a>
383 blackace 1.98 <br/><br/>
384 swift 1.73 Miscellaneous Resources:
385 neysx 1.149 <br/>
386     <a class="altlink" href="http://www.cafepress.com/officialgentoo/">Gentoo Linux Store</a>
387     <br/>
388 swift 1.73 <a class="altlink" href="/main/en/projects.xml">Gentoo-hosted projects</a>
389     <br/>
390     <a class="altlink" href="/main/en/articles.xml">IBM dW/Intel article archive</a>
391     <xsl:if test="/mainpage/@id='news'">
392 neysx 1.149 <br/><br/>
393 swift 1.73 Older News:<br/>
394 neysx 1.146 <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()&gt;$newsitemcount][position()&lt;20]/text()">
395 swift 1.73 <xsl:variable name="newsuri" select="."/>
396 neysx 1.146 <a class="altlink" href="{$newsuri}"><xsl:value-of select="document(.)/news/title"/></a>
397     <br/>
398 swift 1.73 </xsl:for-each>
399 swift 1.61 </xsl:if>
400 swift 1.73 </p>
401     <br/><br />
402     </td>
403     </tr>
404     </table>
405     </td>
406     </tr>
407     </table>
408     </td>
409 neysx 1.146 <!-- Content below top menu and between left menu and ads -->
410     <td valign="top" bgcolor="#ffffff">
411 swift 1.73 <xsl:choose>
412     <xsl:when test="/mainpage/@id='news'">
413 neysx 1.146 <p class="news">
414 neysx 1.151 <img class="newsicon" src="/images/gentoo-new.gif" alt="Gentoo logo"/>
415 neysx 1.149 <span class="newsitem" lang="en">We produce Gentoo Linux, a special flavor of Linux that
416 neysx 1.146 can be automatically optimized and customized for just
417     about any application or need. Extreme performance,
418     configurability and a top-notch user and developer
419     community are all hallmarks of the Gentoo experience.
420     To learn more, read our <b><a href="/main/en/about.xml">about
421     page</a></b>.</span>
422     </p>
423     <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()&lt;=$newsitemcount]/text()">
424 neysx 1.154 <xsl:call-template name="newscontent">
425     <xsl:with-param name="thenews" select="document(.)/news"/>
426     <xsl:with-param name="summary" select="'yes'"/>
427     <xsl:with-param name="link" select="."/>
428     </xsl:call-template>
429 neysx 1.146 </xsl:for-each>
430 swift 1.73 </xsl:when>
431     <xsl:when test="/news">
432 neysx 1.154 <xsl:call-template name="newscontent">
433     <xsl:with-param name="thenews" select="/news"/>
434     <xsl:with-param name="summary" select="no"/>
435     </xsl:call-template>
436 swift 1.73 </xsl:when>
437     </xsl:choose>
438 neysx 1.146 <br/>
439     <table border="0" class="content">
440 klieber 1.107 <tr>
441     <td>
442 neysx 1.146 <xsl:apply-templates select="chapter"/>
443 klieber 1.107 </td>
444     </tr>
445 neysx 1.146 </table>
446     <br/>
447     <xsl:if test="/mainpage/license">
448     <xsl:apply-templates select="license" />
449     </xsl:if>
450     <br/>
451     <!--content end-->
452 swift 1.73 </td>
453 neysx 1.146 <td width="1%" bgcolor="#dddaec" valign="top">
454     <xsl:call-template name="rhcol"/>
455 swift 1.73 </td>
456     </tr>
457 neysx 1.149 <tr lang="en">
458 neysx 1.146 <td align="right" class="infohead" colspan="3">
459 neysx 1.171 Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Foundation, Inc. Questions, Comments? Email <a class="highlight" href="mailto:www@gentoo.org">www@gentoo.org</a>.
460 swift 1.73 </td>
461     </tr>
462 drobbins 1.1 </table>
463 swift 1.73
464     </body>
465 neysx 1.165 </html>
466 swift 1.73 </xsl:template>
467    
468     <!-- Mail template -->
469     <xsl:template match="mail">
470 neysx 1.156 <a>
471     <xsl:attribute name="href">
472     <xsl:choose>
473     <xsl:when test="@link">
474     <xsl:value-of select="concat('mailto:', @link)"/>
475     </xsl:when>
476     <xsl:otherwise>
477     <xsl:value-of select="concat('mailto:', .)"/>
478     </xsl:otherwise>
479     </xsl:choose>
480     </xsl:attribute>
481     <xsl:value-of select="."/>
482     </a>
483    
484 swift 1.73 </xsl:template>
485    
486     <!-- Mail inside <author>...</author> -->
487     <xsl:template match="/guide/author/mail|/book/author/mail">
488     <b>
489     <a class="altlink" href="mailto:{@link}"><xsl:value-of select="."/></a>
490     </b>
491     </xsl:template>
492    
493     <!-- Author -->
494     <xsl:template match="author">
495     <xsl:apply-templates/>
496 neysx 1.146 <xsl:if test="@title">
497     <xsl:if test="$style != 'printable'">
498     <br/>
499     </xsl:if>
500     <xsl:if test="$style = 'printable'">&#160;</xsl:if>
501     <i><xsl:value-of select="@title"/></i>
502     </xsl:if>
503 swift 1.73 <br/>
504 neysx 1.146 <xsl:if test="$style != 'printable' and position()!=last()">
505     <br/>
506     </xsl:if>
507 swift 1.73 </xsl:template>
508    
509     <!-- Chapter -->
510     <xsl:template match="chapter">
511 neysx 1.176 <xsl:variable name="chid"><xsl:number/></xsl:variable>
512     <xsl:choose>
513     <xsl:when test="title">
514 swift 1.73 <p class="chaphead">
515 neysx 1.176 <xsl:if test="@id"><a name="{@id}"/></xsl:if>
516     <a name="doc_chap{$chid}"/>
517     <xsl:if test="not(/mainpage) and count(//chapter)>1">
518     <span class="chapnum"><xsl:number/>.&#160;</span>
519     </xsl:if>
520     <xsl:value-of select="title"/>
521 drobbins 1.1 </p>
522 neysx 1.176 </xsl:when>
523     <xsl:otherwise>
524     <xsl:if test="/guide">
525     <p class="chaphead">
526     <span class="chapnum">
527     <a name="doc_chap{$chid}"><xsl:number/>.</a>
528     </span>
529     </p>
530     </xsl:if>
531     </xsl:otherwise>
532     </xsl:choose>
533     <xsl:apply-templates select="body">
534     <xsl:with-param name="chid" select="$chid"/>
535     </xsl:apply-templates>
536     <xsl:apply-templates select="section">
537     <xsl:with-param name="chid" select="$chid"/>
538     </xsl:apply-templates>
539 swift 1.73 </xsl:template>
540    
541    
542     <!-- Section template -->
543     <xsl:template match="section">
544     <xsl:param name="chid"/>
545     <xsl:if test="title">
546     <xsl:variable name="sectid">doc_chap<xsl:value-of select="$chid"/>_sect<xsl:number/></xsl:variable>
547 swift 1.105 <xsl:if test="@id">
548     <a name="{@id}"/>
549     </xsl:if>
550 swift 1.73 <p class="secthead">
551 neysx 1.132 <a name="{$sectid}"><xsl:value-of select="title"/></a>
552 swift 1.73 </p>
553 swift 1.86 </xsl:if>
554 swift 1.73 <xsl:apply-templates select="body">
555     <xsl:with-param name="chid" select="$chid"/>
556     </xsl:apply-templates>
557     </xsl:template>
558    
559     <!-- Figure template -->
560     <xsl:template match="figure">
561     <xsl:param name="chid"/>
562 swift 1.96 <xsl:variable name="fignum"><xsl:number level="any" from="chapter" count="figure"/></xsl:variable>
563 swift 1.73 <xsl:variable name="figid">doc_chap<xsl:value-of select="$chid"/>_fig<xsl:value-of select="$fignum"/></xsl:variable>
564 neysx 1.146 <xsl:variable name="llink">
565     <xsl:choose>
566     <xsl:when test="starts-with(@link,'http://www.gentoo.org/')">
567     <xsl:value-of select="substring-after(@link, 'http://www.gentoo.org')"/>
568     </xsl:when>
569     <xsl:otherwise>
570     <xsl:value-of select="@link"/>
571     </xsl:otherwise>
572     </xsl:choose>
573     </xsl:variable>
574 swift 1.73 <br/>
575     <a name="{$figid}"/>
576     <table cellspacing="0" cellpadding="0" border="0">
577     <tr>
578 neysx 1.146 <td bgcolor="#7a5ada">
579     <p class="codetitle">
580 swift 1.73 <xsl:choose>
581     <xsl:when test="@caption">
582 neysx 1.123 <xsl:value-of select="func:gettext('Figure')"/>&#160;<xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/><xsl:value-of select="func:gettext('SpaceBeforeColon')"/>: <xsl:value-of select="@caption"/>
583 swift 1.73 </xsl:when>
584     <xsl:otherwise>
585 neysx 1.123 <xsl:value-of select="func:gettext('Figure')"/>&#160;<xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/>
586 swift 1.73 </xsl:otherwise>
587     </xsl:choose>
588 drobbins 1.1 </p>
589 swift 1.73 </td>
590     </tr>
591     <tr>
592     <td align="center" bgcolor="#ddddff">
593 drobbins 1.1 <xsl:choose>
594 swift 1.73 <xsl:when test="@short">
595 neysx 1.146 <img src="{$llink}" alt="Fig. {$fignum}: {@short}"/>
596 drobbins 1.1 </xsl:when>
597     <xsl:otherwise>
598 neysx 1.146 <img src="{$llink}" alt="Fig. {$fignum}"/>
599 drobbins 1.1 </xsl:otherwise>
600     </xsl:choose>
601 swift 1.73 </td>
602     </tr>
603     </table>
604     <br/>
605     </xsl:template>
606    
607     <!--figure without a caption; just a graphical element-->
608     <xsl:template match="fig">
609     <center>
610     <xsl:choose>
611     <xsl:when test="@linkto">
612     <a href="{@linkto}"><img border="0" src="{@link}" alt="{@short}"/></a>
613     </xsl:when>
614     <xsl:otherwise>
615     <img src="{@link}" alt="{@short}"/>
616     </xsl:otherwise>
617     </xsl:choose>
618     </center>
619     </xsl:template>
620    
621     <!-- Line break -->
622     <xsl:template match="br">
623     <br/>
624     </xsl:template>
625    
626     <!-- Note -->
627     <xsl:template match="note">
628     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
629     <tr>
630     <td bgcolor="#bbffbb">
631     <p class="note">
632 neysx 1.123 <b><xsl:value-of select="func:gettext('Note')"/>: </b>
633 swift 1.73 <xsl:apply-templates/>
634     </p>
635     </td>
636     </tr>
637     </table>
638     </xsl:template>
639    
640     <!-- Important item -->
641     <xsl:template match="impo">
642     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
643     <tr>
644     <td bgcolor="#ffffbb">
645     <p class="note">
646 neysx 1.123 <b><xsl:value-of select="func:gettext('Important')"/>: </b>
647 swift 1.73 <xsl:apply-templates/>
648     </p>
649     </td>
650     </tr>
651     </table>
652     </xsl:template>
653    
654     <!-- Warning -->
655     <xsl:template match="warn">
656     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
657     <tr>
658     <td bgcolor="#ffbbbb">
659     <p class="note">
660 neysx 1.123 <b><xsl:value-of select="func:gettext('Warning')"/>: </b>
661 drobbins 1.1 <xsl:apply-templates/>
662 swift 1.73 </p>
663     </td>
664     </tr>
665     </table>
666     </xsl:template>
667    
668     <!-- Code note -->
669     <xsl:template match="codenote">
670 neysx 1.146 <span class="comment">
671     <xsl:if test='not(starts-with(., "("))'>(</xsl:if>
672     <xsl:apply-templates/>
673     <xsl:if test='not(starts-with(., "("))'>)</xsl:if>
674     </span>
675 swift 1.73 </xsl:template>
676    
677     <!-- Regular comment -->
678     <xsl:template match="comment">
679 neysx 1.172 <span class="code-comment"><xsl:apply-templates/></span>
680 swift 1.73 </xsl:template>
681    
682 neysx 1.172 <!-- Colour coding inside <pre> -->
683 swift 1.73 <xsl:template match="i">
684 neysx 1.172 <span class="code-input"><xsl:apply-templates/></span>
685     </xsl:template>
686    
687     <xsl:template match="var">
688     <span class="code-variable"><xsl:apply-templates/></span>
689     </xsl:template>
690    
691     <xsl:template match="ident">
692     <span class="code-identifier"><xsl:apply-templates/></span>
693 swift 1.73 </xsl:template>
694    
695 neysx 1.172 <xsl:template match="keyword">
696     <span class="code-keyword"><xsl:apply-templates/></span>
697     </xsl:template>
698    
699     <xsl:template match="stmt">
700     <span class="code-statement"><xsl:apply-templates/></span>
701     </xsl:template>
702    
703     <xsl:template match="const">
704     <span class="code-constant"><xsl:apply-templates/></span>
705     </xsl:template>
706    
707    
708 swift 1.73 <!-- Bold -->
709     <xsl:template match="b">
710     <b><xsl:apply-templates/></b>
711     </xsl:template>
712    
713 neysx 1.166 <!-- Superscript -->
714     <xsl:template match="sup">
715     <sup><xsl:apply-templates/></sup>
716     </xsl:template>
717    
718     <!-- Subscript -->
719     <xsl:template match="sub">
720     <sub><xsl:apply-templates/></sub>
721     </xsl:template>
722    
723 swift 1.73 <!-- Brite -->
724     <xsl:template match="brite">
725     <font color="#ff0000">
726     <b><xsl:apply-templates/></b>
727     </font>
728     </xsl:template>
729    
730     <!-- Body inside email -->
731 neysx 1.172 <!-- Can't find any use for this, will be deleted
732 drobbins 1.4 <xsl:template match="/email/body">
733 swift 1.73 <table border="0">
734     <tr>
735     <td>
736     <span class="content">
737     <p class="secthead">
738     Subject: <xsl:value-of select="/email/subject"/>
739     </p>
740     <p class="secthead">
741     <font color="#000000">
742     List: <xsl:value-of select="/email/list"/> at gentoo.org<br/>
743     Date: <xsl:value-of select="/email/date"/><br/>
744     From: <xsl:value-of select="/email/from"/><br/><br/>
745     <xsl:if test="/email/nav/prev">
746     <xsl:for-each select="/email/nav/prev[position()=1]/text()">
747     <xsl:variable name="navloc" select="."/>
748     <xsl:variable name="navfile">/dyn/lists/<xsl:value-of select="/email/list"/>/<xsl:value-of select="."/>.xml</xsl:variable>
749     Previous: <a href="{$navfile}"><xsl:value-of select="document($navfile)/email/subject"/></a><br/>
750     </xsl:for-each>
751     </xsl:if>
752     <xsl:if test="/email/nav/next">
753     <xsl:for-each select="/email/nav/next[position()=1]/text()">
754     <xsl:variable name="navloc" select="."/>
755     <xsl:variable name="navfile">/dyn/lists/<xsl:value-of select="/email/list"/>/<xsl:value-of select="."/>.xml</xsl:variable>
756     Next: <a href="{$navfile}"><xsl:value-of select="document($navfile)/email/subject"/></a><br/>
757     </xsl:for-each>
758     </xsl:if>
759     <xsl:if test="/email/in-reply-to">
760     <xsl:for-each select="/email/in-reply-to[position()=1]/text()">
761     <xsl:variable name="irtloc" select="."/>
762     <xsl:variable name="irtfile">/dyn/lists/<xsl:value-of select="/email/list"/>/<xsl:value-of select="."/>.xml</xsl:variable>
763     In Reply To: <a href="{$irtfile}"><xsl:value-of select="document($irtfile)/email/subject"/></a><br/>
764     </xsl:for-each>
765     </xsl:if>
766     <xsl:if test="/email/replies">
767     <br/>Replies to this message:<br/>
768     <xsl:for-each select="/email/replies/reply/text()">
769     <xsl:variable name="rloc" select="."/>
770     <xsl:variable name="rfile">/dyn/lists/<xsl:value-of select="/email/list"/>/<xsl:value-of select="."/>.xml</xsl:variable>
771     &#160;<a href="{$rfile}"><xsl:value-of select="document($rfile)/email/subject"/></a><br/>
772     </xsl:for-each>
773     </xsl:if>
774     </font>
775     </p>
776     </span>
777     <pre>
778     <xsl:apply-templates/>
779     </pre>
780     </td>
781     </tr>
782     </table>
783     </xsl:template>
784 neysx 1.172 -->
785 swift 1.73
786     <!-- Body -->
787     <xsl:template match="body">
788     <xsl:param name="chid"/>
789     <xsl:apply-templates>
790     <xsl:with-param name="chid" select="$chid"/>
791     </xsl:apply-templates>
792     </xsl:template>
793    
794     <!-- Command or input, not to use inside <pre> -->
795     <xsl:template match="c">
796     <span class="code"><xsl:apply-templates/></span>
797     </xsl:template>
798    
799     <!-- Box with small text -->
800 neysx 1.172 <!-- Is this really used?
801 swift 1.73 <xsl:template match="box">
802     <p class="infotext"><xsl:apply-templates/></p>
803     </xsl:template>
804 neysx 1.172 -->
805 swift 1.73
806     <!-- Preserve whitespace, aka Code Listing -->
807     <xsl:template match="pre">
808     <xsl:param name="chid"/>
809     <xsl:variable name="prenum"><xsl:number level="any" from="chapter" count="pre"/></xsl:variable>
810     <xsl:variable name="preid">doc_chap<xsl:value-of select="$chid"/>_pre<xsl:value-of select="$prenum"/></xsl:variable>
811     <a name="{$preid}"/>
812     <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
813     <tr>
814 neysx 1.146 <td bgcolor="#7a5ada">
815     <p class="codetitle">
816 neysx 1.139 <xsl:value-of select="func:gettext('CodeListing')"/>&#160;<xsl:if test="$chid"><xsl:value-of select="$chid"/>.</xsl:if><xsl:value-of select="$prenum"/>
817     <xsl:if test="@caption">
818     <xsl:value-of select="func:gettext('SpaceBeforeColon')"/>: <xsl:value-of select="@caption"/>
819     </xsl:if>
820 swift 1.73 </p>
821 drobbins 1.1 </td>
822 swift 1.73 </tr>
823     <tr>
824 neysx 1.172 <td bgcolor="#eeeeff">
825 swift 1.73 <pre>
826 drobbins 1.1 <xsl:apply-templates/>
827 swift 1.73 </pre>
828 drobbins 1.1 </td>
829 swift 1.73 </tr>
830     </table>
831     </xsl:template>
832    
833     <!-- Path -->
834     <xsl:template match="path">
835     <span class="path"><xsl:value-of select="."/></span>
836     </xsl:template>
837    
838     <!-- Url -->
839     <xsl:template match="uri">
840 neysx 1.165 <xsl:param name="paramlink"/>
841 swift 1.73 <!-- expand templates to handle things like <uri link="http://bar"><c>foo</c></uri> -->
842     <xsl:choose>
843     <xsl:when test="@link">
844 swift 1.87 <xsl:choose>
845 neysx 1.147 <xsl:when test="($TTOP = 'sections') and (starts-with(@link, '?'))">
846     <!-- Handbook link pointing to another part/chapter when viewing a single page,
847     cannot be a link because we have no idea where to link to
848     Besides, we have no way of knowing the language unless told via a param -->
849     <xsl:variable name="nolink"><xsl:value-of select="func:gettext('hb_file', $glang)"/></xsl:variable>
850     <span title="{$nolink}"><font color="#404080">(<xsl:apply-templates/>)</font></span>
851     </xsl:when>
852 swift 1.96 <xsl:when test="($TTOP = 'book') and ($full = 0) and (starts-with(@link, '?'))">
853 neysx 1.112 <!-- Handbook link pointing to another part/chapter, normal case -->
854 neysx 1.146 <xsl:choose>
855     <xsl:when test="$style != 'printable'">
856     <a href="{$LINK}{@link}"><xsl:apply-templates/></a>
857     </xsl:when>
858     <xsl:otherwise>
859     <a href="{$LINK}{@link}&amp;style=printable"><xsl:apply-templates/></a>
860     </xsl:otherwise>
861     </xsl:choose>
862 swift 1.96 </xsl:when>
863     <xsl:when test="($TTOP = 'book') and ($full = 1) and (starts-with(@link, '?'))">
864 blackace 1.98 <!-- Handbook link pointing to another part/chapter
865 swift 1.96 Handbook is being rendered in a single page (full=1)
866 neysx 1.112 Hence link needs to be rewritten as a local one
867 neysx 1.147 i.e. ?part=1&chap=3#doc_chap1 must become #book_part1_chap3__chap1 Case 1a
868     i.e. ?part=1&chap=3#anID must become #anID Case 1b
869 neysx 1.112 or ?part=1&chap=3 must become #book_part1_chap3 Case 2
870     or ?part=2 must become #book_part2 Case 3-->
871 swift 1.96 <xsl:choose>
872 neysx 1.112 <xsl:when test="contains(@link, 'chap=') and contains(@link, '#doc_')">
873 neysx 1.147 <!-- Link points inside a chapter (Case 1a)-->
874 neysx 1.112 <xsl:param name="linkpart" select="substring-after(substring-before(@link, '&amp;'), '=')" />
875     <xsl:param name="linkchap" select="substring-before(substring-after(substring-after(@link, '&amp;'), '='), '#doc_')" />
876     <xsl:param name="linkanch" select="substring-after(@link, '#doc_')" />
877     <a href="#book_part{$linkpart}_chap{$linkchap}__{$linkanch}"><xsl:apply-templates /></a>
878     </xsl:when>
879 neysx 1.147 <xsl:when test="contains(@link, 'chap=') and contains(@link, '#')">
880     <!-- Link points inside a chapter via an ID (Case 1b)
881     (IDs are expected to be unique throughout a handbook) -->
882     <xsl:param name="linkanch" select="substring-after(@link, '#')" />
883     <a href="#{$linkanch}"><xsl:apply-templates /></a>
884     </xsl:when>
885 neysx 1.112 <xsl:when test="contains(@link, 'chap=')">
886     <!-- Link points to a chapter (Case 2)-->
887 swift 1.96 <xsl:param name="linkpart" select="substring-after(substring-before(@link, '&amp;'), '=')" />
888     <xsl:param name="linkchap" select="substring-after(substring-after(@link, '&amp;'), '=')" />
889     <a href="#book_part{$linkpart}_chap{$linkchap}"><xsl:apply-templates /></a>
890     </xsl:when>
891     <xsl:otherwise>
892 neysx 1.112 <!-- Link points to a part (Case 3)-->
893 swift 1.96 <xsl:param name="linkpart" select="substring-after(@link, '=')" />
894     <a href="#book_part{$linkpart}"><xsl:apply-templates/></a>
895     </xsl:otherwise>
896     </xsl:choose>
897     </xsl:when>
898     <xsl:when test="($TTOP = 'book') and ($full = 1) and (starts-with(@link, '#'))">
899 neysx 1.147 <!-- Handbook link pointing to another place in same part/chapter
900 swift 1.96 Handbook is being rendered in a single page (full=1)
901 blackace 1.98 Hence link needs to be rewritten as an internal one that is unique
902 swift 1.96 for the whole handbook, i.e.
903     #doc_part1_chap3 becomes #book_{UNIQUEID}_part1_chap3, but
904 neysx 1.147 #anything_else_like_an_ID is left unchanged (IDs are expected to be unique throughout a handbook)-->
905 swift 1.96 <xsl:choose>
906     <xsl:when test="starts-with(@link, '#doc_')">
907     <xsl:param name="locallink" select="substring-after(@link, 'doc_')" />
908     <a href="#book_{generate-id(/)}_{$locallink}"><xsl:apply-templates /></a>
909     </xsl:when>
910     <xsl:otherwise>
911     <a href="{@link}"><xsl:apply-templates/></a>
912     </xsl:otherwise>
913     </xsl:choose>
914 swift 1.87 </xsl:when>
915     <xsl:otherwise>
916 neysx 1.165 <xsl:variable name="theurl">
917     <xsl:choose>
918     <xsl:when test="@link"><xsl:value-of select="@link" /></xsl:when>
919     <xsl:otherwise><xsl:value-of select="text()" /></xsl:otherwise>
920     </xsl:choose>
921     </xsl:variable>
922    
923     <xsl:variable name="thelink">
924     <xsl:choose>
925     <xsl:when test="name(..)='insert' and $theurl='$redirect' and $paramlink"><xsl:value-of select="$paramlink" /></xsl:when>
926     <xsl:when test="name(..)='insert' and $theurl='$originalversion' and $paramlink">
927     <xsl:variable name="temp">
928     <xsl:value-of select="$paramlink"/>
929     <xsl:if test="$style = 'printable'">&amp;style=printable</xsl:if>
930     <xsl:if test="$full != '0'">&amp;full=1</xsl:if>
931     <xsl:if test="$part != '0'">&amp;part=<xsl:value-of select="$part"/></xsl:if>
932     <xsl:if test="$chap != '0'">&amp;chap=<xsl:value-of select="$chap"/></xsl:if>
933     </xsl:variable>
934     <xsl:choose>
935     <xsl:when test="contains($temp, '&amp;')">
936     <xsl:value-of select="concat(substring-before($temp,'&amp;'), '?', substring-after($temp,'&amp;'))"/>
937     </xsl:when>
938     <xsl:otherwise>
939     <xsl:value-of select="$temp"/>
940     </xsl:otherwise>
941     </xsl:choose>
942     </xsl:when>
943     <xsl:otherwise><xsl:value-of select="$theurl" /></xsl:otherwise>
944     </xsl:choose>
945     </xsl:variable>
946    
947 neysx 1.159 <!-- Strip http://www.gentoo.org from links
948     Has no effect on actual www.g.o but helps when surfing on a local copy
949     Rewrite http://www.gentoo.org/cgi-bin/viewcvs/ to use viewcvs.gentoo.org
950     -->
951 neysx 1.146 <xsl:variable name="llink">
952     <xsl:choose>
953 neysx 1.165 <xsl:when test="starts-with($thelink, 'http://www.gentoo.org/cgi-bin/viewcvs.cgi')"><xsl:value-of select="concat('http://viewcvs.gentoo.org', substring-after($thelink, 'http://www.gentoo.org/cgi-bin/viewcvs.cgi'))" /></xsl:when>
954     <xsl:when test="starts-with($thelink, '/cgi-bin/viewcvs.cgi')"><xsl:value-of select="concat('http://viewcvs.gentoo.org', substring-after($thelink, '/cgi-bin/viewcvs.cgi'))" /></xsl:when>
955     <xsl:when test="starts-with($thelink, 'http://www.gentoo.org/')"><xsl:value-of select="substring-after($thelink, 'http://www.gentoo.org')" /></xsl:when>
956 neysx 1.163 <!-- Add catid to links to /doc/LL/index.xml -->
957 neysx 1.165 <xsl:when test="$catid != '0' and starts-with($thelink, '/doc/') and (substring-after(substring-after($thelink, '/doc/'), '/')='' or substring-after(substring-after($thelink, '/doc/'), '/')='index.xml')">
958     <xsl:value-of select="concat($thelink, '?catid=', $catid)"/>
959 neysx 1.163 </xsl:when>
960 neysx 1.165 <xsl:otherwise><xsl:value-of select="$thelink" /></xsl:otherwise>
961 neysx 1.146 </xsl:choose>
962     </xsl:variable>
963    
964     <!-- Now, insert style=printable in the URL if necessary -->
965     <xsl:variable name="alink">
966     <xsl:choose>
967     <xsl:when test="$style != 'printable' or contains($llink, 'style=printable')">
968     <!-- Not printable style or style=printable already in URL, copy link -->
969     <xsl:value-of select="$llink" />
970     </xsl:when>
971     <xsl:when test="contains($llink, '://')">
972     <!-- External link, copy link -->
973     <xsl:value-of select="$llink" />
974     </xsl:when>
975     <xsl:when test="starts-with($llink, '#')">
976     <!-- Anchor, copy link -->
977     <xsl:value-of select="$llink" />
978     </xsl:when>
979     <xsl:otherwise>
980     <!-- We should have eliminated all other cases,
981     style printable, local link, then insert ?style=printable -->
982     <xsl:choose>
983     <xsl:when test="starts-with($llink, '?')">
984     <xsl:value-of select="concat( '?style=printable&amp;', substring-after($llink, '?'))" />
985     </xsl:when>
986     <xsl:when test="contains($llink, '.xml?')">
987     <xsl:value-of select="concat(substring-before($llink, '.xml?'), '.xml?style=printable&amp;', substring-after($llink, '.xml?'))" />
988     </xsl:when>
989     <xsl:when test="contains($llink, '.xml#')">
990     <xsl:value-of select="concat(substring-before($llink, '.xml#'), '.xml?style=printable#', substring-after($llink, '.xml#'))" />
991     </xsl:when>
992     <xsl:when test="substring-after($llink, '.xml') = ''">
993     <xsl:value-of select="concat($llink, '?style=printable')" />
994     </xsl:when>
995     <xsl:otherwise>
996     <!-- Have I forgotten anything?
997     Copy link -->
998     <xsl:value-of select="$llink" />
999     </xsl:otherwise>
1000     </xsl:choose>
1001     </xsl:otherwise>
1002     </xsl:choose>
1003     </xsl:variable>
1004     <a href="{$alink}"><xsl:apply-templates/></a>
1005 swift 1.87 </xsl:otherwise>
1006     </xsl:choose>
1007 swift 1.73 </xsl:when>
1008     <xsl:otherwise>
1009     <xsl:variable name="loc" select="."/>
1010     <a href="{$loc}"><xsl:apply-templates/></a>
1011     </xsl:otherwise>
1012     </xsl:choose>
1013     </xsl:template>
1014    
1015     <!-- Paragraph -->
1016     <xsl:template match="p">
1017     <xsl:param name="chid"/>
1018 neysx 1.166 <p>
1019     <!-- Keep this for old files with <p class="secthead"> -->
1020     <xsl:if test="@class">
1021     <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
1022     </xsl:if>
1023    
1024     <xsl:if test="@by">
1025     <xsl:attribute name="class">epigraph</xsl:attribute>
1026     </xsl:if>
1027    
1028     <xsl:apply-templates>
1029     <xsl:with-param name="chid" select="$chid"/>
1030     </xsl:apply-templates>
1031    
1032     <xsl:if test="@by">
1033     <br/><br/><span class="episig">—<xsl:value-of select="@by"/></span><br/><br/>
1034     </xsl:if>
1035     </p>
1036 swift 1.73 </xsl:template>
1037    
1038     <!-- Emphasize -->
1039     <xsl:template match="e">
1040     <span class="emphasis"><xsl:apply-templates/></span>
1041     </xsl:template>
1042    
1043     <!-- Table -->
1044     <xsl:template match="table">
1045     <table class="ntable">
1046     <xsl:apply-templates/>
1047     </table>
1048     </xsl:template>
1049    
1050     <!-- Table Row -->
1051     <xsl:template match="tr">
1052     <tr>
1053 neysx 1.158 <xsl:if test="@id">
1054     <xsl:attribute name="id">
1055     <xsl:value-of select="@id"/>
1056     </xsl:attribute>
1057     </xsl:if>
1058 swift 1.73 <xsl:apply-templates/>
1059     </tr>
1060     </xsl:template>
1061    
1062 neysx 1.169 <xsl:template match="tcolumn">
1063     <col width="{@width}"/>
1064     </xsl:template>
1065    
1066 swift 1.73 <!-- Table Item -->
1067     <xsl:template match="ti">
1068 neysx 1.146 <td class="tableinfo">
1069 neysx 1.175 <xsl:if test="@align='center' or @align='right'">
1070     <xsl:attribute name="style"><xsl:value-of select="concat('text-align:',@align)"/></xsl:attribute>
1071     </xsl:if>
1072 neysx 1.169 <xsl:if test="@colspan">
1073     <xsl:attribute name="colspan"><xsl:value-of select="@colspan"/></xsl:attribute>
1074     </xsl:if>
1075     <xsl:if test="@rowspan">
1076     <xsl:attribute name="rowspan"><xsl:value-of select="@rowspan"/></xsl:attribute>
1077     </xsl:if>
1078 swift 1.73 <xsl:apply-templates/>
1079     </td>
1080     </xsl:template>
1081    
1082 neysx 1.166 <!-- Table Heading, no idea why <th> hasn't been used -->
1083 swift 1.73 <xsl:template match="th">
1084 neysx 1.146 <td class="infohead">
1085 neysx 1.166 <xsl:if test="@colspan">
1086     <xsl:attribute name="colspan"><xsl:value-of select="@colspan"/></xsl:attribute>
1087     <!-- Center only when item spans several columns as
1088     centering all <th> might disrupt some pages.
1089     We might want to use a plain html <th> tag later.
1090     Tip: to center a single-cell title, use <th colspan="1">
1091     -->
1092     <xsl:attribute name="style">text-align:center</xsl:attribute>
1093     </xsl:if>
1094     <xsl:if test="@rowspan">
1095     <xsl:attribute name="rowspan"><xsl:value-of select="@rowspan"/></xsl:attribute>
1096     </xsl:if>
1097 swift 1.73 <b>
1098     <xsl:apply-templates/>
1099     </b>
1100     </td>
1101     </xsl:template>
1102    
1103     <!-- Unnumbered List -->
1104     <xsl:template match="ul">
1105     <ul>
1106     <xsl:apply-templates/>
1107     </ul>
1108     </xsl:template>
1109    
1110     <!-- Ordered List -->
1111     <xsl:template match="ol">
1112     <ol>
1113     <xsl:apply-templates/>
1114     </ol>
1115     </xsl:template>
1116    
1117     <!-- List Item -->
1118     <xsl:template match="li">
1119     <li>
1120     <xsl:apply-templates/>
1121     </li>
1122     </xsl:template>
1123    
1124 neysx 1.166 <!-- Definition Lists -->
1125     <xsl:template match="dl">
1126     <dl><xsl:apply-templates/></dl>
1127     </xsl:template>
1128    
1129     <xsl:template match="dt">
1130     <dt><xsl:apply-templates/></dt>
1131     </xsl:template>
1132    
1133     <xsl:template match="dd">
1134     <dd><xsl:apply-templates/></dd>
1135     </xsl:template>
1136    
1137 swift 1.73 <!-- NOP -->
1138     <xsl:template match="ignoreinemail">
1139     <xsl:apply-templates/>
1140     </xsl:template>
1141    
1142     <!-- NOP -->
1143     <xsl:template match="ignoreinguide">
1144     </xsl:template>
1145    
1146     <!-- License Tag -->
1147 swift 1.61 <xsl:template match="license">
1148 neysx 1.146 <p class="copyright">
1149 neysx 1.130 <xsl:apply-templates select="func:gettext('License')"/>
1150 neysx 1.146 </p>
1151 neysx 1.151 <xsl:comment>
1152     &lt;rdf:RDF xmlns="http://web.resource.org/cc/"
1153     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
1154 neysx 1.152 &lt;License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"&gt;
1155 neysx 1.151 &lt;permits rdf:resource="http://web.resource.org/cc/Reproduction" /&gt;
1156     &lt;permits rdf:resource="http://web.resource.org/cc/Distribution" /&gt;
1157     &lt;requires rdf:resource="http://web.resource.org/cc/Notice" /&gt;
1158     &lt;requires rdf:resource="http://web.resource.org/cc/Attribution" /&gt;
1159     &lt;permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /&gt;
1160     &lt;requires rdf:resource="http://web.resource.org/cc/ShareAlike" /&gt;
1161     &lt;/License&gt;
1162     &lt;/rdf:RDF&gt;
1163     </xsl:comment>
1164 swift 1.61 </xsl:template>
1165 klieber 1.25
1166 blackace 1.98 <!-- GLSA Index -->
1167     <xsl:template match="glsaindex">
1168     <xsl:apply-templates select="document('/dyn/glsa-index.xml')/guide/chapter[1]/section[1]/body"/>
1169     </xsl:template>
1170    
1171 swift 1.119 <!-- GLSA Latest (max 10) -->
1172     <xsl:template match="glsa-latest">
1173     <xsl:variable name="src" select="'/dyn/glsa-index.xml'"/>
1174     <table>
1175     <xsl:for-each select="document($src)/guide/chapter[1]/section[1]/body/table[1]/tr[position()&lt;11]">
1176     <tr><xsl:apply-templates/></tr>
1177     </xsl:for-each>
1178     </table>
1179     </xsl:template>
1180    
1181 neysx 1.141
1182 neysx 1.165 <!-- Compare versions between two documents, scan handbooks if need be -->
1183     <xsl:template name="compare-versions">
1184     <xsl:param name="original"/>
1185     <xsl:param name="translation"/>
1186     <xsl:choose>
1187     <xsl:when test="$original/book and $translation/book">
1188     <!-- /book == /book -->
1189     <xsl:choose>
1190     <xsl:when test="$full != 0">
1191     <!-- if full != 0, then compare all files -->
1192     <!-- Compare versions in master files -->
1193     <xsl:if test="$original/book/version != $translation/book/version">X</xsl:if>
1194     <!-- Compare versions in original chapters vs. translated chapters that have the same position -->
1195     <xsl:for-each select="$original/book/part">
1196     <xsl:variable name="part" select="position()"/>
1197     <xsl:for-each select="chapter">
1198     <xsl:variable name="chap" select="position()"/>
1199     <xsl:variable name="ov" select="document($original/book/part[$part]/chapter[$chap]/include/@href)/sections/version"/>
1200     <xsl:variable name="tv" select="document($translation/book/part[$part]/chapter[$chap]/include/@href)/sections/version"/>
1201 neysx 1.168 <xsl:if test="$ov != $tv or not($tv)">X</xsl:if>
1202 neysx 1.165 </xsl:for-each>
1203     </xsl:for-each>
1204     </xsl:when>
1205     <xsl:when test="$part = '0' or $chap = '0'">
1206     <!-- Table of contents, check master file -->
1207     <xsl:if test="$original/book/version != $translation/book/version">X</xsl:if>
1208     </xsl:when>
1209     <xsl:otherwise>
1210     <!-- Compare chapters at same position (/$part/$chap/) in English handbook and in translated one -->
1211     <xsl:variable name="ov" select="document($original/book/part[position()=$part]/chapter[position()=$chap]/include/@href)/sections/version"/>
1212     <xsl:variable name="tv" select="document($translation/book/part[position()=$part]/chapter[position()=$chap]/include/@href)/sections/version"/>
1213 neysx 1.168 <xsl:if test="$ov != $tv or not($tv)">X</xsl:if>
1214 neysx 1.165 </xsl:otherwise>
1215     </xsl:choose>
1216     </xsl:when>
1217     <xsl:when test="$original/guide and $translation/guide">
1218     <!-- /guide == /guide -->
1219     <xsl:if test="$original/guide/version != $translation/guide/version">X</xsl:if>
1220     </xsl:when>
1221     <!-- If we did not compare book==book or guide==guide, then consider versions are different -->
1222     <xsl:otherwise>X</xsl:otherwise>
1223     </xsl:choose>
1224     </xsl:template>
1225    
1226     <!-- Return the date of a document, for handbooks, it is the max(main file date, all included parts dates) -->
1227     <xsl:template name="maxdate">
1228     <xsl:param name="thedoc"/>
1229 neysx 1.141 <xsl:choose>
1230 neysx 1.165 <xsl:when test="$thedoc/book">
1231 neysx 1.141 <!-- In a book: look for max(/date, include_files/sections/date) -->
1232 neysx 1.165 <xsl:for-each select="$thedoc/book/part/chapter/include">
1233 neysx 1.141 <xsl:sort select="document(@href)/sections/date" order="descending" />
1234     <xsl:if test="position() = 1">
1235     <!-- Compare the max(date) from included files with the date in the master file
1236     Of course, XSLT 1.0 knows no string comparison operator :-(
1237     So we build a node set with the two dates and we sort it.
1238     -->
1239     <xsl:variable name="theDates">
1240     <xsl:element name="bookDate">
1241 neysx 1.165 <xsl:value-of select="$thedoc/book/date"/>
1242 neysx 1.141 </xsl:element>
1243     <xsl:element name="maxChapterDate">
1244     <xsl:value-of select="document(@href)/sections/date"/>
1245     </xsl:element>
1246     </xsl:variable>
1247     <xsl:variable name="sortedDates">
1248     <xsl:for-each select="exslt:node-set($theDates)/*">
1249     <xsl:sort select="." order="descending" />
1250     <xsl:copy-of select="."/>
1251     </xsl:for-each>
1252     </xsl:variable>
1253     <!-- First date is the one we want -->
1254 neysx 1.165 <xsl:value-of select="exslt:node-set($sortedDates)/*[position()=1]"/>
1255 neysx 1.141 </xsl:if>
1256     </xsl:for-each>
1257     </xsl:when>
1258 neysx 1.165 <xsl:when test="$thedoc/guide or $thedoc/sections or $thedoc/mainpage">
1259     <xsl:value-of select="$thedoc/*[1]/date"/>
1260     </xsl:when>
1261     </xsl:choose>
1262     </xsl:template>
1263    
1264     <xsl:template name="contentdate">
1265     <xsl:variable name="docdate">
1266     <xsl:call-template name="maxdate">
1267     <xsl:with-param name="thedoc" select="/"/>
1268     </xsl:call-template>
1269     </xsl:variable>
1270    
1271     <xsl:choose>
1272     <xsl:when test="func:gettext('Updated')/docdate">
1273     <xsl:apply-templates select="func:gettext('Updated')">
1274     <xsl:with-param name="docdate" select="$docdate"/>
1275     </xsl:apply-templates>
1276 neysx 1.147 </xsl:when>
1277 neysx 1.165 <xsl:otherwise>
1278     <xsl:value-of select="concat(func:gettext('Updated'),' ')"/> <xsl:copy-of select="func:format-date($docdate)"/>
1279     </xsl:otherwise>
1280 neysx 1.141 </xsl:choose>
1281     </xsl:template>
1282    
1283 neysx 1.165 <xsl:template name="outdated-translation">
1284     <!-- Add mention that translation is outdated whenever possible -->
1285     <xsl:variable name="link">
1286     <xsl:value-of select="/*[1]/@link"/>
1287     </xsl:variable>
1288     <xsl:if test="starts-with($link, '/doc/') and not(starts-with($link, '/doc/en/')) and $glang != ''">
1289     <!-- We have a translation, is it up-to-date? -->
1290     <xsl:variable name="metadoc" select="document(concat('/doc/', $glang, '/metadoc.xml'))"/>
1291     <xsl:variable name="fileid" select="$metadoc/metadoc/files/file[text()=$link]/@id"/>
1292     <xsl:choose>
1293     <xsl:when test="not($fileid)">
1294     <!-- File is not even listed in local metadoc.xml -->
1295     <xsl:value-of select="func:gettext('NoIndex')"/>
1296     </xsl:when>
1297     <xsl:otherwise>
1298     <xsl:variable name="pmetadoc" select="document($metadoc/metadoc/@parent)"/>
1299     <xsl:choose>
1300     <xsl:when test="not($pmetadoc/metadoc/files/file[@id=$fileid])">
1301     <!-- File is not listed in original metadoc.xml -->
1302     <xsl:value-of select="func:gettext('NoOriginal')"/>
1303     </xsl:when>
1304     <xsl:otherwise>
1305     <!-- Document is listed in both local metadoc.xml and English one, compare version numbers -->
1306     <xsl:variable name="pfile" select="$pmetadoc/metadoc/files/file[@id=$fileid]"/>
1307     <xsl:variable name="versions">
1308     <xsl:call-template name="compare-versions">
1309     <xsl:with-param name="original" select ="document($pfile)"/>
1310     <xsl:with-param name="translation" select ="/"/>
1311     </xsl:call-template>
1312     </xsl:variable>
1313     <xsl:if test="string-length($versions) > 0">
1314     <xsl:variable name="pdocdate">
1315     <xsl:call-template name="maxdate">
1316     <xsl:with-param name="thedoc" select="document($pfile)"/>
1317     </xsl:call-template>
1318     </xsl:variable>
1319     <xsl:variable name="res">
1320     <xsl:apply-templates select="func:gettext('Outdated')">
1321     <xsl:with-param name="docdate" select="$pdocdate"/>
1322     <xsl:with-param name="paramlink" select="$pfile"/>
1323     </xsl:apply-templates>
1324     </xsl:variable>
1325     <xsl:copy-of select="$res"/>
1326     </xsl:if>
1327     </xsl:otherwise>
1328     </xsl:choose>
1329     </xsl:otherwise>
1330     </xsl:choose>
1331     </xsl:if>
1332     </xsl:template>
1333    
1334     <xsl:template match="docdate">
1335     <xsl:param name="docdate"/>
1336     <xsl:copy-of select="func:format-date($docdate)"/>
1337     </xsl:template>
1338    
1339    
1340 neysx 1.146 <xsl:template name="rhcol">
1341     <!-- Right-hand column with date/authors/ads -->
1342     <table border="0" cellspacing="4px" cellpadding="4px">
1343     <!-- Add a "printer-friendly" button when link attribute exists -->
1344     <xsl:if test="/book/@link or /guide/@link">
1345     <tr>
1346     <td class="topsep" align="center">
1347     <p class="altmenu">
1348 neysx 1.161 <xsl:variable name="PrintTip"><xsl:value-of select="func:gettext('PrintTip')"/></xsl:variable>
1349     <xsl:variable name="href">
1350     <xsl:choose>
1351     <xsl:when test="/book and $full != 0">
1352     <xsl:value-of select="concat(@link, '?full=1&amp;style=printable')"/>
1353     </xsl:when>
1354     <xsl:when test="/book">
1355     <xsl:value-of select="concat(@link, '?style=printable')"/>
1356     <xsl:if test="$part != '0'">&amp;part=<xsl:value-of select="$part"/></xsl:if>
1357     <xsl:if test="$chap != '0'">&amp;chap=<xsl:value-of select="$chap"/></xsl:if>
1358     </xsl:when>
1359     <xsl:when test="/guide">
1360     <xsl:value-of select="concat(@link, '?style=printable')"/>
1361     </xsl:when>
1362     </xsl:choose>
1363     </xsl:variable>
1364     <a title="{$PrintTip}" class="altlink" href="{$href}"><xsl:value-of select="func:gettext('Print')"/></a>
1365 neysx 1.146 </p>
1366     </td>
1367     </tr>
1368     </xsl:if>
1369     <xsl:choose>
1370 neysx 1.147 <xsl:when test="/book/date or /guide/date or /sections/date">
1371 neysx 1.146 <tr>
1372     <td align="center" class="topsep">
1373     <p class="alttext">
1374     <xsl:call-template name="contentdate"/>
1375     </p>
1376     </td>
1377     </tr>
1378 neysx 1.165 <xsl:variable name="outdated">
1379     <xsl:call-template name="outdated-translation"/>
1380     </xsl:variable>
1381     <xsl:if test="string-length($outdated) &gt; 1">
1382     <tr>
1383     <td align="left" class="topsep">
1384     <p class="alttext">
1385     <xsl:copy-of select="$outdated"/>
1386     </p>
1387     </td>
1388     </tr>
1389     </xsl:if>
1390 neysx 1.146 </xsl:when>
1391     <xsl:when test="/mainpage/date">
1392     <tr>
1393     <td align="center" class="topsep">
1394     <p class="alttext">
1395     <xsl:value-of select="concat(func:gettext('Updated'),' ')"/>
1396 neysx 1.164 <xsl:copy-of select="func:format-date(/mainpage/date)"/>
1397 neysx 1.146 </p>
1398     </td>
1399     </tr>
1400     </xsl:when>
1401     <xsl:when test="/news/date">
1402     <tr>
1403     <td align="center" class="topsep">
1404     <p class="alttext">
1405     <xsl:value-of select="concat(func:gettext('Updated'),' ')"/>
1406 neysx 1.164 <xsl:copy-of select="func:format-date(/news/date)"/>
1407 neysx 1.146 </p>
1408     </td>
1409     </tr>
1410     </xsl:when>
1411     </xsl:choose>
1412     <xsl:if test="/book/abstract[normalize-space(.)] or /guide/abstract[normalize-space(.)]">
1413     <tr>
1414 neysx 1.166 <td align="left" class="topsep">
1415 neysx 1.146 <p class="alttext">
1416     <!-- Abstract (summary) of the document -->
1417     <b><xsl:value-of select="func:gettext('Summary')"/>: </b>
1418     <xsl:apply-templates select="abstract"/>
1419     </p>
1420     </td>
1421     </tr>
1422     </xsl:if>
1423     <xsl:if test="/book/author or /guide/author">
1424     <tr>
1425 neysx 1.166 <td align="left" class="topsep">
1426 neysx 1.146 <p class="alttext">
1427     <!-- Authors -->
1428     <xsl:apply-templates select="/guide/author|/book/author"/>
1429     </p>
1430     </td>
1431     </tr>
1432     </xsl:if>
1433    
1434 neysx 1.149 <tr lang="en">
1435 neysx 1.146 <td align="center" class="topsep">
1436     <p class="alttext">
1437     <b>Donate</b> to support our development efforts.
1438     </p>
1439    
1440     <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
1441     <input type="hidden" name="cmd" value="_xclick"/>
1442     <input type="hidden" name="business" value="paypal@gentoo.org"/>
1443     <input type="hidden" name="item_name" value="Gentoo Linux Support"/>
1444     <input type="hidden" name="item_number" value="1000"/>
1445     <input type="hidden" name="image_url" value="/images/paypal.png"/>
1446     <input type="hidden" name="no_shipping" value="1"/>
1447     <input type="hidden" name="return" value="http://www.gentoo.org"/>
1448     <input type="hidden" name="cancel_return" value="http://www.gentoo.org"/>
1449    
1450 neysx 1.174 <input type="image" src="http://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo"/>
1451 neysx 1.146 </form>
1452     </td>
1453     </tr>
1454 neysx 1.149 <tr lang="en">
1455     <td align="center" class="topsep">
1456     <a href="http://www.vr.org">
1457 swift 1.148 <img src="/images/vr-ad.png" width="125" height="144" alt="Gentoo Centric Hosting: vr.org" border="0"/>
1458 neysx 1.146 </a>
1459 neysx 1.149 <p class="alttext">
1460     <a href="http://www.vr.org/">VR Hosted</a>
1461     </p>
1462     </td>
1463 neysx 1.146 </tr>
1464 neysx 1.149 <tr lang="en">
1465     <td align="center" class="topsep">
1466 swift 1.148 <a href="http://www.tek.net" target="_top">
1467     <img src="/images/tek-gentoo.gif" width="125" height="125" alt="Tek Alchemy" border="0"/>
1468 neysx 1.146 </a>
1469 swift 1.148 <p class="alttext">
1470     <a href="http://www.tek.net/">Tek Alchemy</a>
1471     </p>
1472 neysx 1.149 </td>
1473 neysx 1.146 </tr>
1474 neysx 1.149 <tr lang="en">
1475 neysx 1.146 <td align="center" class="topsep">
1476     <a href="http://www.sevenl.net" target="_top">
1477     <img src="/images/sponsors/sevenl.gif" width="125" height="144" alt="SevenL.net" border="0"/>
1478     </a>
1479     <p class="alttext">
1480 swift 1.148 <a href="http://www.sevenl.net/">SevenL.net</a>
1481 neysx 1.146 </p>
1482     </td>
1483     </tr>
1484 neysx 1.149 <tr lang="en">
1485     <td align="center" class="topsep">
1486 swift 1.148 <a href="http://www.phparch.com/bannerclick.php?AID=68&amp;BID=1&amp;BT=127929" target="_top">
1487     <img src="/images/phpa-gentoo.gif" width="125" height="144" alt="php|architect" border="0"/>
1488     </a>
1489     <p class="alttext">
1490     <a href="http://www.phparch.com/bannerclick.php?AID=68&amp;BID=1&amp;BT=127929">php|architect</a>
1491     </p>
1492 neysx 1.149 </td>
1493     </tr>
1494 neysx 1.146 <tr>
1495     <td align="center" class="topsep"/>
1496     </tr>
1497     </table>
1498     </xsl:template>
1499    
1500 neysx 1.154 <xsl:template name="newscontent">
1501     <xsl:param name="thenews"/>
1502     <xsl:param name="summary"/>
1503     <xsl:param name="link"/>
1504    
1505     <div class="news">
1506     <p class="newshead" lang="en">
1507     <b><xsl:value-of select="$thenews/title"/></b>
1508     <br/>
1509     <font size="0.90em">
1510 neysx 1.164 Posted on <xsl:copy-of select="func:format-date($thenews/date)"/>
1511 neysx 1.154 by <xsl:value-of select="$thenews/poster"/>
1512     </font>
1513     </p>
1514    
1515     <xsl:choose>
1516     <xsl:when test="$thenews/@category='alpha'">
1517     <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/>
1518     </xsl:when>
1519     <xsl:when test="$thenews/@category='kde'">
1520     <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/>
1521     </xsl:when>
1522     <xsl:when test="$thenews/@category='gentoo'">
1523     <img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/>
1524     </xsl:when>
1525     <xsl:when test="$thenews/@category='main'">
1526     <img class="newsicon" src="/images/icon-stick.png" alt="stick man"/>
1527     </xsl:when>
1528     <xsl:when test="$thenews/@category='ibm'">
1529     <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/>
1530     </xsl:when>
1531     <xsl:when test="$thenews/@category='linux'">
1532     <img class="newsicon" src="/images/icon-penguin.png" alt="tux"/>
1533     </xsl:when>
1534     <xsl:when test="$thenews/@category='moo'">
1535     <img class="newsicon" src="/images/icon-cow.png" alt="Larry the Cow"/>
1536     </xsl:when>
1537     <xsl:when test="$thenews/@category='plans'">
1538     <img class="newsicon" src="/images/icon-clock.png" alt="Clock"/>
1539     </xsl:when>
1540     <xsl:when test="$thenews/@category='nvidia'">
1541     <img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/>
1542     </xsl:when>
1543     <xsl:when test="$thenews/@category='freescale'">
1544     <img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/>
1545     </xsl:when>
1546     </xsl:choose>
1547    
1548     <div class="newsitem">
1549     <xsl:choose>
1550     <xsl:when test="$thenews/summary and $summary='yes'">
1551     <xsl:apply-templates select="$thenews/summary"/>
1552     <br/>
1553     <a href="{$link}"><b>(full story)</b></a>
1554     </xsl:when>
1555     <xsl:when test="$thenews/body">
1556     <xsl:apply-templates select="$thenews/body"/>
1557     </xsl:when>
1558     </xsl:choose>
1559     </div>
1560     </div>
1561     </xsl:template>
1562    
1563    
1564 drobbins 1.1 </xsl:stylesheet>

  ViewVC Help
Powered by ViewVC 1.1.13