In a previous article on subversion I mentioned the use of the svnindex.xsl file to style the repository listing. This file was placed in the root of "yourdomain.com" which was a level above the svn repositories.
However there may arise a situation such as outlined in last weeks posting where you need to host the xslt files from within a repository. Or you may just decide you want to simply because. Not only is this really simple to do, it allows us to version control the svnindex file itself.
Lets create a dedicated repository for the svnindex.xml and svnindex.css files. I named my repo "svnstyling". Import the two files into the repo.
Next we set the svnindexxslt directive in the location section of our vhost and restart apache.
ServerName svn.yourdomain.com
DAV svn
SVNParentPath "C:/svn_repository/"
SVNListParentPath on
SVNIndexXSLT "/svnstyling/svnindex.xsl"
---snip---
Because we are serving the xsl and css files directly from a subversion repository we need to define the mime types for each file. For the xsl file set the mimetype to "test/xml" and for the css file set the mimetype to "text/css".
$ svn propset svn:mime-type text/xml svnindex.xml
$ svn propset svn:mime-type text/css svnindex.css
That's it. Now our repositories have their own dedicated vhost while keeping their nice xslt styling and as a bonus the xsl and associated files are now themselves version controlled.