XSLT <xsl:attribute-set> 要素
定義と使用方法
<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 | 必須。属性集の名前を指定します。 |
use-attribute-sets | name-list | オプション。この属性集中で使用される他の属性集のリストを、スペースで区切って指定します。 |
例
例 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>