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

1つ前のサンプルとのちがいに注意。 四国用のテンプレートの中に<apply-templates />を書いた。 これで子供に対してもテンプレートが適用される。
【sample013.xml】
<?xml version="1.0" encoding="Shift_JIS" ?>
<?xml-stylesheet href="sample013.xsl" type="text/xsl" ?>
<四国>
	<愛媛></愛媛>
	<香川></香川>
	<徳島></徳島>
	<高知></高知>
</四国>


【sample013.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:template>

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

</xsl:stylesheet>


【結果】