* publish internal tools for svn/trac
[lab.git] / TipAndDoc / tools / www / svn / svnindex.xsl
1 <?xml version="1.0"?>
2
3 <!-- A sample XML transformation style sheet for displaying the Subversion
4   directory listing that is generated by mod_dav_svn when the "SVNIndexXSLT"
5   directive is used. -->
6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
7
8   <xsl:output method="html"/>
9
10   <xsl:template match="*"/>
11
12   <xsl:template match="svn">
13     <html>
14       <head>
15         <title>
16           <xsl:if test="string-length(index/@name) != 0">
17             <xsl:value-of select="index/@name"/>
18             <xsl:text>: </xsl:text>
19           </xsl:if>
20           <xsl:value-of select="index/@path"/>
21         </title>
22         <link rel="stylesheet" type="text/css" href="/static/svn/svnindex.css"/>
23       </head>
24       <body>
25         <div class="svn">
26           <xsl:apply-templates/>
27         </div>
28         <div class="footer">
29           <xsl:text>Powered by </xsl:text>
30           <xsl:element name="a">
31             <xsl:attribute name="href">
32               <xsl:value-of select="@href"/>
33             </xsl:attribute>
34             <xsl:text>Subversion</xsl:text>
35           </xsl:element>
36           <xsl:text> </xsl:text>
37           <xsl:value-of select="@version"/>
38         </div>
39       </body>
40     </html>
41   </xsl:template>
42
43   <xsl:template match="index">
44     <div class="rev">
45       <xsl:value-of select="@name"/>
46       <xsl:if test="@base">
47         <xsl:if test="@name">
48           <xsl:text>:&#xA0; </xsl:text>
49         </xsl:if>
50         <xsl:value-of select="@base" />
51       </xsl:if>
52       <xsl:if test="@rev">
53         <xsl:if test="@base | @name">
54           <xsl:text> &#x2014; </xsl:text>
55         </xsl:if>
56         <xsl:text>Revision </xsl:text>
57         <xsl:value-of select="@rev"/>
58       </xsl:if>
59     </div>
60     <div class="path">
61       <xsl:value-of select="@path"/>
62     </div>
63     <xsl:apply-templates select="updir"/>
64     <xsl:apply-templates select="dir"/>
65     <xsl:apply-templates select="file"/>
66   </xsl:template>
67
68   <xsl:template match="updir">
69     <div class="updir">
70       <xsl:text>[</xsl:text>
71       <xsl:element name="a">
72         <xsl:attribute name="href">..</xsl:attribute>
73         <xsl:text>Parent Directory</xsl:text>
74       </xsl:element>
75       <xsl:text>]</xsl:text>
76     </div>
77   </xsl:template>
78
79   <xsl:template match="dir">
80     <div class="dir">
81       <xsl:element name="a">
82         <xsl:attribute name="href">
83           <xsl:value-of select="@href"/>
84         </xsl:attribute>
85         <xsl:value-of select="@name"/>
86         <xsl:text>/</xsl:text>
87       </xsl:element>
88     </div>
89   </xsl:template>
90
91   <xsl:template match="file">
92     <div class="file">
93       <xsl:element name="a">
94         <xsl:attribute name="href">
95           <xsl:value-of select="@href"/>
96         </xsl:attribute>
97         <xsl:value-of select="@name"/>
98       </xsl:element>
99     </div>
100   </xsl:template>
101
102 </xsl:stylesheet>