<?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:param name="staTus" />

<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>

<xsl:apply-templates select="scroll[(r &gt;= $minRank)and(r &lt;= $maxRank)and((contains(e, $staTus))or(contains(e1, $staTus))or(contains(e2, $staTus))or(contains(e3, $staTus))or(contains(e4, $staTus))or(contains(e5, $staTus))or(contains(e6, $staTus)))and(contains(posi, $preSuf))]">
	<xsl:sort select="r" data-type="number" /><!--昇順並べ替え-->
</xsl:apply-templates>

	</xsl:otherwise>
</xsl:choose>
	
</xsl:template><!--検索部メイン終了-->

<xsl:template match="scroll">
	<table width="600"><tr><td class="es" width="50%">
	<xsl:if test="name1!=''">
		<xsl:choose>
			<xsl:when test="name1[@gazo=1]">
				<a target="_blank" title="クリックするとスクロールの画像が表示されます。">
				<xsl:attribute name="href">
				./drop/
				<xsl:value-of select="name1" />
				.gif
				</xsl:attribute>
				<xsl:apply-templates select="name1" />
				</a>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates select="name1" />
			</xsl:otherwise>
		</xsl:choose><br />
	</xsl:if><!--name1が全部終わったら、このifをとって、下のgazo=1のリンクのやつを取る-->
		<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><br />
		(<xsl:apply-templates select="posi" />=ランク<xsl:value-of select="rank" />)<br />

		<font color="#6666ff">
		<xsl:if test="pla=''">
			全体
		</xsl:if>
		<xsl:apply-templates select="pla" />にエンチャント可能
		</font><br />
		<xsl:apply-templates select="effect" />
		<!--<xsl:apply-templates select="e" />-->
		</td><td>
		主な収集アイテム：<br />
		<xsl:apply-templates select="item" />
	</td></tr>
	</table><br />
	
</xsl:template>

<xsl:template match="name1">
	<xsl:value-of select="." />
</xsl:template>
<xsl:template match="name">
	<xsl:value-of select="." />　
</xsl:template>

<xsl:template match="posi">
	<xsl:choose>
		<xsl:when test=".='prefix'">prefix</xsl:when>
		<xsl:otherwise>suffix</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="effect">
	<font>
		<xsl:attribute name="style">
			color:
			<xsl:choose>
				<xsl:when test="(contains(.,'増加'))or(contains(.,'弱そう'))or(contains(.,'ランクに関係なく'))">
					<xsl:choose>
						<xsl:when test="contains(.,'修理費')">#ff0000</xsl:when>
						<xsl:otherwise>#6666ff</xsl:otherwise>
					</xsl:choose>
				</xsl:when>
				<xsl:otherwise>
					<xsl:choose>
						<xsl:when test="(contains(.,'減少'))and(contains(.,'修理費'))">#6666ff</xsl:when>
						<xsl:otherwise>#ff0000</xsl:otherwise>
					</xsl:choose>
				</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="." />　
</xsl:template>

</xsl:stylesheet>
