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>

Atribute

Atribute Halaga Paglalarawan
name name Hindi puwedeng wala. Tumutukoy sa pangalan ng attribute-set.
use-attribute-sets name-list Opsiyonal. Ang listahan ng ibang attribute-set na ginamit sa attribute-set na ito, na hinahati ng espasyo.

Mga Halimbawa

Halimbawa 1

Lumikha ng attribute-set na maaaring gamitin sa anumang elemento ng output (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>