XSLT <xsl:attribute-set> Element

Definition and Usage

The <xsl:attribute-set> element can create named attribute sets. This attribute set (attribute-set) can be applied to the output document as a whole.

Note:Must be a child element of <xsl:stylesheet> or <xsl:transform>.

Syntax

<xsl:attribute-set
name="name" use-attribute-sets="name-list">
  <!-- Content:xsl:attribute* -->
</xsl:attribute-set>

Attribute

Attribute Value Description
name name Required. Specifies the name of the attribute set.
use-attribute-sets name-list Optional. A list of other attribute sets used in this attribute set, separated by spaces.

Instance

Example 1

Create an attribute set (attribute-set) that can be applied to any output element:

<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>