<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:date="http://exslt.org/dates-and-times"
  xmlns:d="http://mickn.p.utmc.or.jp/diary"
  extension-element-prefixes="date">
  <xsl:template match="d:day" name="d:day">
    <xsl:variable name="diw" select="date:day-in-week(concat(format-number(../@year,'0000'),'-',format-number(../@month,'00'),'-',format-number(@mday,'00')))" />
    <div class="day">
      <h2><span class="date"><a name="{format-number(@mday,'00')}"><xsl:value-of select="../@month" />/<xsl:value-of select="@mday" /></a></span></h2>
      <div class="body">
	<xsl:for-each select="li">
	  <xsl:variable name="tag" select="concat(format-number(../@mday,'00'),'-',format-number(position(),'00'))" />
	  <xsl:variable name="base" select="concat(format-number(../../@year,'0000'),format-number(../../@month,'00'),'.html')" />
	  <div class="section">
	    <h3><a name="{$tag}" href="/~AE5T-KSN/d/{$base}#{$tag}"><span class="sanchor">◆</span></a> <xsl:choose><xsl:when test="@title"><xsl:value-of select="@title" /></xsl:when><xsl:otherwise>#<xsl:value-of select="$tag" /></xsl:otherwise></xsl:choose></h3>
	    <p><xsl:apply-templates /></p>
	  </div>
	</xsl:for-each>
      </div>
    </div>
  </xsl:template>
  <xsl:template match="d:filename">
    <span class="filename"><xsl:value-of select="." /></span>
  </xsl:template>
  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="./@*" />
      <xsl:apply-templates />
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>
<!--
 Local Variables:
 mode:xml
 coding:utf-8
 End:
-->
