欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

XSLT <xsl:attribute> 元素

定義和用法

<xsl:attribute> 元素用于向元素添加屬性。

注釋:<xsl:attribute> 元素會替換名稱相同的已有屬性。

語法

<xsl:attribute name="attributename" namespace="uri">
  <!-- Content:template -->
</xsl:attribute>

屬性

屬性 描述
name attributename 必需。規(guī)定屬性的名稱。
namespace URI 可選。為屬性定義命名空間的 URI。

實例

例子 1

向 picture 元素添加 source 屬性:

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

例子 2

向 picture 元素添加 source 屬性,并使用 "images/name" 中的值為其賦值:

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

例子 3

創(chuàng)建能夠應(yīng)用到任何輸出元素的屬性集:

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