Latest web development tutorials

XSLT <xsl: Atribut> elemen

Pedoman XSLT Elemen Referensi Lengkap manual XSLT Elemen Referensi

Definisi dan Penggunaan

<XSL: atribut> elemen digunakan untuk menambahkan atribut ke elemen.

CATATAN: <xsl: Atribut> elemen menggantikan atribut yang ada dengan nama yang sama.


tatabahasa

<xsl:attribute name="attributename" namespace="uri">

<!-- Content:template -->

</xsl:attribute>

milik

属性 描述
name attributename 必需。规定属性的名称。
namespace URI 可选。为属性定义命名空间的 URI。

contoh 1

Menambah atribut sumber elemen gambar:

<picture>
<xsl:attribute name="source"/>
</picture>

contoh 2

Menambah elemen gambar atribut sumber, dan penggunaan "images / nama" nilai tugas mereka:

<picture>
<xsl:attribute name="source">
<xsl:value-of select="images/name" />
</xsl:attribute>
</picture>

contoh 3

Membuat satu set atribut dapat diterapkan untuk setiap elemen keluaran:

<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>


Pedoman XSLT Elemen Referensi Lengkap manual XSLT Elemen Referensi