<?xml version="1.0" encoding="Shift_JIS" ?>
<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"
	indent="yes"
	doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
	doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
/>

<xsl:include href="sections.xsl" />


<xsl:variable name="preserveVer">d<xsl:value-of select="/child::*[1]/@y" /><xsl:value-of select="/child::*[1]/@m" /><xsl:value-of select="/child::*[1]/@division" />.html</xsl:variable>

<xsl:template name="documentHeader">
<xsl:text disable-output-escaping="yes"><![CDATA[
	<head>
		<meta http-equiv="content-type" content="text/html; charset=Shift_JIS" />
		<meta http-equiv="content-style-type" content="text/css" />
		<meta http-equiv="content-script-type" content="text/JavaScript" />
		<link rev="made" href="mailto:w650s@mcn.ne.jp" />
		<link rel="parent home contents" href="./" title="Personnel" />
		<link rel="help" href="about.html" title="当サイト（Personnel）について" />
		]]></xsl:text>
		<link rel="alternate" href="{$preserveVer}" title="保存版" />
<xsl:text disable-output-escaping="yes"><![CDATA[
		<link rel="stylesheet" type="text/css" href="../style/croix.css" media="screen,print" title="croix" />
		<link rel="alternate stylesheet" type="text/css" href="../style/lune.css" media="screen,print" title="lune" />
		<script type="text/javascript" src="../js/Jintrick.js" charset="Shift_JIS"></script>
		<script type="text/javascript" src="../js/Personnel.js" charset="Shift_JIS"></script>
		<title>agenda</title>
	</head>
]]>	</xsl:text>
</xsl:template>


<xsl:template name="navigation">
	<div class="navigation">
		<ul class="porte">
			<li><a href="./">Personnel</a></li>
		</ul>
	</div>
</xsl:template>


<xsl:template name="attributesOfBody">
	<xsl:attribute name="class">Agenda</xsl:attribute>
</xsl:template>


<xsl:template name="sectionHeader">
	<xsl:param name="level">0</xsl:param>
	<xsl:if test="$level = '2'">
		<address>公開： 
			<xsl:choose>
				<xsl:when test="@d">
					<xsl:value-of select="../@y" />年<xsl:value-of select="../@m" />月<xsl:value-of select="@d" />日
				</xsl:when>
				<xsl:otherwise>
					<xsl:message terminate="yes">

	d属性（日付）がありません。
	該当要素：<xsl:value-of select="position()" />番目のh2要素「<xsl:value-of select="." />」

					</xsl:message>
				</xsl:otherwise>
			</xsl:choose>
			<br />
			<xsl:choose>
				<xsl:when test="@up">
					最終更新：<xsl:value-of select="@up" />
				</xsl:when>
				<xsl:otherwise>
					最終更新：更新はありません
				</xsl:otherwise>
			</xsl:choose>
		</address>
	</xsl:if>
</xsl:template>


<xsl:template name="sectionFooter">
	<xsl:param name="level">0</xsl:param>
	<xsl:choose>

		<xsl:when test="$level = 1">
			<address>Sophisme <a href="mail.html">w650s<xsl:text disable-output-escaping="yes">&amp;#64;</xsl:text>mcn.ne.jp</a></address>
		</xsl:when>

		<xsl:when test="$level = 2">
			<xsl:variable name="section2Id">d<xsl:value-of select="@d" />_<xsl:value-of select="count(../h2) - position() + 1" /></xsl:variable>
			<address>記事の内容は半月毎に消去されます。保存版：
			<a href="{$preserveVer}#{$section2Id}" title="この記事の保存版"><xsl:value-of select="$preserveVer" />#<xsl:value-of select="$section2Id" /></a></address>
		</xsl:when>

		<xsl:otherwise>
			<address class="non-existent"></address>
		</xsl:otherwise>

	</xsl:choose>
</xsl:template>


<xsl:template name="sectionAttributes">
	<xsl:param name="level">0</xsl:param>
	<xsl:if test="$level = '2'">
		<xsl:variable name="sectionId">d<xsl:value-of select="@d" />_<xsl:value-of select="count(../h2) - position() + 1" /></xsl:variable>
		<xsl:choose>
			<xsl:when test="@id">
				<xsl:apply-templates select="@id" />
			</xsl:when>
			<xsl:otherwise>
				<xsl:if test="$sectionId != 'xslt_default_param'">
					<xsl:attribute name="id"><xsl:value-of select="$sectionId" /></xsl:attribute>
				</xsl:if>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:for-each select="@*">
			<xsl:if test="name() != 'd' and name() != 'up' and name() != 'id'">
		  	<!-- このxsl:ifのtest属性に、独自仕様属性を列挙する。 -->
				<xsl:apply-templates select="self::node()" />
			</xsl:if>
		</xsl:for-each>
	</xsl:if>
</xsl:template>


</xsl:stylesheet>

