<?xml version="1.0" encoding="shift_jis" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- (c) Misato Kiryuh これでも一生懸命作ってるんですっ！-->
<xsl:param name="minRank" />
<xsl:param name="maxRank" />
<xsl:param name="preSuf" />

<xsl:template match="escrolls"><!--検索部メイン-->

	<p><a name="result"><img src="icon.gif" width="20" height="20" alt="　" />検索結果</a></p>
<xsl:choose>
	<xsl:when test="$minRank &gt; $maxRank">
		<a href="#1">注意点をよく読んでください。。ごめんなしゃい。</a>
	</xsl:when>
	<xsl:otherwise>
	
	<table cellspacing="1" cellpadding="0" bgcolor="#000000">
	<tr><th class="be">名前</th><th class="be">ランク</th><th class="be">頭/尾</th><th class="be">効果/e</th><th class="be">アイテム</th><th class="be">エンチャ<br />可能場所</th></tr>

<xsl:if test="(scroll/r &gt;= $minRank)and(scroll/r &lt;= $maxRank)">
	<xsl:choose>
		<xsl:when test="$preSuf!=''">
			<xsl:apply-templates select="scroll[(r &gt;= $minRank)and(r &lt;= $maxRank)and(posi = $preSuf)]" />
			<!--データの登録順が昇順＋接頭と接尾で分けて登録しているので、こちらではランクのソートの必要なし-->
		</xsl:when>
		<xsl:otherwise>
			<xsl:apply-templates select="scroll[(r &gt;= $minRank)and(r &lt;= $maxRank)]">
				<xsl:sort select="r" data-type="number" /><!--昇順並べ替え-->
			</xsl:apply-templates>
		</xsl:otherwise>
	</xsl:choose>
</xsl:if>

	</table>
	
	</xsl:otherwise>
</xsl:choose>
	
</xsl:template><!--検索部メイン終了-->

<xsl:template match="scroll">
	<tr><td align="center" bgcolor="#ffffff">
		<xsl:choose>
			<xsl:when test="name[@gazo=1]">
				<a target="_blank" title="クリックするとスクロールの画像が表示されます。">
				<xsl:attribute name="href">
				./drop/
				<xsl:value-of select="name" />
				.gif
				</xsl:attribute>
				<xsl:apply-templates select="name" />
				</a>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates select="name" />
			</xsl:otherwise>
		</xsl:choose>
	</td><td align="center" bgcolor="#ffffff">
		<xsl:value-of select="rank" />
	</td><td align="center" bgcolor="#ffffff">
		<xsl:apply-templates select="posi" />
	</td><td align="center" bgcolor="#ffffff">
		<xsl:apply-templates select="effect" />
		<!--<xsl:apply-templates select="e" />-->
	</td><td align="center" bgcolor="#ffffff">
		<xsl:apply-templates select="item" />
	</td><td align="center" bgcolor="#ffffff">
		<xsl:if test="pla=''">
			全体
		</xsl:if>
		<xsl:apply-templates select="pla" />
	</td></tr>
	
</xsl:template>

<xsl:template match="name">
	<xsl:value-of select="." /><br />
</xsl:template>

<xsl:template match="posi">
	<xsl:choose>
		<xsl:when test=".='prefix'">
			頭
		</xsl:when>
		<xsl:otherwise>
			尾
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="effect">
	<font>
		<xsl:attribute name="style">
			color:
			<xsl:choose>
				<xsl:when test="contains(.,'増加')">#0000ff</xsl:when>
				<xsl:otherwise>#ff0000</xsl:otherwise>
			</xsl:choose>
			;
		</xsl:attribute>
	<xsl:value-of select="." />
	</font><br />
</xsl:template>

<!--
<xsl:template match="e">
	<xsl:value-of select="." />/
</xsl:template>
-->

<xsl:template match="item">
	<xsl:choose>
		<xsl:when test="@no!=''">
			<!--<a target="_blank">
				<xsl:attribute name="href">
					drop.xml#<xsl:value-of select="@no" />
				</xsl:attribute>-->
				<xsl:value-of select="." />
			<!--</a>-->
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="." />
		</xsl:otherwise>
	</xsl:choose>
	<br />
</xsl:template>

<xsl:template match="pla">
	<xsl:value-of select="." /><br />
</xsl:template>

</xsl:stylesheet>
