Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

xsl:variable

 

Syntax

Description

Declare a local or global variable. If the <xsl:variable> instruction appears at the top level of the style sheet as a child of the <xsl:stylesheet> document element, it is a global variable with a scope that includes the entire style sheet. Otherwise, it is a local variable with a scope of its following siblings and their descendants.

Attributes

nameSpecifies the name of the variable. After declaration, the variable can be referred to within XPath expressions using this name, prefixed with the $ character.
select(Optional) Determines the value of the variable. The value of the variable is determined either by the select attribute or by the contents of the <xsl:variable> element. Do not specify both a select attribute and some content; we recommend using the select attribute so as not to create a result tree fragment.

Usage Examples

See Example: Limiting the Number of E1 Interfaces, Example: Limiting the Number of ATM Virtual Circuits, Example: Configuring Administrative Groups for LSPs, and Example: Automatically Configuring Logical Interfaces and IP Addresses.