XSLT <xsl:attribute> ਈਲੀਮੈਂਟ
ਪਰਿਭਾਸ਼ਾ ਅਤੇ ਵਰਤੋਂ
<xsl:attribute> ਈਲੀਮੈਂਟ ਈਲੀਮੈਂਟ ਵਿੱਚ ਅਟਰੀਬਿਊਟ ਜੋੜਨ ਲਈ ਵਰਤਿਆ ਜਾਂਦਾ ਹੈ。
ਟਿੱਪਣੀਆਂ:<xsl:attribute> ਈਲੀਮੈਂਟ ਨਾਮ ਦੇ ਅਟਰੀਬਿਊਟ ਦੇ ਮੌਜੂਦਾ ਅਟਰੀਬਿਊਟ ਨੂੰ ਬਦਲ ਦੇਵੇਗਾ。
ਗਰਮਾਤਾ
<xsl:attribute name="attributename" namespace="uri"> <!-- Content:template --> </xsl:attribute>
ਅਟਰੀਬਿਊਟ
ਅਟਰੀਬਿਊਟ | ਮੁੱਲ | ਵਰਣਨ |
---|---|---|
name | attributename | ਲਾਜ਼ਮੀ। ਅਟਰੀਬਿਊਟ ਦੇ ਨਾਮ ਨਿਰਧਾਰਿਤ ਕਰੋ。 |
namespace | URI | ਵਿਕਲਪੀ। ਅਟਰੀਬਿਊਟ ਦੇ ਨਾਮ ਦੀ ਨਾਮਸਪੇਸ ਦੀ URI ਨਿਰਧਾਰਿਤ ਕਰੋ। |
ਮਾਡਲ
ਉਦਾਹਰਣ 1
ਪਿਕਚਰ ਈਲੀਮੈਂਟ ਵਿੱਚ source ਅਟਰੀਬਿਊਟ ਜੋੜੋ:
<picture> <xsl:attribute name="source"/> </picture>
مثال 2
پائیکچر عنصر کو اسور ایٹریبیوٹ جوڑیں، اور اس کو "images/name" میں کیے گئے کی ویلو میں دوبارہ مقرر کریں:
<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>