XSLT <xsl:apply-templates> အကိုးအကာ

<xsl:apply-templates> အကိရိယာ သည် တစ်ခုခု သို့မဟုတ် တစ်ခုခု၏ အရောက်များ သို့ ပုံစံကို ရည်ရွယ်ပြီး အသုံးပြုနိုင်သည်။

<xsl:apply-templates> အကိရိယာ

<xsl:apply-templates> အကိရိယာ သည် တစ်ခုခု သို့မဟုတ် တစ်ခုခု၏ အရောက်များ သို့ ပုံစံကို ရည်ရွယ်ပြီး အသုံးပြုနိုင်သည်။

အကြောင်းကြားပြီး ကျွန်ုပ်တို့သည် <xsl:apply-templates> အကိရိယာကို select အကိုးးအချုပ် တစ်ခု အပ်နှံပါက အကိုးးအချုပ် နှင့် ကိုက်ညီသော အရောက်များကို သာလျှင် ဖြင့်ဖြတ်တင်ပြခြင်းဖြစ်သည်။ ကျွန်ုပ်တို့သည် select အကိုးးအချုပ် ကို အရောက်အချုပ် ဖြင့် ဖြင့်ဖြတ်တင်ပြခြင်း အထားကို ချင်းပြောင်းခြင်းပြုနိုင်သည်။

မြင်ပါ အောက်ပါ XSL ပုံစံအချက်အလက်များ:

<?xml version="1.0" encoding="ISO-8859-1"?>
<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>

ဤ XML ဖိုင် ကြည့်ရှုဤ XSL ဖိုင် ကြည့်ရှုရလဒ်များ ကြည့်ရှု