XSLT <xsl:apply-templates> ဒြပ်စင်
<xsl:apply-templates> ဒြပ်စင်သည် လက်ရှိဒြပ်စင် သို့မဟုတ် လက်ရှိဒြပ်စင်၏ ကလေး node များတွင် နမူနာပုံစံစည်းမျဉ်းကို သက်ရောက်သည်။
<xsl:apply-templates> ဒြပ်စင်
<xsl:apply-templates> ဒြပ်စင်သည် လက်ရှိဒြပ်စင် သို့မဟုတ် လက်ရှိဒြပ်စင်၏ ကလေး node များအတွက် နမူနာပုံစံကို အသုံးပြုသည်။
<xsl:apply-templates> ဒြပ်စင်သို့ "select" attribute ကို ထည့်ပါက၊ ၎င်းသည် attribute ၏တန်ဖိုးနှင့် ကိုက်ညီသော ကလေးဒြပ်စင်များကိုသာ လုပ်ဆောင်မည်ဖြစ်ပါသည်။ ကလေး node များကို မည်သည့်အစီအစဥ်တွင် လုပ်ဆောင်ရမည်ကို သတ်မှတ်ရန် "select" attribute ကို အသုံးပြုနိုင်ပါသည်။
အောက်ပါ XSL စတိုင်စာရွက်ကို ကြည့်ပါ။
ဥပမာ
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="cd">
<p>
<xsl:apply-templates select="title"/>
<xsl:apply-templates select="artist"/>
</p>
</xsl:template>
<xsl:template match="title">
Title: <span style="color:#ff0000">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
<xsl:template match="artist">
Artist: <span style="color:#00ff00">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
</xsl:stylesheet>