root / xslt / svnindex.xsl

Revision 163, 2.8 kB (checked in by chris, 14 months ago)

Moved svn browse css out of repository

  • Property svn:mime-type set to text/xml
Line 
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="http://cheezyblog.net/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:if test="string-length(@name) != 0">
46        <xsl:value-of select="@name"/>
47        <xsl:if test="string-length(@rev) != 0">
48          <xsl:text> &#8212; </xsl:text>
49        </xsl:if>
50      </xsl:if>
51      <xsl:if test="string-length(@rev) != 0">
52        <xsl:text>Revision </xsl:text>
53        <xsl:value-of select="@rev"/>
54      </xsl:if>
55    </div>
56    <div class="path">
57      <xsl:value-of select="@path"/>
58    </div>
59    <xsl:apply-templates select="updir"/>
60    <xsl:apply-templates select="dir"/>
61    <xsl:apply-templates select="file"/>
62  </xsl:template>
63
64  <xsl:template match="updir">
65    <div class="updir">
66      <xsl:text>[</xsl:text>
67      <xsl:element name="a">
68        <xsl:attribute name="href">..</xsl:attribute>
69        <xsl:text>Parent Directory</xsl:text>
70      </xsl:element>
71      <xsl:text>]</xsl:text>
72    </div>
73    <!-- xsl:apply-templates/ -->
74  </xsl:template>
75
76  <xsl:template match="dir">
77    <div class="dir">
78      <xsl:element name="a">
79        <xsl:attribute name="href">
80          <xsl:value-of select="@href"/>
81        </xsl:attribute>
82        <xsl:value-of select="@name"/>
83        <xsl:text>/</xsl:text>
84      </xsl:element>
85    </div>
86    <!-- <xsl:apply-templates/ -->
87  </xsl:template>
88
89  <xsl:template match="file">
90    <div class="file">
91      <xsl:element name="a">
92        <xsl:attribute name="href">
93          <xsl:value-of select="@href"/>
94        </xsl:attribute>
95        <xsl:value-of select="@name"/>
96      </xsl:element>
97    </div>
98    <!-- xsl:apply-templates/ -->
99  </xsl:template>
100
101</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.