एक्सएसएलटी <xsl:विशेषता>
❮ पूर्ण एक्सएसएलटी तत्व संदर्भ
परिभाषा और उपयोग
तत्वों में गुण जोड़ने के लिए <xsl:attribute> तत्व का उपयोग किया जाता है।
नोट: <xsl: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 |
उदाहरण 1
चित्र तत्व में स्रोत विशेषता जोड़ें:
<picture>
<xsl:attribute name="source"/>
</picture>
उदाहरण 2
चित्र तत्व में स्रोत विशेषता जोड़ें और इसे "छवियों/नाम" से मानों से भरें:
<picture>
<xsl:attribute name="source">
<xsl:value-of select="images/name" />
</xsl:attribute>
</picture>
उदाहरण 3
एक विशेषता-सेट बनाएं जिसे किसी भी आउटपुट तत्व पर लागू किया जा सके:
<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>
❮ पूर्ण एक्सएसएलटी तत्व संदर्भ