XSLT <xsl:attribute>
❮ XSLT ဒြပ်စင် အကိုးအကားကို အပြီးသတ်ပါ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ဒြပ်စင်များသို့ attribute များထည့်ရန် <xsl:attribute> ဒြပ်စင်ကို အသုံးပြုသည်။
မှတ်ချက်- <xsl:attribute> ဒြပ်စင်သည် လက်ရှိ attribute များကို တူညီသောအမည်များဖြင့် အစားထိုးသည်။
အထားအသို
<xsl:attribute name="attributename" namespace="uri">
<!-- Content:template -->
</xsl:attribute>
ဂုဏ်တော်
Attribute | Value | Description |
---|---|---|
name | attributename | Required. Specifies the name of the attribute |
namespace | URI | Optional. Defines the namespace URI for the attribute |
ဥပမာ ၁
ပုံဒြပ်စင်သို့ အရင်းအမြစ်အရည်အချင်းကို ထည့်ပါ-
<picture>
<xsl:attribute name="source"/>
</picture>
ဥပမာ ၂
ပုံဒြပ်စင်သို့ ရင်းမြစ် အရည်အချင်းကို ပေါင်းထည့်ကာ "images/name" မှ တန်ဖိုးများဖြင့် ဖြည့်ပါ-
<picture>
<xsl:attribute name="source">
<xsl:value-of select="images/name" />
</xsl:attribute>
</picture>
ဥပမာ ၃
မည်သည့် အထွက်ဒြပ်စင်သို့မဆို အသုံးချနိုင်သော အရည်အချင်း-အစုံကို ဖန်တီးပါ-
<xsl:attribute-set name="font">
<xsl:attribute name="fname">Arial</xsl:attribute>
<xsl:attribute name="size">14px</xsl:attribute>
<xsl:attribute name="color">red</xsl:attribute>
</xsl:attribute-set>
❮ XSLT ဒြပ်စင် အကိုးအကားကို အပြီးသတ်ပါ။