<apply-templates/>の動作チェック 4

<apply-templates/>を徳島用のテンプレートの中にだけ書いた。 すると、徳島要素の子供(県庁所在地要素)にテンプレートが適用さ れている。
【sample015.xml】
<?xml version="1.0" encoding="Shift_JIS" ?>
<?xml-stylesheet href="sample015.xsl" type="text/xsl" ?>
<四国>
	<愛媛><県庁所在地>松山市</県庁所在地></愛媛>
	<香川><県庁所在地>高松市</県庁所在地></香川>
	<徳島><県庁所在地>徳島市</県庁所在地></徳島>
	<高知><県庁所在地>高知市</県庁所在地></高知>
</四国>


【sample015.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="四国">
<p>四国を発見しました</p>
<xsl:apply-templates />
</xsl:template>

<xsl:template match="愛媛">
<p>愛媛を発見しました</p>
</xsl:template>

<xsl:template match="香川">
<p>香川を発見しました</p>
</xsl:template>

<xsl:template match="徳島">
<p>徳島を発見しました</p>
<xsl:apply-templates />
</xsl:template>

<xsl:template match="高知">
<p>高知を発見しました</p>
</xsl:template>

<xsl:template match="県庁所在地">
<p>県庁所在地を発見しました</p>
</xsl:template>

</xsl:stylesheet>


【結果】