2 <xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
4 <!-- XSL stylesheet to convert adesklets xml source website to xhtml
5 ! Written by S.Fourmanoit
8 <xsl:output method=
"html" encoding=
"latin1" />
10 <!-- Root element !-->
11 <xsl:template match=
"page">
15 <xsl:value-of select=
"title/text()"/>
17 <style type=
"text/css" media=
"all">@import
"reservoir.css";
</style>
20 <xsl:apply-templates select=
"*"/>
23 <xsl:value-of name="out" select="count(child::news)"/>
26 <xsl:if test=
"count(child::info)=1">
27 <xsl:for-each select=
"child::info">
28 <p id=
"Footer" class=
"footer">
30 <a href=
"http://freshmeat.net/projects/adesklets/">
31 <xsl:value-of select=
"@version" />
32 </a>, and there are
<a href=
"desklets.html">
34 select=
"count(document('../desklets.xml')/page/desklet)"/>
35 desklets
</a> listed online
37 select=
"@last_modified" />).
41 <xsl:text disable-output-escaping=
"yes">
42 <!--#include
virtual=
"/cgi-bin/counter.sh" --
>
49 <!-- Page title in place !-->
50 <xsl:template match=
"title">
52 <h1><xsl:apply-templates /></h1>
61 <xsl:template match=
"menu">
63 <xsl:for-each select=
"a">
65 <xsl:element name=
"a">
66 <xsl:attribute name=
"href">
67 <xsl:value-of select=
"@href"/>
69 <xsl:apply-templates/>
76 <h1>Proudly hosted on:
</h1><p>
77 <a href=
"http://sourceforge.net/projects/adesklets/">
78 <img src=
"http://sourceforge.net/sflogo.php?group_id=126227&type=5"
79 width=
"210" height=
"62" border=
"0" alt=
"SourceForge.net Logo" />
86 <item title="Some title">Some content</item>
88 <xsl:template match=
"item">
90 <xsl:if test=
"@title">
92 <xsl:value-of select=
"@title"/>
95 <xsl:apply-templates/>
100 <news date="some date" title="some title">Some content</news>
102 <xsl:template match=
"news">
103 <div class=
"content">
105 <xsl:when test=
"@date">
106 <h3 class=
"minititle">
107 <xsl:value-of select=
"@date"/>
108 <xsl:if test=
"@title">
109 -
<xsl:value-of select=
"@title"/>
116 <xsl:if test=
"@title">
117 -
<xsl:value-of select=
"@title"/>
123 <xsl:apply-templates/>
127 <!-- Desklet description item
128 <desklets name="name" version="version"
129 thumbnail="image_uri" screenshot="image_uri"
130 download="download_uri">
131 Description paragraph
134 If thumbnail is omitted, link to default values will be created
135 (possible screenshot will ignored). Same thing for download.
137 <xsl:template match=
"desklet">
138 <div class=
"content2">
139 <h3 class=
"minititle">
140 <xsl:value-of select=
"@name"/>
141 <xsl:text> </xsl:text>
142 <xsl:value-of select=
"@version"/>
146 <xsl:when test=
"@thumbnail">
147 <xsl:element name=
"a">
148 <xsl:attribute name=
"href">
149 <xsl:value-of select=
"@screenshot"/>
151 <xsl:element name=
"img">
152 <xsl:attribute name=
"class">thumbnail
</xsl:attribute>
153 <xsl:attribute name=
"src">
154 <xsl:value-of select=
"@thumbnail"/>
160 <xsl:element name=
"a">
161 <xsl:attribute name=
"href">
162 <xsl:text>images/
</xsl:text>
163 <xsl:value-of select=
"@name" />
164 <xsl:text>_screen.jpg
</xsl:text>
166 <xsl:element name=
"img">
167 <xsl:attribute name=
"class">thumbnail
</xsl:attribute>
168 <xsl:attribute name=
"src">
169 <xsl:text>images/
</xsl:text>
170 <xsl:value-of select=
"@name" />
171 <xsl:text>_thumb.jpg
</xsl:text>
179 <xsl:apply-templates/>
184 <xsl:when test=
"@download">
185 <xsl:element name=
"a">
186 <xsl:attribute name=
"href">
187 <xsl:value-of select=
"@download" />
189 Download
<xsl:value-of select=
"@name" />
190 <xsl:text> </xsl:text>
191 <xsl:value-of select=
"@version"/>
195 <xsl:element name=
"a">
196 <xsl:attribute name=
"href">
197 <xsl:text>http://prdownloads.sourceforge.net/adesklets/
</xsl:text>
198 <xsl:value-of select=
"@name" />
199 <xsl:text>-
</xsl:text>
200 <xsl:value-of select=
"@version" />
201 <xsl:text>.tar.bz2?download
</xsl:text>
203 Download
<xsl:value-of select=
"@name" />
204 <xsl:text> </xsl:text>
205 <xsl:value-of select=
"@version"/>
213 <xsl:template match=
"author">
215 <strong>Author:
</strong>
218 <xsl:when test=
"@email">
219 <xsl:element name=
"a">
220 <xsl:attribute name=
"href">
221 mailto:
<xsl:value-of select=
"@email" />
223 <xsl:value-of select=
"@name" />
227 <xsl:value-of select=
"@name" />
233 <!-- Forward port of the HTML equivalent !-->
234 <xsl:template match=
"a">
235 <xsl:if test=
"@href">
238 <xsl:attribute name=
"href">
239 <xsl:value-of select=
"@href"/>
241 <xsl:apply-templates/>
246 <!-- Forward port of the HTML equivalent
247 <img src="some_uri" nocolor="">
249 <xsl:template match=
"img">
250 <xsl:element name=
"img">
251 <xsl:attribute name=
"src">
252 <xsl:value-of select=
"@src"/>
254 <xsl:if test=
"@nocolor">
255 <xsl:attribute name=
"class">nocolor
</xsl:attribute>
260 <!-- Forward port of the HTML equivalent !-->
261 <xsl:template match=
"p">
262 <p><xsl:apply-templates/></p>
265 <xsl:template match=
"h2">
266 <h2><xsl:apply-templates/></h2>