Latest web development tutorials

XSLT <xsl:attribute-set> 元素

XSLT 元素參考手冊 完整的XSLT元素參考手冊

定義和用法

<xsl:attribute-set> 元素可創建命名的屬性集。 該屬性集(attribute-set)可作為整體應用到輸出文檔。

注意:必須是<xsl:stylesheet>或<xsl:transform>的子節點。


語法

<xsl:attribute-set
name="name" use-attribute-sets="name-list">

<!-- Content:xsl:attribute* -->

</xsl:attribute-set>

屬性

属性 描述
name name 必需。规定属性集(attribute-set)的名称。
use-attribute-sets name-list 可选。在该属性集(attribute-set)中使用的其它属性集(attribute-set)的列表,由空格分隔。

實例1

創建可應用到任何輸出元素的屬性集(attribute-set):

<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 元素參考手冊 完整的XSLT元素參考手冊