<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
 <xsl:output
  method="xml"
  encoding="utf-8"
  indent="yes"
  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
 />
 <xsl:template match="/">
  <xsl:apply-templates/>
 </xsl:template>
 <xsl:template match="svn">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
   <head>
    <!-- <base href="http://smdn.jp/" /> -->
    <title>
     <xsl:call-template name="header-title"/>
     <xsl:text> - 総武ソフトウェア推進所</xsl:text>
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <meta name="copyright" content="Copyright 2005-2010 smdn." />
    <meta name="reply-to" content="info@smdn.jp" />
    <meta name="robots" content="INDEX,FOLLOW" />
    <link rev="made" href="mailto:info@smdn.jp" />
    <!-- style sheets -->
    <link rel="stylesheet" href="http://smdn.jp/resources/stylesheets/screen.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="http://smdn.jp/resources/stylesheets/print.css" type="text/css" media="print" />
    <!-- misc -->
    <link rel="shortcut icon" href="http://smdn.jp/resources/favicon.ico" type="image/vnd.microsoft.icon" />
    <link rel="icon" href="http://smdn.jp/resources/favicon.png" type="image/png" />
   </head>
   <body>
    <div id="header">
     <div id="header-site" class="header-row">
      <a href="http://smdn.jp/">
       <img class="sitelogo" src="http://smdn.jp/resources/logo.png" width="128" height="36" alt="総武ソフトウェア推進所" title="総武ソフトウェア推進所" />
      </a>
     </div>
     <div id="header-nav" class="header-row">
      <ul id="header-site-menu">​
       <li><a href="http://smdn.jp/">Home</a></li>
       <li><a href="/anonsvn/" title="anonsvn">anonsvn</a></li>
       <li><a href="http://smdn.jp/stats/sitemap/" title="サイトマップ">サイトマップ</a></li>
      </ul>
     </div>
    </div>
    <div id="contents">
     <h1 id="content-title">
      <xsl:call-template name="header-title"/>
     </h1>
     <div id="body">
      <div class="section">
       <p><a href="../">Parent Directory</a></p>
       <xsl:apply-templates select="index"/>
       <p><xsl:call-template name="version-info"/></p>
      </div>
      <!--
      <div class="ads-footer">
       <object data="/ads/googleads-footer.html" type="text/html" width="354" height="298">
        <p>Sponsored Link</p>
       </object>
      </div>
      -->
     </div>
    </div>
   </body>
  </html>
 </xsl:template>
 <xsl:template match="index">
  <ul>
   <xsl:for-each select="dir">
    <xsl:sort select="@name" case-order="upper-first" order="ascending"/>
    <xsl:call-template name="direntlist"/>
   </xsl:for-each>
   <xsl:for-each select="file">
    <xsl:sort select="@name" case-order="upper-first" order="ascending"/>
    <xsl:call-template name="direntlist"/>
   </xsl:for-each>
  </ul>
 </xsl:template>
 <xsl:template name="direntlist">
  <li>
   <xsl:element name="a">
    <xsl:attribute name="href">
     <xsl:text>./</xsl:text>
     <xsl:value-of select="@href"/>
    </xsl:attribute>
    <xsl:attribute name="title">
     <xsl:value-of select="@name"/>
    </xsl:attribute>
    <xsl:value-of select="@name"/>
    <xsl:if test="local-name(.) = 'dir'">
     <xsl:text>/</xsl:text>
    </xsl:if>
   </xsl:element>
  </li>
 </xsl:template>
 <xsl:template name="header-title">
  <xsl:value-of select="index/@path"/>
  <xsl:if test="index/@base">
   <xsl:text> (</xsl:text>
   <xsl:value-of select="index/@base"/>
   <xsl:text> r</xsl:text>
   <xsl:value-of select="index/@rev"/>
   <xsl:text>)</xsl:text>
  </xsl:if>
 </xsl:template>
 <xsl:template name="version-info">
  <xsl:text>Powered by </xsl:text>
  <xsl:element name="a">
   <xsl:attribute name="href">
    <xsl:value-of select="@href"/>
   </xsl:attribute>
   <xsl:attribute name="title">
    <xsl:value-of select="@href"/>
   </xsl:attribute>
   <xsl:text>Subversion</xsl:text>
  </xsl:element>
  <xsl:text> version </xsl:text>
  <xsl:value-of select="@version"/>
 </xsl:template>
</xsl:stylesheet>


