- PR -

xls:ifについて

1
投稿者投稿内容
nk
会議室デビュー日: 2008/05/21
投稿数: 1
投稿日時: 2008-05-21 13:24
xslについて勉強を始めたばかりの初心者です。

<xls:if>について質問です。
xmlファイルのある要素(year)と
メニューの選択値を比較したいのですが、
記述方法がよくわかりません。
どなたか教えていただきたく、初めて投稿しました。

<現状>

○htmlファイルにてメニュー
<form name="iform">
<select name="selyear2" >
  <option VALUE="2007">2007年度</option>
<option VALUE="2008">2008年度</option>
<option VALUE="2009">2009年度</option>
</select>
</form>

○xslファイルにて比較
<?xml version="1.0" encoding="Shift_JIS" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<xsl:apply-templates select="doc" />
</xsl:template>
<xsl:template match="doc">
:(途中省略)
<xsl:for-each select="info">
<xsl:sort select="no"
data-type="text" order="ascending" />
<xsl:if test= "year=iform.selyear2.value">←ココで比較したい。
  :(省略)

○xmlファイル
<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE doc SYSTEM "doc.dtd">
<doc>
<info>
<no>0059</no>
<date>07/04/26</date>
<year>2007</year>
   :(途中省略)
  </info>
</doc>

1

スキルアップ/キャリアアップ(JOB@IT)