<?xml version="1.0" encoding="Shift_JIS" ?>
<xsl:stylesheet
	version="1.0"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:bld="http://www.ylum.gr.jp/2001/bld"
>
<xsl:output
	method="xml"
	version="1.0"
	media-type="text/html"
	omit-xml-declaration="no"
	encoding="Shift_JIS"
	indent="yes"
	doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
	doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
/>
<!-- <xsl:namespace-alias stylesheet-prefix="bld" result-prefix="#default"/> --><!--(1)小技-->
<!-- リンクする外部ファイルの拡張子 -->
<xsl:param name="extension">.xml</xsl:param>
<!-- インデックスファイルを取り込む -->
<xsl:variable name="index" select="document('index.xml')"/>
<!-- URLs リストの XML ファイルを取り込む -->
<xsl:variable name="URLs" select="document('URLs.xml')"/>

<xsl:template match="/bld:BOOKS">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"/>
<title><xsl:value-of select="concat('イリューム伯爵城館 - プロフィール - 所有書籍 - ',@title)"/></title>
<meta http-equiv="Content-Script-Type" content="text/javascript"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
<!-- スタイルシートリンク開始 -->
<link rel="stylesheet" type="text/css" href="../../../base.css" title="Defalt" />
<link rel="stylesheet" type="text/css" href="../../ylum.css" title="Defalt" />
<xsl:for-each select="bld:DOC-INFO/bld:STYLESHEET">
	<link rel="stylesheet">
	<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
	<xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
	<xsl:if test="@title"><xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute></xsl:if>
	</link>
</xsl:for-each>
<link rel="stylesheet" type="text/css" href="../../../dumy.css" title="Default" /><xsl:comment>IE3用のダミー</xsl:comment>
<!-- スタイルシートリンク終了 -->

<!-- ナビゲーションリンク開始 -->
<link rel="Index" href="{concat('index',$extension)}"/>
<xsl:apply-templates select="$index/INDEX" mode="navi">
<xsl:with-param name="pageName" select="/bld:BOOKS/@name" />
</xsl:apply-templates>
<!-- ナビゲーションリンク終了 -->
<meta name="generator" content="XSLT Convert by Ant" />
</head>

<body>
<xsl:comment> START NAVI BLOCK </xsl:comment>
<div id="naviMenu">
<a href="../../profile/index.html">プロフィール</a>
<a href="../../renewal/index.html">管理記録</a>
<a href="../../diary/index.html">城館日記</a>
<a href="../../info/index.html">城館情報</a>
<a href="../../link/index.html">宇宙港</a>
<br />
<a href="http://park15.wakwak.com/%7Eyoshitomo/cgi-bin/ylumBbs/bbs.cgi">記憶巣</a>
<a href="../../cg/index.html">アトリエ</a>
<a href="../../java/index.html">思考結晶</a>
<a href="../../info/sitemap.html">サイトマップ</a>
<br />
<a href="../../top/top.html" target="_top">トップページ</a>
<a href="../../index.html" target="_top">ルートページ</a>
</div>
<xsl:comment> END NAVI BLOCK </xsl:comment>

<hr class="underNavi" />

<xsl:comment> START NAVI BLOCK </xsl:comment>
<div id="naviSubMenu">
<a href="{concat('index',$extension)}">所有書籍</a>
</div>
<xsl:comment> END NAVI BLOCK </xsl:comment>

<hr class="underNavi" />

<xsl:comment> START BODY BLOCK </xsl:comment>
<div id="body">
<script type="text/javascript" src="../../lastModified.js">
<xsl:comment>//  省略形にならないためのダミー// </xsl:comment>
</script>
<h1><a name="top" id="top"><xsl:value-of select="@title"/></a></h1>
<ul>
<xsl:for-each select="bld:GENRE|bld:POCKET-BOOK|bld:COMIC">
<li>
<a href="#{@id}"><xsl:value-of select="@title" /></a><xsl:text>　</xsl:text><xsl:value-of select="count(current()/bld:BOOK) + count(current()/bld:SERIES/bld:BOOK)"/><xsl:text>(</xsl:text><xsl:value-of select="count(current()/bld:BOOK[@readed='yes']) + count(current()/bld:SERIES/bld:BOOK[@readed='yes'])"/><xsl:text>)冊</xsl:text>
<xsl:if test="bld:SERIES">
<ul>
<xsl:for-each select="bld:SERIES">
<li><xsl:value-of select="@title"/><xsl:text>　</xsl:text><xsl:value-of select="count(bld:BOOK)"/><xsl:text>(</xsl:text><xsl:value-of select="count(bld:BOOK[@readed='yes'])"/><xsl:text>)冊</xsl:text></li>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:for-each>
</ul>
<p><xsl:text>　合計、</xsl:text><xsl:value-of select="count(//bld:BOOK)"/><xsl:text>(</xsl:text><xsl:value-of select="count(//bld:BOOK[@readed='yes'])"/><xsl:text>)冊</xsl:text></p>

<hr />

<xsl:apply-templates select="bld:GENRE|bld:POCKET-BOOK|bld:COMIC" />

<hr />

<!-- 通常ナビゲーションリンク挿入 -->
<xsl:apply-templates select="$index/INDEX" mode="normal">
<xsl:with-param name="pageName" select="/bld:BOOKS/@name" />
</xsl:apply-templates>
</div>
<xsl:comment> END BODY BLOCK </xsl:comment>

<hr />

<div id="about">
<p>
<xsl:text>　このページは、</xsl:text><abbr title="Extensible Markup Language">XML</abbr><xsl:text> 文書を </xsl:text><abbr title="XSL Transformations">XSLT</abbr><xsl:text> 変換することで生成した、XHTML 1.0 Transitional 形式の文書です。また、デザイン要素は極力 </xsl:text><abbr title="Cascading Style Sheets, level 2">CSS2</abbr><xsl:text> で行うようにしています。</xsl:text>
</p>
<p>
<a href="{concat(/bld:BOOKS/@name,'.xml')}" type="application/xml"><xsl:text>XML ファイル</xsl:text></a>
<a href="URLs.xml" type="application/xml"><xsl:text>参照 URL リスト</xsl:text></a>
<a href="books.dtd" type="application/xml-dtd" charset="Unicode"><xsl:text>DTD</xsl:text></a>
<a href="books.xsl" type="application/xml"><xsl:text>パソコン用 XSLT 定義ファイル</xsl:text></a>
<a href="m/mBooks.xsl" type="application/xml"><xsl:text>モバイル用 XSLT 定義ファイル</xsl:text></a>
</p>
<p>
<a href="http://www.w3.org/Style/CSS/Buttons"><img alt="Made with CSS" src="http://www.w3.org/Style/CSS/Buttons/mwcos" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img alt="Valid CSS!" src="http://jigsaw.w3.org/css-validator/images/vcss" height="31" width="88" /></a>
<a href="http://validator.w3.org/check/referer"><img alt="Valid XHTML 1.0!" src="http://www.w3.org/Icons/valid-xhtml10" height="31" width="88" /></a>
</p>
</div>

<hr />

<xsl:comment> START FOOTER BLOCK </xsl:comment>
<div id="footer">
<xsl:text>Copyright (c) 1997-2003　よしとも</xsl:text>
</div>
<xsl:comment> END FOOTER BLOCK </xsl:comment>
</body>

</html>
</xsl:template>
<!-- メイン終了 -->

<!-- ジャンルで別けられていた場合のテンプレート。 -->
<xsl:template match="bld:GENRE">
<h2><a name="{@id}" id="{@id}"><xsl:value-of select="@title"/></a>　<xsl:value-of select="count(current()/bld:BOOK) + count(current()/bld:SERIES/bld:BOOK)"/>(<xsl:value-of select="count(current()/bld:BOOK[@readed='yes']) + count(current()/bld:SERIES/bld:BOOK[@readed='yes'])"/>)冊</h2>
<xsl:apply-templates />
<p><a href="#top">ページトップへ</a></p>
</xsl:template>

<!-- 文庫本とコミックのテンプレート。 -->
<xsl:template match="bld:POCKET-BOOK|bld:COMIC">
<h2><a name="{@id}" id="{@id}"><xsl:if test="@urlId"><xsl:attribute name="href"><xsl:value-of select="$URLs/URLs/URL[@id=current()/@urlId]/@href"/></xsl:attribute><xsl:attribute name="charset"><xsl:value-of select="@charset"/></xsl:attribute></xsl:if><xsl:value-of select="@title"/></a>　<xsl:value-of select="count(current()/bld:BOOK) + count(current()/bld:SERIES/bld:BOOK)"/>(<xsl:value-of select="count(current()/bld:BOOK[@readed='yes']) + count(current()/bld:SERIES/bld:BOOK[@readed='yes'])"/>)冊</h2>
<xsl:apply-templates />
<p><a href="#top">ページトップへ</a></p>
</xsl:template>

<!-- 文庫本とコミックの、シリーズ別に別けられていた場合のテンプレート。 -->
<xsl:template match="bld:SERIES">
<h3><xsl:if test="@urlId"><a href="{$URLs/URLs/URL[@id=current()/@urlId]/@href}" charset="{$URLs/URLs/URL[@id=current()/@urlId]/@charset}" target="_top"><xsl:value-of select="@title"/></a></xsl:if><xsl:if test="not(@urlId)"><xsl:value-of select="@title"/></xsl:if> （<xsl:if test="@finish='yes'">完結</xsl:if><xsl:if test="@finish='no'">未完</xsl:if>）</h3>
<div class="series">
<xsl:if test="./bld:SERIES-COMMENT"><p>　<xsl:value-of select="./bld:SERIES-COMMENT"/></p></xsl:if>
<xsl:apply-templates select="bld:BOOK"/>
</div>
</xsl:template>

<xsl:template match="bld:BOOK">
<!-- 題名　セル2つ分の幅 -->
<table border="1" summary="{concat('書籍「',bld:MAIN-TITLE,'」に関するデータの表。')}">
	<xsl:if test="@class"><xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute></xsl:if>
	<colgroup>
		<col width="0*" class="th"/>
		<col width="*"/>
	</colgroup>
		<!--<xsl:if test="@stock='yes'"> --><!-- 在庫がある場合・・・ -->
			<!-- Amazon.co.jp の商品カタログの個別ページの URL -->
<!--
			<xsl:variable name="amazon" select="concat('http://www.amazon.co.jp/exec/obidos/ASIN/', translate(bld:ISBN, '-', ''), '/')"/>
			<div class="mainTitle"><a class="{$class}" href="{$amazon}"><xsl:value-of select="bld:MAIN-TITLE" /></a></div>
		</xsl:if>
-->
		<!-- <xsl:if test="@stock='no'"> --><!-- 在庫がない場合・・・ -->
<!--
			<div class="mainTitle"><xsl:value-of select="bld:MAIN-TITLE" /></div>
		</xsl:if>
-->
<!-- 題名 -->
	<xsl:apply-templates select="bld:MAIN-TITLE"/>
	<!-- 出版 -->
	<xsl:apply-templates select="bld:EDITION"/>
	<!-- 著者 -->
	<xsl:apply-templates select="bld:AUTHORS"/>
	<!-- 出版社 -->
	<xsl:apply-templates select="bld:PUBLISHER"/>
	<!-- 定価　taxの値は税率。0の場合は非課税か内税。 -->
	<xsl:apply-templates select="bld:PRICE"/>
	<!-- ISBNコード　頭にISBNをつける -->
	<xsl:apply-templates select="bld:ISBN"/>
	<!-- Cコード　頭にCをつける -->
	<xsl:apply-templates select="bld:C-CODE"/>
	<!-- 出版者側でつける整理記号 -->
	<xsl:apply-templates select="bld:REF-SYMBOL"/>
	<!-- 書籍に対するコメント -->
	<xsl:apply-templates select="bld:BOOK-COMMENT"/>
</table>
</xsl:template>

<xsl:template match="bld:MAIN-TITLE">
	<tr>
		<th>題名</th>
		<td>
			<xsl:value-of select="." />
			<xsl:if test="../bld:SUB-TITLE"><div class="subTitle"><xsl:value-of select="../bld:SUB-TITLE" /></div></xsl:if>
		</td>
	</tr>
</xsl:template>

<xsl:template match="bld:EDITION">
	<tr>
		<th>出版</th>
		<td>
			<xsl:value-of select="substring(@date, 0, 5)"/><xsl:text>年 </xsl:text>
			<xsl:value-of select="number(substring(@date, 6, 2))"/><xsl:text>月 </xsl:text>
			<xsl:value-of select="number(substring(@date, 9, 2))"/><xsl:text>日 </xsl:text>
			<xsl:choose>
				<xsl:when test="@num=1"><xsl:text>初版 </xsl:text></xsl:when>
				<xsl:when test="@num=2"><xsl:text>再販 </xsl:text></xsl:when>
				<xsl:when test="@num&gt;1"><xsl:value-of select="@num"/><xsl:text>版 </xsl:text></xsl:when>
			</xsl:choose>
			<xsl:if test="@print"><xsl:text>第</xsl:text><xsl:value-of select="@print"/><xsl:text>刷 </xsl:text></xsl:if>
			<xsl:text>発行</xsl:text>
		</td>
	</tr>
</xsl:template>

<xsl:template match="bld:AUTHORS">
	<xsl:variable name="class" select="../@class"/>
	<!-- 著者の数を変数で保持 -->
	<xsl:variable name="author" select="count(bld:AUTHOR)"/>
	<!-- 1人ずつ処理 -->
	<xsl:for-each select="bld:AUTHOR">
	<tr>
		<xsl:if test="position()=1"><!-- 1人目の著者の場合だけ表示 -->
			<th rowspan="{$author}">著者</th>
		</xsl:if>
		<td>
			<xsl:value-of select="@type" /><xsl:if test="@suport"><xsl:text>（</xsl:text><xsl:value-of select="@suport"/><xsl:text>）</xsl:text></xsl:if><xsl:text>：</xsl:text>
			<!-- 人 -->
			<xsl:for-each select="bld:PERSON">
				<xsl:if test="position()!=1"><xsl:text>　</xsl:text></xsl:if><!-- 直前の人との区切りを入れる -->
				<xsl:choose>
					<xsl:when test="@urlId"><!-- リンクIDがあった場合・・・ -->
						<a href="{$URLs/URLs/URL[@id=current()/@urlId]/@href}" charset="{$URLs/URLs/URL[@id=current()/@urlId]/@charset}" class="{$class}" target="_top"><xsl:value-of select="." /></a>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="." />
					</xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</td>
	</tr>
	</xsl:for-each>
</xsl:template>

<xsl:template match="bld:PUBLISHER">
	<tr>
		<th>出版社</th>
		<td>
			<xsl:choose>
				<xsl:when test="@urlId"><!-- リンクIDがあった場合・・・ -->
					<a href="{$URLs/URLs/URL[@id=current()/@urlId]/@href}" charset="{$URLs/URLs/URL[@id=current()/@urlId]/@charset}" class="{../@class}" target="_top"><xsl:value-of select="." /></a>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="." />
				</xsl:otherwise>
			</xsl:choose>
		</td>
	</tr>
</xsl:template>

<xsl:template match="bld:PRICE">
	<tr>
		<th>定価</th>
		<td><xsl:value-of select="format-number(.,'#,###円')" /><xsl:if test="@tax &gt; 0"><xsl:text> + 消費税</xsl:text><xsl:value-of select="@tax"/><xsl:text>%</xsl:text></xsl:if></td>
	</tr>
</xsl:template>

<xsl:template match="bld:ISBN">
	<tr>
		<th><abbr title="International Standard Book Number">ISBN</abbr>コード</th>
		<td>ISBN<xsl:value-of select="." /></td>
	</tr>
</xsl:template>

<xsl:template match="bld:C-CODE">
	<tr>
		<th>Cコード</th>
		<td>C<xsl:value-of select="." /></td>
	</tr>
</xsl:template>

<xsl:template match="bld:REF-SYMBOL">
	<tr>
		<th>整理記号</th>
		<td><xsl:value-of select="." /></td>
	</tr>
</xsl:template>

<xsl:template match="bld:BOOK-COMMENT">
	<tr>
		<td colspan="2">　<xsl:value-of select="."/><xsl:if test="../@readed='no'"><br /><xsl:text>　未読。</xsl:text></xsl:if></td>
	</tr>
</xsl:template>


<!-- ナビゲーションリンクテンプレート -->

<!-- ヘッダナビゲーション -->
<xsl:template match="INDEX" mode="navi">
<xsl:param name="pageName" />
<xsl:apply-templates select="ITEM[@name = $pageName]" mode="naviSelf"/>
</xsl:template>

<xsl:template match="ITEM" mode="naviSelf">
<xsl:apply-templates select="preceding-sibling::ITEM[1]" mode="naviPrev"/>
<xsl:apply-templates select="following-sibling::ITEM[1]" mode="naviNext"/>
</xsl:template>

<xsl:template match="ITEM" mode="naviPrev">
<link rel="Prev" href="{concat(@name,$extension)}"/>
</xsl:template>

<xsl:template match="ITEM" mode="naviNext">
<link rel="Next" href="{concat(@name,$extension)}"/>
</xsl:template>

<!-- 通常リンク -->
<xsl:template match="INDEX" mode="normal">
<xsl:param name="pageName" />
<xsl:apply-templates select="ITEM[@name = $pageName]" mode="normalSelf"/>
</xsl:template>

<xsl:template match="ITEM" mode="normalSelf">
<ul>
<xsl:apply-templates select="preceding-sibling::ITEM[1]" mode="normalPrev"/>
<xsl:apply-templates select="following-sibling::ITEM[1]" mode="normalNext"/>
</ul>
</xsl:template>

<xsl:template match="ITEM" mode="normalPrev">
<li><a href="{concat(@name,$extension)}">
<q><xsl:value-of select="document(concat(@name,'.xml'))/bld:BOOKS/@title"/></q><xsl:text>に戻る</xsl:text>
</a></li>
</xsl:template>

<xsl:template match="ITEM" mode="normalNext">
<li><a href="{concat(@name,$extension)}">
<q><xsl:value-of select="document(concat(@name,'.xml'))/bld:BOOKS/@title"/></q><xsl:text>に進む</xsl:text>
</a></li>
</xsl:template>

</xsl:stylesheet>
