1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <xsl:stylesheet xmlns=
"http://www.w3.org/1999/xhtml"
3 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
4 xmlns:
zi=
"http://zero-install.sourceforge.net/2004/injector/interface"
7 <xsl:output method=
"xml" encoding=
"utf-8"
8 doctype-system=
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
9 doctype-public=
"-//W3C//DTD XHTML 1.0 Strict//EN"/>
11 <xsl:template match=
"/zi:interface">
15 <xsl:value-of select=
"zi:name"/>
17 <style type='text/css'
>
18 html { background: #d0d0ff; }
19 body { background: #d0d0ff; margin:
0; padding:
0; color: black;}
20 h1 { text-align: center; border-bottom:
2px solid #d0d0ff; padding-bottom:
.5em; }
21 div.main { padding:
1em; background: white;
22 -moz-border-radius:
1em
1em
1em
1em; max-width:
60em;
23 margin-left: auto; margin-right: auto;
24 margin-top:
1em; margin-bottom:
1em;}
25 dt { font-weight: bold; text-transform:capitalize; }
26 dd { padding-bottom:
1em; }
27 dl.group { margin:
0.5em; padding:
0.5em; border:
1px dashed #
888;}
28 dl.impl { padding:
0.2em
1em
0.2em
1em; margin:
0.5em; border:
1px solid black; background: white;}
29 pre { background: #ddd; color: black; padding:
0.2cm; }
31 th { background: #d0d0ff; text-align: left; }
32 td { background: #e0e0ff; text-align: left; }
37 <h1><xsl:value-of select=
"zi:name"/> -
<xsl:value-of select='zi:summary'
/></h1>
43 <xsl:when test='//zi:implementation[@main] | //zi:group[@main]'
>
44 <p>This is a Zero Install feed. To run this program from the command-line, use this
46 <pre>$
0launch
<xsl:value-of select='/zi:interface/@uri'
/></pre>
48 The
<b>0alias
</b> command can be used to create a short-cut to run it again later.
51 If you use a graphical desktop, you can drag
<a href='{/zi:interface/@uri}'
>the feed's URL
</a> to
52 an installer such as
<a href='http://rox.sourceforge.net/desktop/AddApp'
>AddApp
</a> (ROX),
53 <a href='http://rox.sourceforge.net/desktop/node/
269'
>the Xfce
4.4 panel
</a>, or
54 <a href='http://rox.sourceforge.net/desktop/node/
402'
>Zero2Desktop
</a> (GNOME and KDE).
57 If you don't have the
<b>0launch
</b> command, download it from
58 <a href='http://
0install.net/injector.html'
>the
0install.net web-site
</a>, which also contains
59 documentation about how the Zero Install system works.
</p>
62 <p>This is a Zero Install feed.
63 This software cannot be run as an application directly. It is a library for other programs to use.
</p>
64 <p>For more information about Zero Install, see
<a href='http://
0install.net'
>0install.net
</a>.
</p>
69 <xsl:apply-templates mode='dl' select='*|@*'
/>
71 <dt>Available versions
</dt>
74 <xsl:when test='//zi:implementation'
>
75 <p>The list below is just for information; Zero Install will automatically download one of
76 these versions for you.
79 <tr><th>Version
</th><th>Released
</th><th>Stability
</th><th>Platform
</th><th>Download
</th></tr>
80 <xsl:for-each select='//zi:implementation'
>
82 <td><xsl:value-of select='(ancestor-or-self::*[@version])[last()]/@version'
/></td>
83 <td><xsl:value-of select='(ancestor-or-self::*[@released])[last()]/@released'
/></td>
84 <td><xsl:value-of select='(ancestor-or-self::*[@stability])[last()]/@stability'
/></td>
86 <xsl:variable name='arch' select='(ancestor-or-self::*[@arch])[last()]/@arch'
/>
88 <xsl:when test='$arch =
"*-src"'
>Source code
</xsl:when>
89 <xsl:when test='not($arch)'
>Any
</xsl:when>
90 <xsl:otherwise><xsl:value-of select='$arch'
/></xsl:otherwise>
94 <xsl:for-each select='.//zi:archive'
>
95 <a href='{@href}'
>Download
</a> (
<xsl:value-of select='@size'
/> bytes)
103 <p>No versions are available for downlad.
</p>
108 <dt>Required libraries
</dt>
111 <xsl:when test='//zi:requires'
>
112 <p>The list below is just for information; Zero Install will automatically download any required
116 <xsl:for-each select='//zi:requires'
>
117 <xsl:variable name='interface' select='@interface'
/>
118 <xsl:if test='not(preceding::zi:requires[@interface = $interface])'
>
119 <li><a><xsl:attribute name='href'
><xsl:value-of select='$interface'
/></xsl:attribute><xsl:value-of select='$interface'
/></a></li>
125 <p>This feed does not list any additional requirements.
</p>
135 <xsl:template mode='dl' match='/zi:interface/@uri'
>
136 <dt>Full name
</dt><dd><p><a href='{.}'
><xsl:value-of select=
"."/></a></p></dd>
139 <xsl:template mode='dl' match='zi:homepage'
>
140 <dt>Homepage
</dt><dd><p><a href='{.}'
><xsl:value-of select=
"."/></a></p></dd>
143 <xsl:template mode='dl' match='zi:description'
>
144 <dt>Description
</dt><dd><p><xsl:value-of select=
"."/></p></dd>
147 <xsl:template mode='dl' match='zi:icon'
>
148 <dt>Icon
</dt><dd><p><img src='{@href}'
/></p></dd>
151 <xsl:template mode='dl' match='*|@*'
/>
153 <xsl:template match='zi:group'
>
155 <xsl:apply-templates mode='attribs' select='@stability|@version|@id|@arch|@released'
/>
156 <xsl:apply-templates select='zi:group|zi:requires|zi:implementation'
/>
160 <xsl:template match='zi:requires'
>
162 <dd><a href='{@interface}'
><xsl:value-of select='@interface'
/></a></dd>
165 <xsl:template match='zi:implementation'
>
167 <xsl:apply-templates mode='attribs' select='@stability|@version|@id|@arch|@released'
/>
168 <xsl:apply-templates/>
172 <xsl:template mode='attribs' match='@*'
>
173 <dt><xsl:value-of select='name(.)'
/></dt>
174 <dd><xsl:value-of select='.'
/></dd>
177 <xsl:template match='zi:archive'
>
179 <dd><a href='{@href}'
><xsl:value-of select='@href'
/></a>
180 (
<xsl:value-of select='@size'
/> bytes)
</dd>