> XSLT中文手册 > XSLT <xsl:attribute-set> 元素

XSLT <xsl:attribute-set> 元素


完整的 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 元素参考手册