<xsl:for-each>の動作確認用テスト1
このサンプルでは<xsl:for-each>は使っていない。
次のサンプルと合わせて確認すること。コンテキストノードが定食要素に
なったあと、定食用のテンプレートが処理されている。
【sample022.xml】
<?xml version="1.0" encoding="Shift_JIS" ?>
<?xml-stylesheet href="sample022.xsl" type="text/xsl" ?>
<定食メニュー>
<定食>焼肉定食</定食>
<定食>マーボ定食</定食>
<定食>餃子定食</定食>
<定食>ラーメン定食</定食>
</定食メニュー>
【sample022.xsl】
<?xml version="1.0" encoding="Shift_JIS" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="Shift_JIS" />
<xsl:template match="定食メニュー">
<html>
<head>
<title><xsl:for-each>の動作確認用テスト1</title>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="定食">
<p>定食が発見されました</p>
</xsl:template>
</xsl:stylesheet>
【結果】