XSLT xsl:attribute Element
Complete XSLT Element Reference Manual
Definition and Usage
xsl:attributeelement is used to add an attribute to an element.
Note:xsl:attribute element replaces an existing attribute with the same name.
Syntax
property
| property | Value | Description |
|---|---|---|
| name | attributename | Required. Specifies the name of the attribute. |
| namespace | URI | Optional. Defines the namespace URI for the attribute. |
Example 1
Add a source attribute to the picture element:
Example 2
Add a source attribute to the picture element and assign it the value "images/name":
Example 3
Create an attribute set that can be applied to any output element:
Complete XSLT Element Reference Manual