XSLT <xsl:attribute-set>
❮ Complete XSLT Element Reference
定義和用法
The <xsl:attribute-set> element creates a named set of attributes. The attribute-set can be applied as whole to the output document.
注意: 必須是 <xsl:stylesheet> 或 <xsl:transform> 的子元素。
語法
<xsl:attribute-set
name="name" use-attribute-sets="name-list">
<!-- Content:xsl:attribute* -->
</xsl:attribute-set>
屬性
Attribute | 值 | 描述 |
---|---|---|
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>
❮ Complete XSLT Element Reference