Using Variables to Store Values that Do Not Change

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XSLT Developer's Guide

Using Variables to Store Values that Do Not Change

In XSLT, variables are the same as constants in programming and scripting languages. Variables identify generically named objects, from which a specific value can be retrieved.

Unlike programming and scripting constants, the value of an XSLT variable can be set at run time by some condition in the XML source document or in the style sheet. Because these conditions can change from one transformation to the next, these objects are known as variables rather than constants.

The <xsl:variable> element is used to set the value of a variable. The following topics use the weatherlog.xml example to illustrate utilities of XSLT variables.

See Also

Initial XSLT Example Using Variables