Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / tools / cgi / xslt / repos.xslt
blob521f1aeb071d08b89bb2de37e20009d14df8c591
1 <?xml version="1.0" encoding="utf-8"?>
3 <!--
4 template for displaying a list of available repositories, used when a
5 CGI request has no repository path information. This template expects
6 the following external variables:
8 cgi-program - path to the CGI executable, to place in links
9 stylesheet - path to the CSS stylesheet
11 the input XML must have the following structure:
13 <darcs repository="">
14 <repositories>
15 <repository name=""/>
16 </repositories>
17 </darcs>
18 -->
19 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
20 <xsl:variable name="command">
21 <xsl:value-of select="$cgi-program"/>/<xsl:value-of select="/darcs/@target"/>
22 </xsl:variable>
24 <xsl:template match="/darcs">
25 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
26 <head>
27 <title>darcs repository viewer</title>
28 <link rel="stylesheet" href="{$stylesheet}"/>
29 </head>
31 <body>
32 <h1 class="target">Available Repositories</h1>
34 <table>
35 <xsl:apply-templates/>
36 </table>
37 </body>
38 </html>
39 </xsl:template>
41 <xsl:template match="repositories">
42 <xsl:apply-templates>
43 <xsl:sort select="name(self::node())"/>
44 <xsl:sort select="@name"/>
45 </xsl:apply-templates>
46 </xsl:template>
48 <xsl:template match="repositories/repository">
49 <xsl:variable name="repository" select="@name"/>
51 <tr>
52 <td>
53 <a href="{$cgi-program}/{$repository}/?c=browse">
54 <xsl:value-of select="$repository"/>
55 </a>
56 </td>
57 </tr>
58 </xsl:template>
59 </xsl:stylesheet>