January 1, 2002 - Setting Variables in XSLT
January 1, 2002 Setting Variables in XSLT Tips: January 2002
Yehuda Shiran, Ph.D.
|
xsl:param
tag. You position this tag in the front section of your script, before the HEAD
statament. Here is an example:
<xsl:param name="forecast" select="50000"/>
And here is an example for the whole front section:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="https://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:param name="forecast" select="50000"/>
<xsl:template match="/">
<HTML>
...
...
...
You use a variable by prefixing its name with a $
sign. For example:
$forecast