Attributes

Attributes
<xsl:attribute name=”qname” namespace=”URI” >

</xsl:attribute>

The xsl:attribute element allows you to create an attribute node, define a value, and add it to the output. In simple terms, you are creating a custom attribute whose value can be displayed.
After a child node has been added to an element, no additional attributes can be added to the parent node. This restriction is required so that the XSL processor does not have to store the entire result tree in memory while searching for additional attributes.
The related xsl:attribute-set can serve as a container for a collection of xsl:attribute elements.

This is not a self-closing element. The separate closing element is mandatory.

name=”qname”
The mandatory name attribute is the qname of the attribute to be displayed in output. A qname is a qualified name that is composed of an optional namespace prefix, a colon, which is only present if there is a prefix, and a mandatory XML name (for example, xsl:zipcode or zipcode).
The name is one of a very few attributes that can be set to an expression that is computed at run-time. (Such attributes are interpreted as Attribute Value Templates.) The syntax for doing this is demonstrated with the following code fragment:
<xsl:attribute name=”{$att_name}” />
namespace=”URI”
The optional namespace attribute is the namespace URI (Universal Resource Identifier) of the attribute. The namespace is one of a very few attributes that can be set to an expression that is computed at run-time. (Such attributes are interpreted as Attribute Value Templates.)
Attribute set
<xsl:attribute-set name=”qname” use-attribute-sets=”qnames” >

</xsl:attribute-set>

The xsl:attribute-set element defines and names a set containing zero or more xsl:attribute elements. Each of the xsl:attribute elements are applied to the output in the order that they occur inside thexsl:attribute-set element.
An xsl:attribute element allows you to create an attribute node, define a value, and add it to the output.
The xsl:attribute-set element can only be a child of the xsl:stylesheet or the xsl:transform elements. The concept is that you can create a set of attributes that can be applied more than once by simply calling the attribute set by name.
This is not a self-closing element. The separate closing element is mandatory.
name=”qname”
The mandatory name attribute is the name of the attribute set. It must be a qname. A qname is a qualified name that is composed of an optional namespace prefix, a colon, which is only present if there is a prefix, and a mandatory XML name (for example, xsl:zipcode or zipcode).
use-attribute-sets=”qnames”
The optional use-attribute-sets attribute is a white-space-delimited list of one or more qnames of attribute sets. In other words, it is a collection of attribute set names. Each of the xsl:attribute elements in all of the attribute sets are applied to the output in the order in which they occur in the use-attribute-sets attribute.
This is done by adding the use-attribute-sets attribute to the HTML tag or XSLT element using the following syntax:
<table xsl:use-attribute-sets=”name”>
<xsl:copy use-attribute-sets=”name”> … </xsl:copy>