XSLT <xsl:attribute-set> 元素
定義和用法
<xsl:attribute-set> 元素可創(chuàng)建命名的屬性集。該屬性集(attribute-set)可作為整體應用到輸出文檔。
注釋:必須是 <xsl:stylesheet> 或 <xsl:transform> 的子節(jié)點。
語法
<xsl:attribute-set name="name" use-attribute-sets="name-list"> <!-- Content:xsl:attribute* --> </xsl:attribute-set>
屬性
屬性 | 值 | 描述 |
---|---|---|
name | name | 必需。規(guī)定屬性集的名稱。 |
use-attribute-sets | name-list | 可選。在該屬性集中使用的其它屬性集的列表,由空格分隔。 |
實例
例子 1
創(chuàng)建可應用到任何輸出元素的屬性集(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>