only for RuBoard |
xsl:attribute creates an attribute of an output element.
Attribute Name | Enforced | Description | Values |
---|---|---|---|
name | Required | The name of the attribute to add to the output element | QName |
namespace | Optional | The namespace to be used for the attribute | URI reference |
Given the XML instance document, links.xml :
<?xml version="1.0" encoding="utf-8" ?> <links> <link id="newriders" URL="http://www.newriders.com" name="NewRiders.com" description="Available books by New Riders" /> </links>
The following template rule generates an anchor tag:
<xsl:template match="link"> <a> <xsl:attribute name="href"> <xsl:value-of select="@URL"/> </xsl:attribute> <xsl:value-of select="@name" /> </a> </xsl:template>
This results in the following markup:
<a href=http://www.newriders.com>Available books by New Riders</a>
xsl:copy, xsl:element, xsl:for-each, xsl:if, xsl:otherwise, xsl:param, xsl:template, xsl:variable, xsl:when, xsl:with-param
xsl:apply-templates, xsl:call-template, xsl:choose, xsl:copy, xsl:copy-of, xsl:for-each, xsl:if, xsl:text, xsl:variable
only for RuBoard |