Microsoft XML SDK 2.6 - XSLT Reference

xsl:variable Element

Specifies a value bound in an expression.

<xsl:variable
  name = Qname
  select = expression>
</xsl:variable>

Attributes

name
Required. Specifies the name of the variable.
select
The value of the attribute is an expression, and the value of the variable is the object that results from evaluating the expression. When this attribute is specified, the content of <xsl:variable> must be empty.

Element Information

Number of occurrences Unlimited
Parent elements xsl:attribute, xsl:comment, xsl:copy, xsl:element, xsl:for-each, xsl:if, xsl:otherwise, xsl:param, xsl:processing-instruction, xsl:stylesheet xsl:template, xsl:variable, xsl:when, xsl:with-param, output elements
Child elements xsl:apply-templates, xsl:attribute, xsl:choose, xsl:comment, xsl:copy, xsl:copy-of, xsl:element, xsl:for-each, xsl:if, xsl:processing-instruction, xsl:text, xsl:value-of, xsl:variable, output elements

Remarks

The value of the variable may be an object of any type that can be returned by an expression. The <xsl:variable> element can specify the value of the variable in three alternative ways:

See Also

xsl:param