Please visit our sponsors !
The <xsl:attribute> Element
Definition and Usage
The <xsl:attribute> element is used to add attributes to elements.
Note: The <xsl:attribute> element replaces existing
attributes with equivalent names.
Note: This element may have NON-standard behavior in IE 5.X!
Syntax
<xsl:attribute name="attributename" namespace="uri">
<!-- Content:template -->
</xsl:attribute><xsl:attribute
|
Attributes
Attribute |
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:
<picture>
<xsl:attribute name="source"/>
</picture>
|
Example 2
Add a source attribute to the picture element and fill it with values from
"images/name" :
<picture>
<xsl:attribute name="source">
<xsl:value-of select="images/name" />
</xsl:attribute>
</picture>
|
Example 3
Create an 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>
|
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|