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=
"utf8" />
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>
18 <script src=
"http://www.google-analytics.com/urchin.js"
19 type=
"text/javascript"></script>
20 <script type=
"text/javascript">
21 _uacct =
"UA-70960-1";urchinTracker();
25 <xsl:apply-templates select=
"*"/>
28 <xsl:value-of name="out" select="count(child::news)"/>
31 <xsl:if test=
"count(child::info)=1">
32 <xsl:for-each select=
"child::info">
33 <p id=
"Footer" class=
"footer">
35 <a href=
"http://freshmeat.net/projects/adesklets/">
36 <xsl:value-of select=
"@version" />
37 </a>, and there are
<a href=
"desklets.html">
39 select=
"count(document('../desklets.xml')/page/desklet)"/>
40 desklets
</a> listed online
42 select=
"@last_modified" />).
50 <!-- Page title in place !-->
51 <xsl:template match=
"title">
53 <h1><xsl:apply-templates /></h1>
62 <xsl:template match=
"menu">
64 <xsl:for-each select=
"a">
66 <xsl:element name=
"a">
67 <xsl:attribute name=
"href">
68 <xsl:value-of select=
"@href"/>
70 <xsl:apply-templates/>
77 <h1>Proudly hosted on:
</h1><p>
78 <a href=
"http://sourceforge.net/projects/adesklets/">
79 <img src=
"http://sourceforge.net/sflogo.php?group_id=126227&type=5"
80 width=
"210" height=
"62" border=
"0" alt=
"SourceForge.net Logo" />
87 <item title="Some title">Some content</item>
89 <xsl:template match=
"item">
91 <xsl:if test=
"@title">
93 <xsl:value-of select=
"@title"/>
96 <xsl:apply-templates/>
101 <news date="some date" title="some title">Some content</news>
103 <xsl:template match=
"news">
104 <div class=
"content">
106 <xsl:when test=
"@date">
107 <h3 class=
"minititle">
108 <xsl:value-of select=
"@date"/>
109 <xsl:if test=
"@title">
110 -
<xsl:value-of select=
"@title"/>
117 <xsl:if test=
"@title">
118 -
<xsl:value-of select=
"@title"/>
124 <xsl:apply-templates/>
128 <!-- Desklet description item
129 <desklets name="name" version="version" lang="language"
130 thumbnail="image_uri" screenshot="image_uri"
131 download="download_uri">
132 Description paragraph
135 If thumbnail is omitted, link to default values will be created
136 (possible screenshot will ignored). Same thing for download.
138 <xsl:template match=
"desklet">
139 <div class=
"content2">
140 <h3 class=
"minititle">
141 <xsl:value-of select=
"@name"/>
142 <xsl:text> </xsl:text>
143 <xsl:value-of select=
"@version"/>
147 <xsl:when test=
"@thumbnail">
148 <xsl:element name=
"a">
149 <xsl:attribute name=
"href">
150 <xsl:value-of select=
"@screenshot"/>
152 <xsl:element name=
"img">
153 <xsl:attribute name=
"class">thumbnail
</xsl:attribute>
154 <xsl:attribute name=
"src">
155 <xsl:value-of select=
"@thumbnail"/>
161 <xsl:element name=
"a">
162 <xsl:attribute name=
"href">
163 <xsl:text>images/
</xsl:text>
164 <xsl:value-of select=
"@name" />
165 <xsl:text>_screen.jpg
</xsl:text>
167 <xsl:element name=
"img">
168 <xsl:attribute name=
"class">thumbnail
</xsl:attribute>
169 <xsl:attribute name=
"src">
170 <xsl:text>images/
</xsl:text>
171 <xsl:value-of select=
"@name" />
172 <xsl:text>_thumb.jpg
</xsl:text>
179 <span><strong>Language:
</strong>
182 <xsl:when test=
"@lang">
183 <xsl:value-of select=
"@lang" />
191 <xsl:apply-templates/>
195 <xsl:when test=
"@download">
196 <xsl:element name=
"a">
197 <xsl:attribute name=
"href">
198 <xsl:value-of select=
"@download" />
200 Download
<xsl:value-of select=
"@name" />
201 <xsl:text> </xsl:text>
202 <xsl:value-of select=
"@version"/>
206 <xsl:element name=
"a">
207 <xsl:attribute name=
"href">
208 <xsl:text>http://prdownloads.sourceforge.net/adesklets/
</xsl:text>
209 <xsl:value-of select=
"@name" />
210 <xsl:text>-
</xsl:text>
211 <xsl:value-of select=
"@version" />
212 <xsl:text>.tar.bz2?download
</xsl:text>
214 Download
<xsl:value-of select=
"@name" />
215 <xsl:text> </xsl:text>
216 <xsl:value-of select=
"@version"/>
225 <xsl:template match=
"author">
227 <strong>Author:
</strong>
230 <xsl:when test=
"@email">
231 <xsl:element name=
"a">
232 <xsl:attribute name=
"href">
233 mailto:
<xsl:value-of select=
"@email" />
235 <xsl:value-of select=
"@name" />
239 <xsl:value-of select=
"@name" />
245 <!-- Forward port of the HTML equivalent !-->
246 <xsl:template match=
"a">
247 <xsl:if test=
"@href">
250 <xsl:attribute name=
"href">
251 <xsl:value-of select=
"@href"/>
253 <xsl:apply-templates/>
258 <!-- Forward port of the HTML equivalent
259 <img src="some_uri" nocolor="">
261 <xsl:template match=
"img">
262 <xsl:element name=
"img">
263 <xsl:attribute name=
"src">
264 <xsl:value-of select=
"@src"/>
266 <xsl:if test=
"@nocolor">
267 <xsl:attribute name=
"class">nocolor
</xsl:attribute>
272 <!-- Forward port of the HTML equivalent !-->
273 <xsl:template match=
"p">
274 <p><xsl:apply-templates/></p>
277 <xsl:template match=
"br">
281 <xsl:template match=
"h2">
282 <h2><xsl:apply-templates/></h2>
285 <xsl:template match=
"strong">
286 <strong><xsl:apply-templates/></strong>
289 <xsl:template match=
"em">
290 <em><xsl:apply-templates/></em>