Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XSLT Element

XSLT xsl:attribute Element


XSLT Element Reference Manual 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:

Arial

14px

red


XSLT Element Reference Manual Complete XSLT Element Reference Manual