Skip to main content

XSLT <xsl:attribute-set>

XSLT <xsl:attribute-set>

The <xsl:attribute-set> element creates a named set of attributes. The attribute-set can be applied as whole to the output document.

note

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

Syntax

<xsl:attribute-set name="name" use-attribute-sets="name-list">

<!-- Content:xsl:attribute* -->

</xsl:attribute-set>

Attributes

AttributeValueRequired/OptionalDescription
namenameRequiredSpecifies the name of the attribute-set
use-attribute-setsname-listOptionalA white space separated list of other attribute-sets to use in the attribute-set

Example

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

example.xsl
<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>