・<xsl:apply-template>の記述順に従い、再帰的に処理され表示される。
[サンプルXML文書を表示](下のフレームに)
XMLソース
<?xml version="1.0" encoding="Shift_JIS" ?>
<?xml-stylesheet type="text/xsl" href="xsl06.xsl"?>
<start>
<title>KodayanHomepage</title>
<contents>サイト構成
<web>CSSとDynamicHTML</web>
<pc>大阪日本橋DOS/Vプロムナード</pc>
<web>XMLって?</web>
<web>PerlでCGI</web>
<pc>日本橋DOS/Vショップ一覧</pc>
<web>Java Applet</web>
<oth>お気に入りLinks</oth>
<web>Java Script</web>
<oth>その他
<othx>HP履歴</othx>
<othy>掲示板</othy>
<othz>お知らせ</othz>
</oth>
</contents>
<end>以上です(01/4/5)</end>
</start>
XSLソース
<?xml version="1.0" encoding="Shift_Jis"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:apply-templates select="start"/>
</xsl:template>
<xsl:template match="start">
<xsl:apply-templates select="title"/>
<xsl:apply-templates select="contents"/>
<xsl:apply-templates select="contents/pc"/>
</xsl:template>
<xsl:template match="title">
<center><H3><xsl:value-of /></H3></center>
</xsl:template>
<xsl:template match="contents">
<xsl:apply-templates select="pc"/>
<xsl:apply-templates select="oth"/>
<xsl:apply-templates select="web"/>
</xsl:template>
<xsl:template match="pc">
<p style="color:red"><xsl:value-of /></p>
</xsl:template>
<xsl:template match="oth">
<p style="color:blue"><xsl:value-of /></p>
<xsl:apply-templates select="othz"/>
</xsl:template>
<xsl:template match="othz">
<H5 style="color:magenta"><xsl:value-of /></H5>
</xsl:template>
</xsl:stylesheet>
end(01/4/5)