Name

<xsl:variable>

Synopsis

The top-level <xsl:variable> element binds a name to a value of any type (string, number, node set, etc.). The value can then be dereferenced elsewhere in the style sheet using the form $ name in attribute value templates. Once a variable name has been assigned a value, it cannot change. The select attribute is an optional expression that sets the value of the variable. If <xsl:variable> has a select attribute, then it must be an empty element.

<xsl:variable
   name="name"
   [select="expression"]>
   ...
</xsl:variable>

Get Webmaster in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.